Fix: Exclude test package from Python wheels - #338
Open
espressolee wants to merge 1 commit into
Open
Conversation
find_packages() used to pick up the cli package. Since cli/ was removed and test/ became a package (both 2026-06-25), the only __init__.py in the tree is test/__init__.py, so the 5.x wheels ship a top-level `test` package with the 24 test modules. check-wheel-contents flags it (W005, W009), and on a Python without the stdlib test package `import test` resolves to it. Exclude test from find_packages(). MANIFEST.in gets `recursive-include test *.py` in place of the two explicit includes (one of which, test/stringzilla.py, no longer matches a file), which keeps the sdist file list identical. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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 freeto 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.
The inspected 5.x wheels install a top-level
testpackage into site-packages —stringzilla5.1.2 (macOS arm64, manylinux x86_64),stringzilla5.0.0,stringzillas-cpus5.1.2; 4.6.2 did not.packages=find_packages()used to pick upcli; aftercli/was removed andtest/became a package (both 2026-06-25), the only__init__.pyin the tree istest/__init__.py, so the same call now returns['test']and the inspected wheels carry all 24 test modules. In a clean venv on a Python that ships no stdlibtestpackage (python-build-standalone),import testresolves to StringZilla's copy; on the Homebrew Python I tried, the stdlib copy wins.stringzillas-cpus, which requiresstringzillaat the same version, carries the same 24 paths.This excludes
testfromfind_packages().MANIFEST.ingetsrecursive-include test *.pyin place of the two explicit includes (one of which,test/stringzilla.py, no longer matches a file), so the sdist is unaffected: skeleton-built sdists over the real tree shape have identical 337-file lists before and after, while thesetup.pychange alone would drop 23 test files from it.