Skip to content

Honor MANIFEST.in exclusions in strict editable installs - #5290

Open
goutamadwant wants to merge 2 commits into
pypa:mainfrom
goutamadwant:fix-strict-editable-manifest
Open

goutamadwant wants to merge 2 commits into
pypa:mainfrom
goutamadwant:fix-strict-editable-manifest

Conversation

@goutamadwant

Copy link
Copy Markdown

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:cov
  • pytest setuptools/tests/test_editable_install.py -p no:cov
  • ruff format --check setuptools/command/build_py.py setuptools/command/editable_wheel.py setuptools/tests/test_editable_install.py
  • ruff check setuptools/command/build_py.py setuptools/command/editable_wheel.py setuptools/tests/test_editable_install.py

Pull Request Checklist

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@goutamadwant

Copy link
Copy Markdown
Author

@Mergifyio queue

@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

queue

☑️ Command disallowed due to command restrictions in the Mergify configuration.

Details
  • sender-permission >= write

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.

Editable install (with -C editable_mode=strict) ignores MANIFEST.in

1 participant