Add git-based dynamic versioning with setuptools-scm#165
Conversation
Replace the hardcoded version in pyproject.toml with setuptools-scm, which derives versions automatically from git tags. This also exposes `jax_galsim.__version__` at runtime and ensures CI fetches full git history so setuptools-scm can resolve the version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
beckermr
left a comment
There was a problem hiding this comment.
This version string
0.0.1rc1.dev0
confuses me since "rc" means release candidate and the patch version is for patches.
Maybe we should adopt
0.1.0.dev0
as the fallback?
What do you mean by this? |
|
See calver-by-date here: https://setuptools-scm.readthedocs.io/en/latest/extending/#available-implementations |
Merging this PR will degrade performance by 30.63%
Performance Changes
Comparing |
Co-authored-by: Matthew R. Becker <beckermr@users.noreply.github.com>
|
Ok excellent, happy to use CalVer then. Not sure if we should tag the branch first, for after merging the code to main. |
|
No need to tag anything before or after merging. The existing tag for the oja paper may need adjusting. We can handle that later. Once we switch the fallback version to 0.1.0.dev0, I think this is good to go. |
Co-authored-by: Matthew R. Becker <beckermr@users.noreply.github.com>
|
If we switch to calver we may want to change the default version. We can do that in a future PR. |
Summary
version = "0.0.1rc1"withsetuptools-scm, which derives versions automatically from git tagsjax_galsim.__version__at runtime via a generated_version.pyfetch-depth: 0) so setuptools-scm can resolve the version, and usesubmodules: recursivein the checkout step instead of a manualgit submodule updateHow it works
setuptools-scmreads git tags at build/install time:v0.0.1rc1→ version is0.0.1rc10.0.1rc1.devN+g<hash>0.0.1rc1.dev0(configured inpyproject.toml)Action needed after merge
To anchor the versioning, a maintainer should create an initial SemVer tag on the merge commit:
We recommend SemVer (
MAJOR.MINOR.PATCH) over CalVer for this project because:0.x.yconvention explicitly signals "pre-stable, API may change"Also, I don't think setuptools-scm works with CalVer