Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pyproject.toml] Temporarily warn about improper backfilling without dynamic #3218

Merged
merged 8 commits into from
Mar 27, 2022

Conversation

abravalheri
Copy link
Contributor

Summary of changes

  • Added a warning if the project has a valid pyproject.toml with a [project] table, but at the same time it is trying to set other configs via other files (e.g. setup.py), without setting dynamic properly
  • In future releases (when support for pyproject.toml metadata stabilises), instead of warning, setuptools should fail.

Closes #3195

Pull Request Checklist

With emphasis on the ``dynamic`` behaviour
- PEP 621 requires the build backend to not backfill values without
  dynamic.

- Some users seem to been writing ``pyproject.toml`` with a "partial"
  ``[project]`` table even before setuptools added support for pyproject
  metadata. In several cases this table is incomplete and the real
  metadata lives either in ``setup.py`` or ``setup.cfg``.

To avoid ignoring metadata in these scenarios and resulting in failing
builds, the change implemented here adopts a more "forgiving" posture
and warns an informative message during the transition period.
Issues 3195 and 3204 surface the fact that setuptools may need to allow
dynamic values to be computed by the users in the ``setup.py`` file
(e.g. if they need to dynamically decide dependencies based on the host
machine in a way that is not supported by environment markers, such as
GPU presence).

The current implementation somehow already allows that by layering the
configs `setup.py` > `setup.cfg` > `pyproject.toml`. However this is
done without having in mind the limitations about `dynamic` imposed by
PEP 621.

The change implemented here tries to fix this problem.
@abravalheri abravalheri marked this pull request as ready for review March 27, 2022 13:22
@abravalheri abravalheri merged commit 461f9a6 into pypa:main Mar 27, 2022
@abravalheri abravalheri deleted the issue-3195 branch March 27, 2022 14:56
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.

[BUG] [pyproject.toml] Setuptools improperly backfills values in pyproject.toml
1 participant