Add PyPI deployment via hatchling + OIDC trusted publisher#14
Merged
Conversation
Document the approved approach for publishing pcp-pmlogsynth to PyPI: hatchling + hatch-vcs migration, OIDC trusted publisher, tag-version validation.
Clarify: cli.py hardcoded version fix, man page strategy (drop from wheel), hatch CLI vs hatchling distinction, tag format convention, PCP dependency notice for PyPI users, TestPyPI dry-run for first release, version fallback pattern, and package-data verification.
Use wheel.shared-data instead of dropping man page from PyPI installs.
7 tasks: gitignore, pyproject.toml migration, dynamic version, CLI version fix, README PCP notice, release workflow, final verification.
Enables git-tag-derived versioning and renames PyPI package to pcp-pmlogsynth. Explicit packages config needed since import name differs from project name.
Replaces hardcoded version string with dynamic import + fallback. Adds tests for version string and CLI version flag.
cli.py now imports __version__ instead of hardcoding 0.1.0. Schema context test validates version format instead of exact match against pyproject.toml (which no longer has a static version field).
Triggered on GitHub Release, validates tag-version match, publishes via OIDC Trusted Publisher. No secrets required.
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
pcp-pmlogsynth, addreadmeandlicensefields0.1.0version strings with dynamic__version__from hatch-vcsrelease.ymlworkflow: validates tag-version match, publishes via OIDC Trusted PublisherManual Setup Required After Merge
pypienvironment in repo Settings > Environmentspcp-pmlogsynth(owner:tallpsmith, repo:pmlogsynth, workflow:release.yml, environment:pypi)v0.1.0, create GitHub ReleaseTest Plan
./pre-commit.shgreen (ruff, mypy, all test tiers)python -m buildproduces correct sdist and wheel