From 78ac75f5bead9aae45f86573464e61c757dd141e Mon Sep 17 00:00:00 2001 From: Titus Date: Thu, 19 Nov 2026 02:55:53 +0100 Subject: [PATCH] CI runs the suite against the built wheel The gates job tests the source tree, installed editable, while PyPI gets the wheel: a file the build leaves out passes there and fails for every user. A wheel job builds it on Python 3.12, checks it holds every tracked file of the package and nothing else, installs it into the locked dev environment in place of the project, asserts the import comes from site-packages, and runs the whole suite. Watched failing: a wheel built without the vendored folder checker fails the contents check (three files named) and the suite (FileNotFoundError), where the source run passes. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ CHANGELOG.md | 2 ++ 2 files changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d1e2d9..049a19e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,6 +93,38 @@ jobs: uv run pytest -q -rs tests/test_reader.py | tee "$RUNNER_TEMP/reader.txt" grep -q -E '^[0-9]+ passed in ' "$RUNNER_TEMP/reader.txt" + wheel: + # The gates job runs the suite on the source tree, installed editable; PyPI gets the wheel. A file the + # build leaves out (hatchling skips what .gitignore names, and anything outside the package path) passes + # there and fails for every user, on a version PyPI keeps forever. Here the suite runs against the wheel + # itself: the locked dev environment without the project, and the built wheel installed in its place. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v7 + with: + python-version: '3.12' + - run: uv build --wheel + - name: The wheel holds every tracked file of the package, and nothing else + run: | + python3 - <<'PY' + import glob, subprocess, sys, zipfile + (wheel,) = glob.glob("dist/*.whl") + inside = {n for n in zipfile.ZipFile(wheel).namelist() if n.startswith("onlyworlds/")} + listed = subprocess.run(["git", "ls-files", "-z", "src/onlyworlds"], capture_output=True, text=True, check=True).stdout + tracked = {p[len("src/"):] for p in listed.split("\0") if p} + missing, extra = sorted(tracked - inside), sorted(inside - tracked) + if not tracked or missing or extra: + print(f"tracked {len(tracked)}, in the wheel {len(inside)}; left out: {missing}; not tracked: {extra}") + sys.exit(1) + print(f"the wheel holds the package's {len(tracked)} tracked files, and nothing else") + PY + - run: uv sync --locked --no-install-project + - run: uv pip install --no-deps dist/*.whl + - name: The suite imports the installed wheel, not the source tree + run: uv run --no-sync python -I -c "import onlyworlds; f = onlyworlds.__file__; assert '/site-packages/' in f, f; print(f)" + - run: uv run --no-sync pytest -q + wire: # keel's own OpenAPI document and the public demo world, read only, and a few writes to the # practice world (its published key, reset every night), each deleted again. Red here with diff --git a/CHANGELOG.md b/CHANGELOG.md index 42e9ab7..0ffddd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ The package version runs on its own semver; the schema it is generated from is ` ## Unreleased +- Tests: CI runs the whole suite against the built wheel, installed in place of the source tree (on Python 3.12), and checks that the wheel holds every tracked file of the package and nothing else. A wheel built without the vendored folder checker failed both, where the source run passes. + ## 0.134.1 (2026-11-17) - **The schema pin moves to `v0.34.1-dist.134`** (canonical 00.34.01 unchanged; no schema file moved, `_schema.py` changes only its provenance lines). The strand page now says that an empty string in any member of the mark is no mark, the story's included, and that no reader trims: a member of white space alone (a space, a tab, U+3000) or an id with a space on it names no element, so its slot is empty. `strand_of` already read every one of these that way; the fixture holds them as 42 cases (from 29). The checks page says what its specimen is, and its fixture's notes and its control row's field (`x_team_keeper`) change, its rules byte for byte as they were; the doctor's test replays them unchanged. The lens page says the reader is the one who asks, also beside another Character's context read.