Repository navigation
Tests gate: check a dynamic version through __version__; add darkroom_state.py - #36
Merged
Merged
Conversation
…_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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two additions, both needed before graphik and darkroom can be gated. Intended as
v7.Tests gate: dynamic versions. A
pyproject.tomlwhose[project]listsversionunderdynamic(graphik reads it frompreponderous/graphik/_version.py) declares no version, soversionfailed for every candidate (pyproject.toml declares (none)). Now, when the version is dynamic,versionrequirespackageto be set, and eachimport-<py>check holds the installed package's__version__toexpected_version; a package without__version__fails there instead of passing. Static versions are checked exactly as before.version_is_dynamichas unit tests besidedeclared_version's.scenarios/darkroom_state.py. darkroom keeps per-project state beside each shot list (.darkroom/state.jsonand 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 thecommandbackend and a standard-library stand-in capture program (a still with vars, a clip with GIF, poster and contact sheet, a still under the tagsbeforeandafter, a prep and the still that depends on it, and a shot recorded byshoot --adopt). A version's view is what its ownshootdoes to each project: every shotkept(state entry, take and listed outputs byte-identical) orrewritten, 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.appendshoots a third project.Checks
python -m py_compile gates/*.py scenarios/*.py;python -m unittest discover -s tests: 117 tests OK.2db8884(package=preponderous.graphik,install_extras=test,expected_version=0.5.3, Python 3.10 and 3.12): PASSED,versionreads "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 withexpected_version=0.5.4FAILS atimport-3.12("preponderous.graphik 0.5.3 …; expected 0.5.4").a3dc9e0withbaseline_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 iskept.capture_hashpatched to hash one extra key; itsreadreports every untagged shot and the prep asrewritten(withcapture_hash_matches: false), so read-1 would fail.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code