Derive package version from git tag via setuptools-scm - #405
Merged
Conversation
The version was hardcoded as 0.0.1 in pyproject.toml and only rewritten by a sed step in the release workflow's throwaway checkout. As a result, GitHub's auto-generated source tarballs (and anything built from them, e.g. conda/distro packages) always reported 0.0.1, and flask_cors/version.py drifted out of sync (stuck at 5.0.0). Make the git tag the single source of truth: - Use setuptools-scm dynamic versioning instead of a hardcoded version. - Add .git_archival.txt + .gitattributes export-subst so versions are recovered from GitHub's git-archive source tarballs. - Read the runtime __version__ from importlib.metadata and drop the stale hardcoded flask_cors/version.py. - Drop the fragile sed-based set-version job from the release workflow and fetch full history/tags so setuptools-scm can derive the version. Fixes #387
The switch to dynamic (setuptools-scm) versioning means the flask-cors entry in uv.lock no longer carries a static version, so 'uv lock --locked' (run by 'make check' in CI) needs the regenerated lockfile.
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The version was hardcoded as 0.0.1 in pyproject.toml and only rewritten by a sed step in the release workflow's throwaway checkout. As a result, GitHub's auto-generated source tarballs (and anything built from them, e.g. conda/distro packages) always reported 0.0.1, and flask_cors/version.py drifted out of sync (stuck at 5.0.0).
Make the git tag the single source of truth:
Fixes #387