Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

UI Expand
expandedtrue
titleOptionssetup.cfg - options description
  • name

 
  • is the distribution name of

your
  • project package. This can be any name as long as it only contains letters, numbers, _

 , and -. It also must not already be taken on pypi.org. Be sure to update this with your username, as this ensures you won’t try to upload a package with the same name as one which already exists.version is the package version. See PEP 440 for more details on versions. You can use file: or attr: directives to read from a file or package attribute
  •  , and -.

  • version is the package version.

  • author and author_email are used to identify the author of the package.

  • description is a short, one-sentence summary of the package.

  • long_description is a detailed description of the package.

This is shown on the package detail page on the Python Package Index.
  • In this case, the long description is loaded from README.md (which is a common pattern) using the file: directive.

  • long_description_content_type tells

the index
  • what type of markup is used for the long description. In this case, it’s Markdown.

  • 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
  • for the repository homepage of the project.

  • project_urls lets

you
  • list any number of extra links related to

show on PyPI
  • project. Generally this could be to documentation, issue trackers, etc.

  • classifiers gives the

index and 
  • 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/.
  • with Python 3, is licensed under the MIT license, and is OS-independent.

In the options category, we have there are controls for setuptools itself:

  • package_dir is a mapping of package names and directories. An empty package name represents the “root package” — the directory in the project that contains all Python source files for the package — so in this case the

 src 
  • project_name directory is designated the root package.

  • packages

 is
  •  is a list of all

Python 
  • Python import packages

 that
  •  that should be included in

the 
  • the distribution package. Instead of listing each package manually,

we can use the 
  • the find:

 directive
  •  directive can be used to automatically discover all packages and subpackages

and 
  • and options.packages.find

 to
  •  to specify

the 
  • the package_dir

 
  • to use. In

this case
  • the present example, the package list

of packages
  • will be

 example_package as that’s the only package present
  • empty because there are no subpackages in the package.

  • python_requires gives the versions of Python supported by

your
  • project. Installers like pip will look back through older versions of packages until it finds one that has a matching Python version.