Skip to content

Commit 1ae4b30

Browse files
authored
Merge pull request #823 from henryiii/fix/missingfind
fix: add a few missing parts to setup.cfg setup
2 parents 485adbe + 217986e commit 1ae4b30

1 file changed

Lines changed: 26 additions & 16 deletions

File tree

source/tutorials/packaging-projects.rst

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,26 @@ an escape hatch when absolutely necessary.
128128
# replace with your username:
129129
name = example-pkg-YOUR-USERNAME-HERE
130130
version = 0.0.1
131-
url = https://github.com/pypa/sampleproject
132131
author = Example Author
133132
author_email = author@example.com
133+
description = A small example package
134+
long_description = file: README.md
135+
long_description_content_type = text/markdown
136+
url = https://github.com/pypa/sampleproject
134137
classifiers =
135138
Programming Language :: Python :: 3
136139
License :: OSI Approved :: MIT License
137140
Operating System :: OS Independent
138-
description = A small example package
139-
long_description = file: README.md
140-
long_description_content_type = text/markdown
141141
142142
[options]
143+
packages = find:
143144
python_requires = >=3.6
144145
145146
146147
There are a `variety of metadata and options
147148
<https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html>`_
148149
supported here. This is in configparser format; do not place quotes around values.
149-
This example package uses a relatively minimal set of options:
150+
This example package uses a relatively minimal set of metadata:
150151

151152
- ``name`` is the *distribution name* of your package. This can be any name as
152153
long as only contains letters, numbers, ``_`` , and ``-``. It also must not
@@ -168,11 +169,6 @@ an escape hatch when absolutely necessary.
168169
- ``url`` is the URL for the homepage of the project. For many projects, this
169170
will just be a link to GitHub, GitLab, Bitbucket, or similar code hosting
170171
service.
171-
- ``packages`` is a list of all Python :term:`import packages <Import
172-
Package>` that should be included in the :term:`Distribution Package`.
173-
Instead of listing each package manually, we can use the ``find:`` directive
174-
to automatically discover all packages and subpackages. In this case, the
175-
list of packages will be ``example_pkg`` as that's the only package present.
176172
- ``classifiers`` gives the index and :ref:`pip` some additional metadata
177173
about your package. In this case, the package is only compatible with Python
178174
3, is licensed under the MIT license, and is OS-independent. You should
@@ -181,6 +177,17 @@ an escape hatch when absolutely necessary.
181177
your package will work on. For a complete list of classifiers, see
182178
https://pypi.org/classifiers/.
183179

180+
In the options category, we have controls for setuptools itself:
181+
182+
- ``packages`` is a list of all Python :term:`import packages <Import
183+
Package>` that should be included in the :term:`Distribution Package`.
184+
Instead of listing each package manually, we can use the ``find:`` directive
185+
to automatically discover all packages and subpackages. In this case, the
186+
list of packages will be ``example_pkg`` as that's the only package present.
187+
- ``python_requires`` gives the versions of Python supported by your
188+
project. Installers like pip will look back though older versions of
189+
packages until it finds one that has a matching Python version.
190+
184191
There are many more than the ones mentioned here. See
185192
:doc:`/guides/distributing-packages-using-setuptools` for more details.
186193

@@ -227,12 +234,12 @@ an escape hatch when absolutely necessary.
227234
long_description=long_description,
228235
long_description_content_type="text/markdown",
229236
url="https://github.com/pypa/sampleproject",
230-
packages=setuptools.find_packages(),
231237
classifiers=[
232238
"Programming Language :: Python :: 3",
233239
"License :: OSI Approved :: MIT License",
234240
"Operating System :: OS Independent",
235241
],
242+
packages=setuptools.find_packages(),
236243
python_requires='>=3.6',
237244
)
238245
@@ -259,18 +266,21 @@ an escape hatch when absolutely necessary.
259266
- ``url`` is the URL for the homepage of the project. For many projects, this
260267
will just be a link to GitHub, GitLab, Bitbucket, or similar code hosting
261268
service.
262-
- ``packages`` is a list of all Python :term:`import packages <Import
263-
Package>` that should be included in the :term:`Distribution Package`.
264-
Instead of listing each package manually, we can use :func:`find_packages`
265-
to automatically discover all packages and subpackages. In this case, the
266-
list of packages will be ``example_pkg`` as that's the only package present.
267269
- ``classifiers`` gives the index and :ref:`pip` some additional metadata
268270
about your package. In this case, the package is only compatible with Python
269271
3, is licensed under the MIT license, and is OS-independent. You should
270272
always include at least which version(s) of Python your package works on,
271273
which license your package is available under, and which operating systems
272274
your package will work on. For a complete list of classifiers, see
273275
https://pypi.org/classifiers/.
276+
- ``packages`` is a list of all Python :term:`import packages <Import
277+
Package>` that should be included in the :term:`Distribution Package`.
278+
Instead of listing each package manually, we can use :func:`find_packages`
279+
to automatically discover all packages and subpackages. In this case, the
280+
list of packages will be ``example_pkg`` as that's the only package present.
281+
- ``python_requires`` gives the versions of Python supported by your
282+
project. Installers like pip will look back though older versions of
283+
packages until it finds one that has a matching Python version.
274284

275285
There are many more than the ones mentioned here. See
276286
:doc:`/guides/distributing-packages-using-setuptools` for more details.

0 commit comments

Comments
 (0)