fix(release): pin build version via SETUPTOOLS_SCM_PRETEND_VERSION#6
fix(release): pin build version via SETUPTOOLS_SCM_PRETEND_VERSION#6
Conversation
hatch-vcs detects dirty working tree (submodule state) and appends local version identifier, producing 0.4.1.dev0+g<hash>.d<date> instead of the clean tag version. Force the correct version from the tag name.
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughUpdated the GitHub Actions release workflow to set the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
Pull request overview
Updates the release workflow to ensure reproducible, PyPI-acceptable package versions when building from git tags in a potentially “dirty” checkout (e.g., due to submodule state), aligning hatch-vcs/setuptools_scm output with the tag version.
Changes:
- Pins the build-time version by setting
SETUPTOOLS_SCM_PRETEND_VERSIONfrom the pushed tag name (with the leadingvstripped). - Ensures wheels/sdists are built with the exact tag version even if the working tree is detected as dirty.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



Summary
0.4.1.dev0+gca4e2abe0.d20260409instead of0.4.0+...suffix)Fix
Set
SETUPTOOLS_SCM_PRETEND_VERSIONenv var in the build step, strippingvprefix from tag name (v0.4.0→0.4.0). This forces hatch-vcs to use the exact tag version regardless of working tree state.After merge
Will need to re-tag
v0.4.0on the new merge commit to trigger Release workflow with the fixed workflow file.