-
Notifications
You must be signed in to change notification settings - Fork 0
Fix PyPI version suffixes when creating GitHub releases #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add explicit ref parameter to checkout step to ensure tags are checked out correctly. This prevents setuptools_scm from generating .postX.devY versions when creating releases via GitHub UI. Co-authored-by: sgbaird <45469701+sgbaird@users.noreply.github.com>
Co-authored-by: sgbaird <45469701+sgbaird@users.noreply.github.com>
|
@copilot Btw, it might have to do with me allowing things to continue, even if the linting checks don't pass. I.e., there are uncommitted files. I.e., the prepare step being allowed to continue on error |
You're absolutely right! The pre-commit step with My fix of adding This way, linting failures won't affect the version number, and we'll get clean releases like Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Pre-commit failures with continue-on-error leave uncommitted changes, causing setuptools_scm to detect a dirty repo and add .postN.devM suffixes. Reset the working directory after linting to ensure the build runs on a clean repository state. Co-authored-by: sgbaird <45469701+sgbaird@users.noreply.github.com>
Co-authored-by: sgbaird <45469701+sgbaird@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes PyPI version generation to produce clean semantic version numbers (e.g., 0.1.3) instead of versions with unwanted suffixes (e.g., 0.1.3.post1.dev0) when creating releases via the GitHub UI.
Key Changes:
- Added
git reset --hard HEADafter the pre-commit linting step to ensure a clean repository state before building packages - Explicitly specified
ref: ${{ github.ref }}in the checkout action to ensure tags are checked out correctly
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Added git reset command to clean up linting changes before package build, ensuring setuptools_scm generates clean version numbers; explicitly specified checkout ref for tag handling |
CHANGELOG.md |
Documented the fix for PyPI version suffixes, explaining both the checkout and git reset changes |
ref: ${{ github.ref }}to ensure tags are checked out correctlyOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.