Skip to content

Warn when tool dynamic fields are not listed#5238

Open
StantonMatt wants to merge 1 commit into
pypa:mainfrom
StantonMatt:warn-unlisted-tool-dynamic
Open

Warn when tool dynamic fields are not listed#5238
StantonMatt wants to merge 1 commit into
pypa:mainfrom
StantonMatt:warn-unlisted-tool-dynamic

Conversation

@StantonMatt

Copy link
Copy Markdown

Closes #4523.

This adds a warning for pyproject configurations where a field is configured under tool.setuptools.dynamic but is not listed in project.dynamic, so the directive would otherwise be silently ignored.

I kept the existing entry-points behavior intact: tool.setuptools.dynamic.entry-points is still considered used when scripts or gui-scripts are dynamic, since those are expanded from the entry-points file.

Validation:

  • uv run --extra test --extra cover python -m pytest setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py setuptools/tests/config/test_apply_pyprojecttoml.py::TestPresetField setuptools/tests/config/test_pyprojecttoml.py -q
  • uv run --extra check ruff check setuptools/config/pyprojecttoml.py setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py setuptools/tests/config/test_pyprojecttoml.py
  • git diff --check
  • review-fix-loop clean after fixing the entry-points review finding

Signed-off-by: Matthew Stanton <stantonmatthewj@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Warn when metadata field is defined as dynamic, but not marked in project.dynamic

1 participant