Skip to content

automatically create PyPi releases on tags#106

Open
grische wants to merge 3 commits into
python-morgan:mainfrom
RISEFX:feature/pypi-release-workflow
Open

automatically create PyPi releases on tags#106
grische wants to merge 3 commits into
python-morgan:mainfrom
RISEFX:feature/pypi-release-workflow

Conversation

@grische

@grische grische commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This replaces the manual releases with automatic releases on tag pushes (and test releases on every merge to main).

@grische
grische requested review from ido50 and philnewm July 16, 2026 15:05
@grische
grische force-pushed the feature/pypi-release-workflow branch from fee542b to cc3330a Compare July 16, 2026 15:05
grische and others added 3 commits July 17, 2026 11:47
Use the hatch-vcs plugin so the package version is derived from the
latest git tag (e.g. tag "v0.15.0" -> "0.15.0") instead of a version
string maintained in the source tree.

The runtime `__version__` is now resolved via importlib.metadata,
using the importlib_metadata backport on Python 3.7 to match the
pattern already used in configurator.py, and the obsolete
morgan/__about__.py is removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a release workflow that builds and publishes to PyPI on any `v*`
tag push, using OIDC trusted publishing (no stored secrets). The build
job checks out full history (fetch-depth: 0) so the tag is visible to
hatch-vcs, and a separate publish job runs in a `pypi` environment
with `id-token: write`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Publish to TestPyPI on every push to main (and on tags), and publish to
PyPI only for tags. The PyPI job depends on the TestPyPI job, so a tagged
release is only pushed to PyPI once the TestPyPI upload succeeds.

Set setuptools-scm's local_scheme to "no-local-version" so dev builds
from untagged commits produce upload-valid versions (e.g. "0.15.1.dev1");
(Test)PyPI rejects PEP 440 local version identifiers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@grische
grische force-pushed the feature/pypi-release-workflow branch from cc3330a to b36afe4 Compare July 17, 2026 09:49
@grische grische changed the title Create PyPi releases on tags automatically automatically create PyPi releases on tags Jul 17, 2026
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