Skip to content

[BUG] PEP 631 TOMLs can conflict with deprecated configuration files #3300

@nullableVoidPtr

Description

@nullableVoidPtr

setuptools version

setuptools==62.1.0

Python version

Python 3.10.4

OS

Arch Linux

Additional environment information

No response

Description

A package with PEP 621/631 compliant pyproject.toml and the build_meta backend may have its metadata and other configuration information overlaid with other information from setup.py or setup.cfg (which may be retained for fallback with --no-use-pep517 while setuptools transitions to a stable PEP 517 implementation by default).

One cause is this helper function which guarantees that the "fallback" setup.py would be called even if pyproject.toml is fully defined.

Expected behavior

I expected setuptools to identify that pyproject.toml has the project and dependencies table, and would further ignore other configuration files (though I may be disregarding the value/use of dynamic fields with this expectation).

How to Reproduce

  1. pip install setuptools wheel build
  2. git clone https://gist.github.com/nullableVoidPtr/d3f528136eff5c0e827ee98fd75da9dd
  3. python -m build
  4. cat project.egg-info/requires.txt

Output

click
wheel
click

There is a duplication of the dependency click and the inclusion of wheel which was only included in setup.cfg.
(Side note: the discrepancy in dependencies between pyproject.toml and setup.py is highly unlikely in actual packages, but is used to illustrate the issue here).
There was no warnings relating to the conflict observed in the output of python -m build.

Note that this also works with setup.cfg (replacing setup.py) with the following:

[options]
install_requires =
    click
    wheel

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions