Skip to content

fix: keep the tests package out of the installed distribution - #7

Open
blaipr wants to merge 1 commit into
ctrliq:mainfrom
blaipr:fix/exclude-tests-from-distribution
Open

fix: keep the tests package out of the installed distribution#7
blaipr wants to merge 1 commit into
ctrliq:mainfrom
blaipr:fix/exclude-tests-from-distribution

Conversation

@blaipr

@blaipr blaipr commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

find_packages is 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 matches nothing and every test package is collected into the distribution.

The published 25.5.1 wheel shows it:

$ python -m zipfile -l ascender_kit-25.5.1-py3-none-any.whl
  entries under tests/: 27
  top_level.txt: 'ascenderkit\ntests\n'

So pip install ascender-kit creates site-packages/tests/, which shadows any other top-level tests package on the path and collides file-for-file with any other distribution that ships one.

After the change, rebuilding from the same tree:

wheel entries under tests/ top_level.txt sdist test files
Before 27 ascenderkit, tests 32
After 0 ascenderkit 32

The source distribution takes its contents from MANIFEST.in, which includes recursive-include tests *.py *.yml *.md explicitly, 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 outside ascenderkit/ and *.dist-info/ if you want the guard.

Type of Change

  • Bug fix
  • New feature or enhancement
  • Breaking change
  • Documentation / tooling

Component

Packaging (setup.py).

Checklist

  • Tests pass (pytest tests/unit): 351 passed
  • Linting passes (black --check ascenderkit tests setup.py, flake8 ascenderkit)
  • Changelog entry added under Unreleased
  • Documentation updated (if applicable): none describes the package layout

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant