Repository navigation
fix: add a few missing parts to setup.cfg setup #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,25 +128,26 @@ an escape hatch when absolutely necessary. | |
| # replace with your username: | ||
| name = example-pkg-YOUR-USERNAME-HERE | ||
| version = 0.0.1 | ||
| url = https://github.com/pypa/sampleproject | ||
| author = Example Author | ||
| author_email = author@example.com | ||
| description = A small example package | ||
| long_description = file: README.md | ||
| long_description_content_type = text/markdown | ||
| url = https://github.com/pypa/sampleproject | ||
| classifiers = | ||
| Programming Language :: Python :: 3 | ||
| License :: OSI Approved :: MIT License | ||
| Operating System :: OS Independent | ||
| description = A small example package | ||
| long_description = file: README.md | ||
| long_description_content_type = text/markdown | ||
|
|
||
| [options] | ||
| packages = find: | ||
| python_requires = >=3.6 | ||
|
|
||
|
|
||
| There are a `variety of metadata and options | ||
| <https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html>`_ | ||
| supported here. This is in configparser format; do not place quotes around values. | ||
| This example package uses a relatively minimal set of options: | ||
| This example package uses a relatively minimal set of metadata: | ||
|
|
||
| - ``name`` is the *distribution name* of your package. This can be any name as | ||
| long as only contains letters, numbers, ``_`` , and ``-``. It also must not | ||
|
|
@@ -168,11 +169,6 @@ an escape hatch when absolutely necessary. | |
| - ``url`` is the URL for the homepage of the project. For many projects, this | ||
| will just be a link to GitHub, GitLab, Bitbucket, or similar code hosting | ||
| service. | ||
| - ``packages`` is a list of all Python :term:`import packages <Import | ||
| Package>` that should be included in the :term:`Distribution Package`. | ||
| Instead of listing each package manually, we can use the ``find:`` directive | ||
| to automatically discover all packages and subpackages. In this case, the | ||
| list of packages will be ``example_pkg`` as that's the only package present. | ||
| - ``classifiers`` gives the index and :ref:`pip` some additional metadata | ||
| about your package. In this case, the package is only compatible with Python | ||
| 3, is licensed under the MIT license, and is OS-independent. You should | ||
|
|
@@ -181,6 +177,17 @@ an escape hatch when absolutely necessary. | |
| your package will work on. For a complete list of classifiers, see | ||
| https://pypi.org/classifiers/. | ||
|
|
||
| In the options category, we have controls for setuptools itself: | ||
|
|
||
| - ``packages`` is a list of all Python :term:`import packages <Import | ||
| Package>` that should be included in the :term:`Distribution Package`. | ||
| Instead of listing each package manually, we can use the ``find:`` directive | ||
| to automatically discover all packages and subpackages. In this case, the | ||
| list of packages will be ``example_pkg`` as that's the only package present. | ||
| - ``python_requires`` gives the versions of Python supported by your | ||
| project. Installers like pip will look back though older versions of | ||
| packages until it finds one that has a matching Python version. | ||
|
|
||
| There are many more than the ones mentioned here. See | ||
| :doc:`/guides/distributing-packages-using-setuptools` for more details. | ||
|
|
||
|
|
@@ -227,12 +234,12 @@ an escape hatch when absolutely necessary. | |
| long_description=long_description, | ||
| long_description_content_type="text/markdown", | ||
| url="https://github.com/pypa/sampleproject", | ||
| packages=setuptools.find_packages(), | ||
| classifiers=[ | ||
| "Programming Language :: Python :: 3", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Operating System :: OS Independent", | ||
| ], | ||
| packages=setuptools.find_packages(), | ||
| python_requires='>=3.6', | ||
| ) | ||
|
|
||
|
|
@@ -259,18 +266,21 @@ an escape hatch when absolutely necessary. | |
| - ``url`` is the URL for the homepage of the project. For many projects, this | ||
| will just be a link to GitHub, GitLab, Bitbucket, or similar code hosting | ||
| service. | ||
| - ``packages`` is a list of all Python :term:`import packages <Import | ||
| Package>` that should be included in the :term:`Distribution Package`. | ||
| Instead of listing each package manually, we can use :func:`find_packages` | ||
| to automatically discover all packages and subpackages. In this case, the | ||
| list of packages will be ``example_pkg`` as that's the only package present. | ||
| - ``classifiers`` gives the index and :ref:`pip` some additional metadata | ||
| about your package. In this case, the package is only compatible with Python | ||
| 3, is licensed under the MIT license, and is OS-independent. You should | ||
| always include at least which version(s) of Python your package works on, | ||
| which license your package is available under, and which operating systems | ||
| your package will work on. For a complete list of classifiers, see | ||
| https://pypi.org/classifiers/. | ||
| - ``packages`` is a list of all Python :term:`import packages <Import | ||
| Package>` that should be included in the :term:`Distribution Package`. | ||
| Instead of listing each package manually, we can use :func:`find_packages` | ||
| to automatically discover all packages and subpackages. In this case, the | ||
| list of packages will be ``example_pkg`` as that's the only package present. | ||
| - ``python_requires`` gives the versions of Python supported by your | ||
| project. Installers like pip will look back though older versions of | ||
| packages until it finds one that has a matching Python version. | ||
|
Comment on lines
+276
to
+283
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to deduplicate the copy-pasted explanations? Do you think using the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only some of them match; the "packages" description right above it, for example, does not match since it has a discussion of the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you include from the same file? It might be fragile, though.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can only "include" from the same file with substitutions. Including with "start+end" of itself with the |
||
|
|
||
| There are many more than the ones mentioned here. See | ||
| :doc:`/guides/distributing-packages-using-setuptools` for more details. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it may be useful to also mention
project_urlsdemonstrating links to issues/docs/CI/etcThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to exactly replicate the setup.py example with no changes; would be happy to add a follow-on PR that adds anything that would be useful to add to the example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I didn't know about / start using project_urls until fairly recently, I don't I've even added it to the scikit-hep dev docs yet. But it is really nicely displayed in PyPI, so I think it's a good idea, even if not really minimal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think I've been using it for the last 3-4 years maybe...