Skip to content

Ship the library in the sdist, and stop shipping the tests - #93

Merged
QuiteYellow merged 1 commit into
mainfrom
fix/ship-tools-with-the-tests
Sep 13, 2026
Merged

QuiteYellow merged 1 commit into
mainfrom
fix/ship-tools-with-the-tests

Conversation

@QuiteYellow

@QuiteYellow QuiteYellow commented Sep 13, 2026

Copy link
Copy Markdown
Owner

tests/ has been in the sdist include list since the commit that introduced packaging, with no stated reason, and against the wheel comment in the same file: mqtt_demo/, tests/ and setup_cert.py are in-repo development material.

Nothing had ever run them from an sdist, because the packages they import stayed behind. From a bare extraction:

  • two files failed at collection, importing tools/;
  • five tests failed, reading docs/;
  • seven more failed at collection, importing mqtt_demo or setup_cert.

CI never noticed, because its sdist job installs the artefact and imports one module.

Why this does the opposite of shipping them

The first version of this branch shipped tools/ and docs/ so the tests would run. That let test placement decide what the package distributes, which is backwards. It also put documentation-hygiene checks in a packager's path: whether docs/api.md matches the code, and whether this repository's markdown links resolve, has no bearing on a build of the library.

So the sdist now carries the library and its metadata, which is what the file already said it intended. check_distribution.py enforces that set.

What this costs

Nothing identified. The wheel was already library-only. The repository suite still runs 798. CI's sdist job installs the artefact and imports from it exactly as before, verified against the new one. Anyone wanting to run the suite uses the git tag, as CI does.

The sdist halves, 213501 bytes to 107177.

Validation

798 tests pass on Python 3.11, 3.13 and 3.14, and on the dependency floor. check_distribution.py passes on both artefacts, and check_share_safety.py is clean.

tests/ was in the sdist include list from the commit that introduced
packaging, with no stated reason, and against the wheel comment in the same
file: mqtt_demo/, tests/ and setup_cert.py are in-repo development
material. Nothing had ever run them from an sdist, because the packages
they import stayed behind. Two files failed at collection on tools/, five
tests failed reading docs/, and seven more failed at collection on
mqtt_demo and setup_cert.

Shipping those directories to satisfy the tests was the wrong direction:
it let test placement decide what the package distributes, and the five
docs tests check documentation hygiene rather than anything a packager
cares about. The sdist now carries the library and its metadata, which is
what the file already said it intended, and check_distribution.py enforces
that set.

The sdist halves, 213501 bytes to 107177. Nothing else changes: the wheel
was already library-only, the repo suite still runs 798, CI's sdist job
installs the artefact and imports from it as before, and anyone wanting the
suite uses the git tag, as CI does.
@QuiteYellow
QuiteYellow force-pushed the fix/ship-tools-with-the-tests branch from 9cd2c02 to b8133ed Compare September 13, 2026 11:26
@QuiteYellow QuiteYellow changed the title Make the tests that ship in the sdist runnable from it Ship the library in the sdist, and stop shipping the tests Sep 13, 2026
@QuiteYellow
QuiteYellow merged commit 5396b9e into main Sep 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant