Skip to content

Add PyPI publish workflow#93

Merged
hmgaudecker merged 1 commit into
mainfrom
add-pypi-publish
Jun 30, 2026
Merged

Add PyPI publish workflow#93
hmgaudecker merged 1 commit into
mainfrom
add-pypi-publish

Conversation

@hmgaudecker

@hmgaudecker hmgaudecker commented Jun 30, 2026

Copy link
Copy Markdown
Member

Adds release-to-PyPI automation, modeled on the dags/optimagic workflows but using PyPI Trusted Publishing (OIDC) instead of a stored API token.

What this adds

  • .github/workflows/publish-to-pypi.yml — builds sdist + wheel on every push and publishes to PyPI on tagged releases (if: startsWith(github.ref, 'refs/tags')). Uses OIDC (permissions: id-token: write, no password:). fetch-depth: 0 so hatch-vcs can read the version from git tags.
  • CHANGES.md — release changelog.

Already in place (no change needed)

  • Build backend hatchling + hatch-vcs with dynamic = ["version"] (version from git tags).
  • Complete [project] metadata: description, README long-description, license, classifiers, keywords, authors/maintainers, URLs.
  • LICENSE and README.md.

Manual step required before the first publish

  • Configure a Trusted Publisher for the skillmodels project on PyPI (Project → Settings → Publishing): owner OpenSourceEconomics, repository skillmodels, workflow publish-to-pypi.yml, environment left blank. This is per-project — other OSE packages currently use API tokens, so there is nothing to inherit.

To cut a release

  • Push a version tag, e.g. git tag v0.1.0 && git push origin v0.1.0. The workflow builds and uploads automatically.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.82%. Comparing base (4471d40) to head (3688047).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #93   +/-   ##
=======================================
  Coverage   95.82%   95.82%           
=======================================
  Files         142      142           
  Lines       14122    14122           
=======================================
  Hits        13533    13533           
  Misses        589      589           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add a GitHub Action that builds an sdist and wheel on every push and uploads
them to PyPI on tagged releases (modeled on the dags/optimagic setup, but using
PyPI trusted publishing / OIDC instead of a stored API token). fetch-depth: 0
so hatch-vcs can derive the version from git tags. Add CHANGES.md to track
releases.

Releasing: bump by pushing a version tag (e.g. `v0.1.0`); the workflow's
publish step is gated on `refs/tags`. Requires a trusted publisher to be
configured for the skillmodels project on PyPI (repo
OpenSourceEconomics/skillmodels, workflow publish-to-pypi.yml).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hmgaudecker hmgaudecker merged commit 311209c into main Jun 30, 2026
7 checks passed
@hmgaudecker hmgaudecker deleted the add-pypi-publish branch June 30, 2026 18:35
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