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

Unify Python project root detection logic #10082

Merged
merged 1 commit into from
Jun 19, 2021
Merged

Conversation

uranusjr
Copy link
Member

After #9547 and #10031, we have way too many setup.py checks in the code base and cause inconsistencies across different components. I did a global search for setup.py and tried to consolidate all of them into using is_installable_dir(), and fixed the error messages, docstrings, and comments to keep up with the logic.

Fix #10080 (a symptom to the issue).

The definition of a valid project root is now containing either a pyproject.toml (PEP 517; further file signifier like setup.py/setup.cfg are performed by the backend) or setup.py. A setup.cfg-only layout is only available if there is also a pyproject.toml (and we don’t check for that except in parse_editable; this is already implemented in #9547 and not included in this PR).

A Python project root is now defined as containing a pyproject.toml, or
a setup.py (pre-PEP-517 legacy layout). After this patch, this logic
applies to all checks except parse_editable, where we check for setup.py
and setup.cfg instead since non-setuptools PEP 517 projects cannot be
installed as editable right now.
@uranusjr uranusjr closed this Jun 19, 2021
@uranusjr uranusjr reopened this Jun 19, 2021
@uranusjr uranusjr added this to the 21.2 milestone Jun 19, 2021
@uranusjr uranusjr merged commit 4704da4 into pypa:main Jun 19, 2021
@uranusjr uranusjr deleted the setup-py-freeze branch June 19, 2021 21:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip freeze: WARNING: Could not find setup.py for directory
3 participants