Skip to content

Tests gate: check a dynamic version through __version__; add darkroom_state.py - #36

Merged
dmccoystephenson merged 1 commit into
mainfrom
gates/dynamic-version-and-darkroom
Nov 21, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
gates/dynamic-version-and-darkroom

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Two additions, both needed before graphik and darkroom can be gated. Intended as v7.

Tests gate: dynamic versions. A pyproject.toml whose [project] lists version under dynamic (graphik reads it from preponderous/graphik/_version.py) declares no version, so version failed for every candidate (pyproject.toml declares (none)). Now, when the version is dynamic, version requires package to be set, and each import-<py> check holds the installed package's __version__ to expected_version; a package without __version__ fails there instead of passing. Static versions are checked exactly as before. version_is_dynamic has unit tests beside declared_version's.

scenarios/darkroom_state.py. darkroom keeps per-project state beside each shot list (.darkroom/state.json and the takes under .darkroom/takes/), and its README promises that upgrading does not by itself make a shot stale. The baseline shoots two projects with the command backend and a standard-library stand-in capture program (a still with vars, a clip with GIF, poster and contact sheet, a still under the tags before and after, a prep and the still that depends on it, and a shot recorded by shoot --adopt). A version's view is what its own shoot does to each project: every shot kept (state entry, take and listed outputs byte-identical) or rewritten, whether the recorded hashes equal that version's own, and the outputs it expects. darkroom's capture hash includes the project's absolute path, so the shoot runs in place, and the project is restored byte for byte from a copy taken first. append shoots a third project.

Checks

  • python -m py_compile gates/*.py scenarios/*.py; python -m unittest discover -s tests: 117 tests OK.
  • Tests gate, local run against graphik 2db8884 (package=preponderous.graphik, install_extras=test, expected_version=0.5.3, Python 3.10 and 3.12): PASSED, version reads "pyproject.toml's version is dynamic; each import- check holds preponderous.graphik.version to 0.5.3", 700 passed / 3 skipped on each. The same run with expected_version=0.5.4 FAILS at import-3.12 ("preponderous.graphik 0.5.3 …; expected 0.5.4").
  • Save-compat gate, local run against darkroom a3dc9e0 with baseline_ref=v0.7.1, Python 3.12: PASSED (baseline-write 38 files; read-1/read-2 equal; files-kept-1/2/3; read-3 "10 save(s) listed: every baseline save unchanged + 1 added"); every shot in the view is kept.
  • Negative check: the candidate's capture_hash patched to hash one extra key; its read reports every untagged shot and the prep as rewritten (with capture_hash_matches: false), so read-1 would fail.

drafted by Claude on behalf of Daniel Stephenson

🤖 Generated with Claude Code

…_state.py

A pyproject.toml whose [project] lists version in `dynamic` (graphik reads it from
preponderous/graphik/_version.py) declares no version, so the `version` assertion failed for
every candidate. With a dynamic version, `version` now needs PACKAGE, and each import-<py>
check holds the installed package's __version__ to EXPECTED_VERSION (a missing __version__
fails there instead of passing). Static versions are checked as before.

scenarios/darkroom_state.py covers darkroom's per-project state (.darkroom/state.json and
takes): the baseline shoots two projects with the command backend and a stand-in capture
program, and each version's view is what its own `shoot` does to them, run in place and
restored byte for byte afterwards. darkroom promises that upgrading does not by itself make a
shot stale, so a shot the candidate reshoots or rewrites shows as `rewritten` and fails read-1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYNeumA4DYW41mYg7nCwNn
@dmccoystephenson
dmccoystephenson merged commit 1a4d7d3 into main Nov 21, 2026
1 check 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