Add tag-based release workflow and migrate to setuptools-scm#854
Open
andrewleech wants to merge 2 commits intopyserial:masterfrom
Open
Add tag-based release workflow and migrate to setuptools-scm#854andrewleech wants to merge 2 commits intopyserial:masterfrom
andrewleech wants to merge 2 commits intopyserial:masterfrom
Conversation
Triggered on version tags (v[0-9]+.[0-9]+.[0-9]+*). Runs the test workflow first, builds sdist and wheel with uv, then publishes to both GitHub Releases and PyPI in parallel. Uses PyPI trusted publishing (OIDC) via a 'pypi' environment. Pre-release tags are detected via simple pattern matching on the tag name. Adds workflow_call trigger to the test workflow to support reuse from the release workflow.
Version is now derived from git tags rather than a hardcoded string in serial/__init__.py. setuptools-scm generates serial/_version.py at build time. Fallback chain: _version.py -> importlib.metadata -> "0.0.0+unknown". Also: install the package in tox docs and RTD environments so setuptools-scm can resolve the version during doc builds, remove the now-redundant sys.path hack from documentation/conf.py, and add a CHANGES.rst entry.
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.
Summary
__version__with git-tag-derived versioningskip_install = trueremoved) because setuptools-scm requires an actual install to resolve the version; thesys.pathhack inconf.pyis removed accordinglySetup required
GitHub
pypienvironment in repo Settings > Environmentsv*tags, require approval)PyPI
pyserialproject > Publishing > Add a new publisherpyserialpyserialrelease.yamlpypiRead the Docs
3.6.dev81+gabcdef) in published docsUsage
Tag a commit on master and push:
The workflow runs the test suite, builds sdist + wheel with uv, then publishes to GitHub Releases and PyPI in parallel. Pre-release tags (e.g.
v3.6.0rc1) are detected automatically.