This MR contains the following updates:
#3233: Included missing test file
#3233: Added script that allows developers to download
setupcfg_examples.txtprior to running tests. By caching these files it should be possible to run the test suite offline.
#3229: Disabled automatic download of
trove-classifiersto facilitate reproducibility.
#3229: New internal tool made available for updating the code responsible for
the validation of
pyproject.toml. This tool can be executed via
tox -e generate-validation-code.
#3215: Ignored a subgroup of invalid
pyproject.tomlfiles that use the
[project]table to specify only
.. warning:: Please note that future releases of setuptools will halt the build process if a
pyproject.tomlfile that does not match doc:
the PyPA Specification <PyPUG:specifications/declaring-project-metadata>is given.
pyproject.tomlvalidation, as generated by
#3218: Prevented builds from erroring if the project specifies metadata via
pyproject.toml, but uses other files (e.g.
setup.py) to complement it, without setting
.. important:: This is a transitional behaviour. Future releases of
setuptoolsmay simply ignore externally set metadata not backed by
dynamicor even halt the build with an error.
#3224: Merge changes from pypa/distutils@
Documentation changes ^^^^^^^^^^^^^^^^^^^^^
#3217: Fixed typo in
pyproject.tomlexample in Quickstart -- by :user:
#3223: Fixed missing requirements with environment markers when
optional-dependenciesis set in
#3212: Fixed missing dependencies when running
setup.py install. Note that calling
setup.py installdirectly is still deprecated and will be removed in future versions of
setuptools. Please check the release notes for :ref:
setuptools.convert_pathto an internal function that is not exposed as part of setuptools API. Future releases of
setuptoolsare likely to remove this function.
#3202: Changed behaviour of auto-discovery to not explicitly expand
package_dirfor flat-layouts and to not use relative paths starting with
pyproject.tomlparsing from overwriting
dist.include_package_dataexplicitly set in
setup.pywith default value.
#3208: Added a warning for non existing files listed with the
#3208: Added a default value for dynamic
pyproject.tomlwhen files are missing and errors being ignored.
#3211: Disabled auto-discovery when distribution class has a
configurationattribute (e.g. when the
setup(..., configuration=...)). This is done to ensure extension-only packages created with
numpy.distutils.misc_util.Configurationare not broken by the safe guard behaviour to avoid accidental multiple top-level packages in a flat-layout.
.. note:: Users that don't set
configurationare still likely to observe the auto-discovery behavior, which may halt the build if the project contains multiple directories and/or multiple Python files directly under the project root.
To disable auto-discovery please explicitly set either
py_modules. Alternatively you can also configure :ref:
setuptools.config.parse_configurationand other functions or classes from
Users that still need to parse and process configuration from
setup.cfgcan import a direct replacement from
setuptools.config.setupcfg, however this module is transitional and might be removed in the future (the
setup.cfgconfiguration format itself is likely to be deprecated in the future).
Breaking Changes ^^^^^^^^^^^^^^^^
#2894: If you purposefully want to create an "empty distribution", please be aware that some Python files (or general folders) might be automatically detected and included.
Projects that currently don't specify both
py_modulesin their configuration and contain extra folders or Python files (not meant for distribution), might see these files being included in the wheel archive or even experience the build to fail.
You can check details about the automatic discovery (and how to configure a different behaviour) in :doc:
#3067: If the file
pyproject.tomlexists and it includes project metadata/config (via
[tool.setuptools]), a series of new behaviors that are not backward compatible may take place:
- The default value of
include_package_datawill be considered to be
- Setuptools will attempt to validate the
pyproject.tomlfile according to PEP 621 specification.
- The values specified in
pyproject.tomlwill take precedence over those specified in
- The default value of
#2887: [EXPERIMENTAL] Added automatic discovery for
packages-- by :user:
Setuptools will try to find these values assuming that the package uses either the src-layout (a
srcdirectory containing all the packages or modules), the flat-layout (package directories directly under the project root), or the single-module approach (an isolated Python file, directly under the project root).
The automatic discovery will also respect layouts that are explicitly configured using the
For backward-compatibility, this behavior will be observed only if both
packagesare not set. (Note: specifying
ext_modulesmight also prevent auto-discover from taking place)
If setuptools detects modules or packages that are not supposed to be in the distribution, please manually set
setup.pyfile. If you are using a flat-layout, you can also consider switching to src-layout.
#2887: [EXPERIMENTAL] Added automatic configuration for the
namemetadata -- by :user:
Setuptools will adopt the name of the top-level package (or module in the case of single-module distributions), only when
nameis not explicitly provided.
Please note that it is not possible to automatically derive a single name when the distribution consists of multiple top-level packages or modules.
#3066: Added vendored dependencies for :pypi:
These dependencies are used to read
pyproject.tomlfiles and validate them.
#3067: [EXPERIMENTAL] When using
pyproject.tomlmetadata, the default value of
include_package_datais changed to
#3068: [EXPERIMENTAL] Add support for
pyproject.tomlconfiguration (as introduced by :pep:
621). Configuration parameters not covered by standards are handled in the
In the future, existing
setup.cfgconfiguration may be automatically converted into the
pyproject.tomlequivalent before taking effect (as proposed in #1688). Meanwhile users can use automated tools like :pypi:
ini2tomlto help in the transition.
Please note that the legacy backend is not guaranteed to work with
-- by :user:
#3125: Implicit namespaces (as introduced in :pep:
420) are now considered by default during :doc:
package discovery </userguide/package_discovery>, when
setuptoolsconfiguration and project metadata are added to the
To disable this behaviour, use
namespaces = Falsewhen explicitly setting the
This change is backwards compatible and does not affect the behaviour of configuration done in
#3152: [EXPERIMENTAL] Added support for
package_diris implicitly found via auto-discovery.
#3178: Postponed importing
ctypeswhen hiding files on Windows. This helps to prevent errors in systems that might not have
#3179: Merge with pypa/distutils@
Documentation changes ^^^^^^^^^^^^^^^^^^^^^
#3172: Added initial documentation about configuring
pyproject.toml(using standard project metadata).
setuptools.configby separating configuration parsing (specific to the configuration file format, e.g.
setup.cfg) and post-processing (which includes directives such as
file:that can be used across different configuration formats).
If you want to rebase/retry this MR, click this checkbox.
This MR has been generated by Renovate Bot.