Honor MANIFEST.in exclusions in strict editable installs - #5290
Open
goutamadwant wants to merge 2 commits into
Open
goutamadwant wants to merge 2 commits into
goutamadwant wants to merge 2 commits into
Conversation
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Author
|
@Mergifyio queue |
Contributor
☑️ Command disallowed due to command restrictions in the Mergify configuration.Details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Strict editable installs currently build their link tree from every discovered Python module, including modules excluded by
MANIFEST.in. This can make an excluded module importable from a strict editable install even though it is absent from the source distribution and the wheel built from it.This change filters Python module mappings through the generated egg-info manifest only when strict editable mode is selected. Manifest and module paths are normalized before comparison so the filtering also handles platform-specific path separators. Other editable modes and regular wheel builds keep their existing behavior.
The regression test excludes a package module in
MANIFEST.in, performs a strict editable install, and verifies that the module cannot be discovered. A bugfix news fragment is included.Closes #5089
Testing
pytest setuptools/tests/test_editable_install.py::TestLinkTree setuptools/tests/test_build_py.py -p no:covpytest setuptools/tests/test_editable_install.py -p no:covruff format --check setuptools/command/build_py.py setuptools/command/editable_wheel.py setuptools/tests/test_editable_install.pyruff check setuptools/command/build_py.py setuptools/command/editable_wheel.py setuptools/tests/test_editable_install.pyPull Request Checklist
newsfragments/.