Skip to content

Set up PyPI publishing with git-based versioning#8

Merged
ianhi merged 4 commits intomainfrom
setup-publishing
Mar 6, 2026
Merged

Set up PyPI publishing with git-based versioning#8
ianhi merged 4 commits intomainfrom
setup-publishing

Conversation

@ianhi
Copy link
Copy Markdown
Collaborator

@ianhi ianhi commented Mar 6, 2026

Summary

  • Switch from hardcoded version = "0.1.0" to hatch-vcs (git tag based versioning)
  • Add publish.yml workflow: triggers on v* tags, builds with uv build, publishes via trusted publishing (pypi environment)
  • Update __init__.py to import from generated _version.py
  • Add _version.py to .gitignore

To release after merge

git tag v0.1.0
git push origin v0.1.0

Test plan

  • uv build produces correct sdist and wheel
  • import third_wheel; print(third_wheel.__version__) works
  • All tests pass
  • After merge + tag, publish workflow runs and uploads to PyPI

🤖 Generated with Claude Code

ianhi and others added 4 commits March 6, 2026 16:00
- Switch from hardcoded version to hatch-vcs (git tag based)
- Add publish.yml workflow triggered on v* tags, using trusted
  publishing via the pypi environment
- Update __init__.py to import from generated _version.py
- Add _version.py to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Triggers on GitHub release creation (not tag push). Build with
uv, publish to PyPI via trusted publishing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ianhi ianhi merged commit cdb919b into main Mar 6, 2026
5 checks passed
@ianhi ianhi deleted the setup-publishing branch March 6, 2026 21:08
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