chore: single-source the package version; pin CITATION.cff to it in tests#11
Merged
Conversation
__version__ now comes from importlib.metadata.version("chained-eclipse") with
a "0+unknown" fallback for uninstalled source trees. MODEL_VERSION remains a
deliberately separate model version, bumped when outputs change for fixed
inputs. tests/test_versions.py pins CITATION.cff to the package version.
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.
Summary
pyproject.toml(0.1.0),CITATION.cff(0.1.0), andconstants.MODEL_VERSION("0.1.0") were three independent hand-maintained versions. This encodes the decision from the work plan:__version__is now derived inchained_eclipse/__init__.pyfromimportlib.metadata.version("chained-eclipse"), with aPackageNotFoundErrorfallback of"0+unknown"for uninstalled source trees.pyproject.tomlbecomes the only hand-written package version.MODEL_VERSIONstays separate on purpose — it is a model version, bumped when outputs change for fixed inputs (CHANGELOG policy), and is allowed to diverge from the package version. The__init__docstring now documents that distinction.tests/test_versions.pyasserts__version__matches the installed distribution and thatCITATION.cff'sversion:(parsed with the already-declaredpyyaml) matches it too — so forgetting to bump the citation file on a release becomes a test failure.MODEL_VERSIONis checked for shape only, never equality, per the above.Work plan item P2 / 8.
Scientific impact
None. Version plumbing and tests only; no numeric code touched.
MODEL_VERSIONitself is unchanged.Checklist
ruff check .passespytestpasses locallyLint/test boxes left unchecked because this branch was pushed without a local run — CI on this PR is the first execution.