Skip to content

chore: single-source the package version; pin CITATION.cff to it in tests#11

Merged
wiyth00 merged 1 commit into
mainfrom
chore/single-source-version
Jul 25, 2026
Merged

chore: single-source the package version; pin CITATION.cff to it in tests#11
wiyth00 merged 1 commit into
mainfrom
chore/single-source-version

Conversation

@wiyth00

@wiyth00 wiyth00 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

pyproject.toml (0.1.0), CITATION.cff (0.1.0), and constants.MODEL_VERSION ("0.1.0") were three independent hand-maintained versions. This encodes the decision from the work plan:

  • __version__ is now derived in chained_eclipse/__init__.py from importlib.metadata.version("chained-eclipse"), with a PackageNotFoundError fallback of "0+unknown" for uninstalled source trees. pyproject.toml becomes the only hand-written package version.
  • MODEL_VERSION stays 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.py asserts __version__ matches the installed distribution and that CITATION.cff's version: (parsed with the already-declared pyyaml) matches it too — so forgetting to bump the citation file on a release becomes a test failure. MODEL_VERSION is 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_VERSION itself is unchanged.

  • No change to computed results
  • Results change (described above)

Checklist

  • ruff check . passes
  • pytest passes locally
  • New or changed behaviour is covered by a test
  • Docs / README updated if user-facing behaviour changed

Lint/test boxes left unchecked because this branch was pushed without a local run — CI on this PR is the first execution.

__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.
@wiyth00
wiyth00 merged commit 428f903 into main Jul 25, 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