You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using pyproject.toml for configuration alongside setup.cfg, setuptools will use the value for classifiers from setup.cfg if it is not given in pyprojet.tomleven ifclassifiers is not listed in dynamic. This is not allowed under PEP 621[1]
If the metadata does not list a field in dynamic, then a build back-end CANNOT fill in the requisite metadata on behalf of the user (i.e. dynamic is the only way to allow a tool to fill in metadata and the user must opt into the filling in).
setuptools should only take the value from setup.cfg is classifiers is listed in dynamic.
There is a separate issue where if classifiersis in dynamic, setuptools throws an error:
File "/tmp/build-env-lbp441r9/lib/python3.8/site-packages/setuptools/dist.py", line 836, in parse_config_files
pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
File "/tmp/build-env-lbp441r9/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 52, in apply_configuration
config = read_configuration(filepath, True, ignore_option_errors, dist)
File "/tmp/build-env-lbp441r9/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 118, in read_configuration
return expand_configuration(asdict, root_dir, ignore_option_errors, dist)
File "/tmp/build-env-lbp441r9/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 163, in expand_configuration
_expand_all_dynamic(project_cfg, setuptools_cfg, package_dir, root_dir, ignore)
File "/tmp/build-env-lbp441r9/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 252, in _expand_all_dynamic
project_cfg["classifiers"] = value.splitlines()
AttributeError: 'NoneType' object has no attribute 'splitlines'
Hi @domdfcoding I have prepared a PR addressing this problem. However there seems to be a popular pattern in the community of people partially specifying the [project] table (without the proper dynamic).
To prevent existing packages from breaking I decided to issue an warning while still preserving the config values.
Once the transition phase is over, project metadata external to pyproject.toml that does not set dynamic properly, will be ignored.
If you need to be more strict, you can set PYTHONWARNINGS to error for the time being.
setuptools version
setuptools==61.0.0
Python version
Python 3.8
OS
Ubuntu
Additional environment information
No response
Description
When using
pyproject.toml
for configuration alongsidesetup.cfg
,setuptools
will use the value forclassifiers
fromsetup.cfg
if it is not given inpyprojet.toml
even ifclassifiers
is not listed indynamic
. This is not allowed under PEP 621[1][1] https://peps.python.org/pep-0621/#dynamic
Expected behavior
setuptools
should only take the value fromsetup.cfg
isclassifiers
is listed indynamic
.There is a separate issue where if
classifiers
is indynamic
,setuptools
throws an error:How to Reproduce
python3 -m pip wheel .
Development Status :: 5 - Production/Stable
classifier.Output
N/A
The text was updated successfully, but these errors were encountered: