Skip to content

Add PyPI deployment via hatchling + OIDC trusted publisher#14

Merged
tallpsmith merged 11 commits into
mainfrom
feature/pypi-deployment
Mar 21, 2026
Merged

Add PyPI deployment via hatchling + OIDC trusted publisher#14
tallpsmith merged 11 commits into
mainfrom
feature/pypi-deployment

Conversation

@tallpsmith
Copy link
Copy Markdown
Owner

@tallpsmith tallpsmith commented Mar 20, 2026

Summary

  • Migrate build backend from setuptools to hatchling + hatch-vcs for git-tag-derived versioning
  • Rename PyPI package to pcp-pmlogsynth, add readme and license fields
  • Replace all hardcoded 0.1.0 version strings with dynamic __version__ from hatch-vcs
  • Add release.yml workflow: validates tag-version match, publishes via OIDC Trusted Publisher
  • Update README pip install commands to use new package name

Manual Setup Required After Merge

  • Create pypi environment in repo Settings > Environments
  • Register pending publisher on pypi.org for pcp-pmlogsynth (owner: tallpsmith, repo: pmlogsynth, workflow: release.yml, environment: pypi)
  • Recommended: TestPyPI dry-run before first real release
  • First release: tag v0.1.0, create GitHub Release

Test Plan

  • All 472 tests pass (465 unit/integration + 7 E2E)
  • ./pre-commit.sh green (ruff, mypy, all test tiers)
  • python -m build produces correct sdist and wheel
  • Wheel contains: package code, profiles, schema_context.md, man page
  • CI passes on this PR
  • After merge: create GitHub environment + PyPI trusted publisher
  • After merge: tag v0.1.0, create release, verify workflow publishes

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.
@tallpsmith tallpsmith merged commit eaa907a into main Mar 21, 2026
4 checks passed
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