fix: exclude setuptools.tests from wheel distribution#5214
fix: exclude setuptools.tests from wheel distribution#5214
Conversation
The exclude patterns '*.tests' and '*.tests.*' match packages named like 'foo.tests' but do not match 'setuptools/tests' because that directory is a subpackage of setuptools, not a top-level package matching the glob. Add explicit 'setuptools.tests' and 'setuptools.tests.*' to the exclude list so test files are not included in the wheel. Fixes pypa#5212 Signed-off-by: bahtya <bahtyar153@qq.com>
|
Hi @Bahtya, thank you very much for the contribution. I believe that this change is not working as expected: the original glob pattern itself should be working fine, but there is a different problem that influences the behaviour (a complicated one, nevertheless, because half of the community wants it to behave in a way while the other half wants it to behave in a different way: #3260, #3340) But, just for the sake of sanity checking, could you please add some tests that assert that the proposed changes work to achieve the expected results? |
|
Thanks for the feedback! I see the linked issues about the glob exclude pattern complexities. Looking at this more carefully: if I'll investigate the actual wheel contents to understand what's happening. Could you point me to where in the build pipeline the exclude patterns are applied? Is the issue perhaps that |
Problem
Starting from some release between v69.0.2 and v81.0.0, setuptools includes its own test suite in the wheel distribution. This violates the packaging guide:
Root Cause
The
excludepatterns inpyproject.toml:These glob patterns match packages named like
foo.testsbut do not matchsetuptools/tests/because that is a subpackage ofsetuptools, not a top-level package matching the*.testspattern.Solution
Add explicit entries for the actual test package:
Fixes #5212