Skip to content

[Enhancement Request] _MissingDynamic with pyproject.toml should be a failing error, not a warning #4183

Open
@pradyunsg

Description

@pradyunsg

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: dependencies defined outside of pyproject.toml is 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

  1. 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"],
)
  1. Run python -m build on it (or python setup.py sdist, if you want a setuptools-only reproducer).

Output

https://gist.github.com/pradyunsg/e502bb5ca096e18308600f0009d86bb0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DiscussionIssues where the implementation still needs to be discussed.proposal

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions