This project uses hatch-vcs — the git tag is the single source of truth for
the version. There is no version string in any file to maintain manually.
Existing tags (1.0.0, 1.0.1) have no v prefix; both forms are
understood. New tags conventionally use the v prefix.
Both Test PyPI and PyPI use OIDC trusted publishing (no API tokens needed).
-
Test PyPI: Go to https://test.pypi.org/manage/project/pipforester/settings/publishing/
- Add a GitHub publisher: owner=
collective, repo=pipforester, workflow=release.yaml, environment=release-test-pypi
- Add a GitHub publisher: owner=
-
PyPI: Go to https://pypi.org/manage/project/pipforester/settings/publishing/
- Add a GitHub publisher: owner=
collective, repo=pipforester, workflow=release.yaml, environment=release-pypi
- Add a GitHub publisher: owner=
-
GitHub Environments: In the repo settings, create two environments:
release-test-pypirelease-pypi(optionally add required reviewers for extra safety)
uv tool install hatch # optional, for local buildsgit checkout main
git pull
pytestTags must follow PEP 440. The v prefix is optional but conventional:
git tag v1.0.2For pre-releases:
git tag v1.0.2a1 # alpha
git tag v1.0.2b1 # beta
git tag v1.0.2rc1 # release candidategit push origin v1.0.2- Go to https://github.com/collective/pipforester/releases/new
- Select the tag you just pushed:
v1.0.2 - Set the release title:
v1.0.2 - Add release notes (or use "Generate release notes")
- For pre-releases, check "Set as a pre-release"
- Click "Publish release"
Publishing the GitHub Release triggers the release workflow, which builds
the sdist + wheel and publishes to PyPI. Every push to main also
publishes an in-dev version to Test PyPI automatically.
- Check https://pypi.org/project/pipforester/ for the new version
- Verify installation:
uv pip install pipforester==1.0.2
hatch build # creates sdist + wheel in dist/
ls dist/
# pipforester-1.0.2.tar.gz
# pipforester-1.0.2-py3-none-any.whlNote: Without a git tag on the current commit, hatch-vcs generates a dev
version like 1.0.2.dev4. This is expected and correct for development
builds.
| Artifact | Contents |
|---|---|
sdist (.tar.gz) |
Source code |
wheel (.whl) |
Pure Python wheel (py3-none-any), the pipforester package |
- All tests pass (
pytest) - CHANGES.md is up to date
- README.md is up to date
-
mainbranch is clean (no uncommitted changes) - Tag follows PEP 440 (
v1.0.2, notrelease-1.0.2) - GitHub Release created with release notes
- Package visible on PyPI