Skip to content

Derive package version from the git tag (setuptools_scm) - #64

Merged
duburcqa merged 1 commit into
Genesis-Embodied-AI:mainfrom
duburcqa:auto-version
Jul 22, 2026
Merged

Derive package version from the git tag (setuptools_scm)#64
duburcqa merged 1 commit into
Genesis-Embodied-AI:mainfrom
duburcqa:auto-version

Conversation

@duburcqa

Copy link
Copy Markdown
Contributor

Problem

The version was hardcoded in pyproject.toml (version = "0.0.8"), so cutting a release tag didn't change it. Tagging v0.0.9 while pyproject still said 0.0.8 built gs_madrona-0.0.8 wheels, which the PyPI upload then skipped as already-existing — so nothing shipped as 0.0.9 (0.0.9 is currently empty on PyPI).

Fix

Derive the version from the git tag via setuptools_scm, using the same scikit-build-core out-of-tree metadata provider as nyx (the built-in scikit_build_core.metadata.setuptools_scm provider is incompatible with setuptools_scm >= 9). A release is then cut purely by tagging vX.Y.Z — there is no version string to bump by hand.

  • pyproject: dynamic = ["version"]; setuptools_scm>=8 build requirement; metadata.version.provider = "scm_version"cmake/scm_version.py; experimental = true.
  • python-wheels.yml: fetch-depth: 0 for tag history, and forward the runner-resolved version into cibuildwheel's manylinux containers via SETUPTOOLS_SCM_PRETEND_VERSION (setuptools_scm can't read git inside the build container, and would otherwise fall back to 0.0.0+unknown).

Validation

Building the sdist through scikit-build-core resolves the version from the tag end-to-end:

*** scikit-build-core 1.0.3 (sdist)
Successfully built gs_madrona-0.0.10.dev0+gc7d64d382.d20260722.tar.gz

The .dev0/date suffix is only the dirty worktree during testing; a clean tagged commit yields the exact tag (e.g. 0.0.9).

Once this lands, the v0.0.9 tag/release will be recreated on top of it so the release builds and publishes 0.0.9 correctly.

The version was hardcoded in pyproject.toml, so cutting a release tag did not
change it: tagging v0.0.9 while pyproject still said 0.0.8 produced 0.0.8
wheels, which the PyPI upload then skipped as already-existing, so nothing
shipped as 0.0.9.

Make the version dynamic, sourced from the git tag via setuptools_scm, using
the same scikit-build-core out-of-tree metadata provider as Genesis-Embodied-AI/nyx
(the built-in provider is incompatible with setuptools_scm >=9). A release is
now cut purely by tagging vX.Y.Z.

- pyproject: dynamic = ["version"]; setuptools_scm build requirement;
  metadata.version.provider = "scm_version" (cmake/scm_version.py).
- python-wheels.yml: fetch full tag history (fetch-depth: 0) so setuptools_scm
  can derive the version; cibuildwheel copies .git into the build container.
@duburcqa
duburcqa merged commit ae0585b into Genesis-Embodied-AI:main Jul 22, 2026
2 checks 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