Skip to main content

Module packaging

Module packaging 

Source
Expand description

Packaging rule — foundation (issue #70).

README “Packaging”: test files never ship in the built artifact. Colocated unit tests live next to the source, so packaging has to strip them — and this rule confirms it did, by inspecting the built artifact rather than the working tree.

This module is the deterministic core: given the root of an unpacked built artifact and the test-file globs that must not appear in it, scan walks the tree and returns every offending file. Producing the artifact (building a wheel/sdist, npm pack, cargo package, then unpacking it) is a per-language layer on top — kept separate, and out of this foundation slice, so the core guarantee is testable without any language toolchain. The per-language slices supply the build step and the glob set: Python *_test.py (#72), TypeScript *.test.* (#73), Rust tests/ (#74).

Functions§

inspect
Inspect a built artifact at path for files matching globs — the test-file patterns that must not ship.
scan
Walk root — the root of an unpacked built artifact — and return every file whose name matches one of globs, sorted for deterministic output.