fix: keep the tests package out of the installed distribution - #7
Open
blaipr wants to merge 1 commit into
Open
Conversation
find_packages was told to exclude `test` and `test.*`, the layout the client had while it lived in the Ascender repository. The tests are in `tests` here, so the exclusion matched nothing and every test package was collected into the distribution. The published 25.5.1 wheel shows it: 27 entries under `tests/`, and a `top_level.txt` of `ascenderkit` and `tests`. Installing the client therefore creates `site-packages/tests/`, which shadows any other top-level `tests` package on the path and collides with any other distribution that ships one. The source distribution takes its contents from MANIFEST.in, which includes the tests explicitly, so they stay where they are useful.
8 tasks
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
find_packagesis told to excludetestandtest.*, the layout the client had while it lived in the Ascender repository. The tests are intestshere, so the exclusion matches nothing and every test package is collected into the distribution.The published 25.5.1 wheel shows it:
So
pip install ascender-kitcreatessite-packages/tests/, which shadows any other top-leveltestspackage on the path and collides file-for-file with any other distribution that ships one.After the change, rebuilding from the same tree:
tests/top_level.txtascenderkit,testsascenderkitThe source distribution takes its contents from
MANIFEST.in, which includesrecursive-include tests *.py *.yml *.mdexplicitly, so the tests stay where they are useful and only the installed package changes.Nothing in CI would catch a recurrence today. The build job installs the wheel and runs
ascender --help, which passes either way. Happy to add a step asserting the wheel contains nothing outsideascenderkit/and*.dist-info/if you want the guard.Type of Change
Component
Packaging (
setup.py).Checklist
pytest tests/unit): 351 passedblack --check ascenderkit tests setup.py,flake8 ascenderkit)Unreleased