Skip to content

build: add PyPI publish workflow via python-semantic-release + OIDC - #68

Open
farhan wants to merge 3 commits into
openedx:masterfrom
farhan:feat/add-pypi-publish-release
Open

build: add PyPI publish workflow via python-semantic-release + OIDC#68
farhan wants to merge 3 commits into
openedx:masterfrom
farhan:feat/add-pypi-publish-release

Conversation

@farhan

@farhan farhan commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Important

PR implemented with the assistance of Claude Code. Refined and validated before being submitted for code review.

Add PyPI publish workflow to mockprock
Part of openedx/public-engineering#506

Summary

  • This repo is now PyPI-publishable: https://pypi.org/project/mockprock/
  • Switch pyproject.toml from static version = "2.0.0" to setuptools-scm dynamic versioning via git tags
  • Rename existing release.ymlnpm-release.yml (preserves full git history of the npm workflow)
  • Add new pypi-release.yml following org-standard python-semantic-release v10.6.1 + OIDC trusted publishing pattern

Removed/Updated

Renamed workflows:

From To Reason
release.yml npm-release.yml Explicit naming to make room for the PyPI-standard pypi-release.yml

Added workflows:

Workflow Purpose
pypi-release.yml Runs CI → python-semantic-release → uploads dist artifacts → publishes to PyPI via OIDC

Versioning

setuptools-scm with dynamic = ["version"]python-semantic-release controls the version string at release time via git tags. fallback_version = "2.0.0" is set since existing tags are npm-style (npmv*) which setuptools-scm cannot parse; a custom git_describe_command skips those tags and only matches Python-style version tags (v* or digit-prefixed). The first python-semantic-release run will create v2.0.0 or higher based on commit history.

Important Notes

  • OIDC trusted publisher must be configured on PyPI before merging. Go to https://pypi.org/manage/project/mockprock/settings/publishing/ and add a trusted publisher for openedx/mockprock, workflow pypi-release.yml.
  • npm-release.yml is unchanged from master — the existing Node.js npm release workflow is fully preserved; only renamed for clarity. Note: npm publishing via this workflow has not been active for some time (see Should @edx/mockprock continue to be published to npm? #69 for context and a question on whether to continue it).
  • Both workflows are fully independentnpm-release.yml and pypi-release.yml each call ci.yml independently on push to master with no coupling between them.

Testing Notes

This PR has not been manually tested against the repo's own features. Testing relied on CI checks and local agent tooling (uv lock --check, python -m build). Repo-owner is encouraged to verify the OIDC trusted publisher is configured on PyPI before merging.


🤖 Generated with Claude Code

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (7293e57) to head (0000799).

Additional details and impacted files
@@          Coverage Diff           @@
##           master     #68   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           7       7           
  Lines         331     331           
======================================
  Misses        331     331           
Flag Coverage Δ
unittests 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Makes room for the new pypi-release.yml following org standard while
preserving the full history of the npm release workflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan
farhan force-pushed the feat/add-pypi-publish-release branch 2 times, most recently from 1a7bd92 to 95b6cc1 Compare July 30, 2026 14:37
@farhan farhan changed the title feat: add PyPI publish workflow via python-semantic-release + OIDC build: add PyPI publish workflow via python-semantic-release + OIDC Jul 30, 2026
farhan and others added 2 commits July 30, 2026 19:44
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- actions/checkout: v4.3.1 → v7.0.1
- python-semantic-release: v9.9.0 → v10.6.1
- publish-action: v9.9.0 → v10.6.1
- upload-artifact: v4.6.2 → v7.0.1
- download-artifact: v4.3.0 → v8.0.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan
farhan force-pushed the feat/add-pypi-publish-release branch from 95b6cc1 to 0000799 Compare July 30, 2026 14:44
@farhan farhan self-assigned this Jul 30, 2026
@farhan farhan moved this to 👀 In review in Aximprovements Team Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

1 participant