Exclude top-level .tox|.nox|.venv
from sdist
#4603
Merged
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
This is a follow up on #4602: instead of doing an ad-hoc exclusion rule for setuptools' own
MANIFEST.in
, this PR proposes to always "prune" the.tox
,.nox
and.venv
top-level directories.This is done by extending the
sdist.prune_file_list
method from distutils using the same technique that the original method already uses to exclude directories like.git
or.svn
.I am only excluding top-level
.tox|.nox|.venv
directories to be conservative and minimise Hyrum's law unexpected consequences.This PR also removes the custom implementation on
setuptools.command.egg_info:manifest_maker.prune_file_list
and instead let the class just access the parent's class implementation via inheritance:SETUPTOOLS_USE_DISTUTILS=stdlib
should not affect this particular aspect.Finally, it is important to notice that once the implementation of
sdist
prunes these directories, the user cannot add them back viaMANIFEST.in
. But I think that is OK.I did a quick search on Github, and it seems that most of the users are trying to exclude the directories (on a quick/not-thorough inspection I did not see anyone intentionally including them).
Closes #4601
Pull Request Checklist
newsfragments/
.(See documentation for details)