[Enhancement Request] `_MissingDynamic` with pyproject.toml should be a failing error, not a warning
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
setuptools version
setuptools == 69.0.3
Python version
N/A
OS
N/A
Additional environment information
No response
Description
(I was gonna ask if this behaviour is intentional as a comment on #4066, but figured a dedicated issue would be better)
Since #4066 / v69.0.0, setuptools does not raise an error when an metadata field is not declared as dynamic in pyproject.toml and ignores that metadata field entirely. The current behaviour is printing a warning like:
/private/var/folders/s0/qbw337m17yj9tq4xm822qwn40000gq/T/build-env-2mvjqejz/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:75: _MissingDynamic:
dependenciesdefined outside ofpyproject.tomlis ignored.
Full logs and source tree: https://gist.github.com/pradyunsg/e502bb5ca096e18308600f0009d86bb0
Expected behavior
Instead of printing this as a warning and silently ignoring information provided via the setup call, setuptools should error out on these cases since the transitory period has concluded.
How to Reproduce
- Create a directory containing...
❯ cat pyproject.toml
[project]
name = "example"
version = "1.0.0"
❯ cat setup.py
from setuptools import setup
setup(
install_requires=["httpx"],
)
- Run
python -m buildon it (orpython setup.py sdist, if you want a setuptools-only reproducer).
Output
https://gist.github.com/pradyunsg/e502bb5ca096e18308600f0009d86bb0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pyproject.toml and setup.py reproducer described in the issue, then trace how setuptools handles metadata fields that are not declared dynamic. Confirm the expected behavior by running python -m build or python setup.py sdist; done means the case raises an error instead of emitting _MissingDynamic and ignoring the metadata.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100