Skip to content

CI: Stage release packages to PyPI through GHA#137

Merged
amotl merged 2 commits intomainfrom
ci-release-pypi
Jul 26, 2025
Merged

CI: Stage release packages to PyPI through GHA#137
amotl merged 2 commits intomainfrom
ci-release-pypi

Conversation

@amotl
Copy link
Copy Markdown
Member

@amotl amotl commented Jul 25, 2025

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 25, 2025

Summary by CodeRabbit

  • New Features
    • Introduced automated publishing of Python packages to PyPI via a new GitHub Actions workflow.
  • Documentation
    • Added release instructions outlining the steps for building and publishing new package versions.
  • Chores
    • Updated package configuration to include an additional subpackage in distributions.

Walkthrough

A new GitHub Actions workflow for automating Python package builds and publishing to PyPI has been added, alongside documentation detailing the release process. The workflow supports multiple triggers and conditional publishing, while the documentation guides maintainers through versioning, tagging, and pushing releases. Additionally, the Python package setup was updated to include a new subpackage.

Changes

File(s) Change Summary
.github/workflows/release-pypi.yml Added workflow to automate building and publishing Python packages to PyPI with conditional triggers
docs/release.md Added documentation describing the release workflow and step-by-step release instructions
setup.py Included "epo_ops.middlewares" subpackage in the package distribution list

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

In the warren, code hops to the sky,
With workflows that publish, oh my!
Docs guide each paw,
Through release without flaw,
Now PyPI carrots are nigh! 🥕✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fce8a38 and 8bf34dc.

📒 Files selected for processing (3)
  • .github/workflows/release-pypi.yml (1 hunks)
  • docs/release.md (1 hunks)
  • setup.py (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • docs/release.md
  • .github/workflows/release-pypi.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • setup.py
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci-release-pypi

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (e9f6280) to head (8bf34dc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #137   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files          18       18           
  Lines         438      438           
=======================================
  Hits          436      436           
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/release-pypi.yml (1)

67-68: Allow manual dispatch runs to publish when desired.

Under workflow_dispatch the job currently never publishes because the startsWith(github.event.ref, 'refs/tags') guard evaluates to false.
Consider adding an explicit input (e.g. publish: true/false) or relaxing the condition so maintainers can trigger a one-off publish without creating a tag.

Example diff:

-      - name: Publish package to PyPI
-        if: startsWith(github.event.ref, 'refs/tags')
+      - name: Publish package to PyPI
+        if: |
+          startsWith(github.event.ref, 'refs/tags') ||
+          (github.event_name == 'workflow_dispatch' && inputs.publish == 'true')
docs/release.md (1)

11-19: Streamline the push instruction.

git push --follow-tags pushes the commit and its tags in one command, keeping the history linear and reducing chances of forgetting the second push.

-```shell
-git push && git push --tags
-```
+```shell
+git push --follow-tags
+```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9f6280 and be1c9e3.

📒 Files selected for processing (2)
  • .github/workflows/release-pypi.yml (1 hunks)
  • docs/release.md (1 hunks)
🔇 Additional comments (2)
.github/workflows/release-pypi.yml (2)

28-30: Verify that setup-python supports 3.13 on ubuntu-latest.

actions/setup-python does not always provide the next-major CPython release immediately after it is cut. Picking a version that is not yet present on the runner images will cause the entire workflow to fail at the “Set up Python” step.

If 3.13 availability is uncertain, pin to the latest confirmed-available stable (e.g. 3.12) or add a second matrix entry so releases are not blocked.


35-41: Ensure the pypi environment exists and contains the required trusted-publisher settings.

The job references environment: pypi and requests the id-token: write permission.
If the repository does not actually define an environment named “pypi” with the PyPI trusted-publisher configuration, the job will error when attempting to acquire the OIDC token.

Please double-check the repository settings (Settings ▸ Environments) before merging.

@amotl amotl requested a review from gsong July 25, 2025 22:56
@amotl amotl marked this pull request as ready for review July 25, 2025 22:56
amotl added 2 commits July 26, 2025 01:50
############################
# Package would be ignored #
############################

Python recognizes 'epo_ops.middlewares.cache' as an importable package,
but it is absent from setuptools' `packages` configuration.

This leads to an ambiguous overall configuration. If you want to
distribute this package, please make sure that
'epo_ops.middlewares.cache' is explicitly added to the `packages`
configuration field.
@amotl amotl force-pushed the ci-release-pypi branch from fce8a38 to 8bf34dc Compare July 25, 2025 23:50
@amotl amotl merged commit e406ad9 into main Jul 26, 2025
6 checks passed
@amotl amotl deleted the ci-release-pypi branch July 26, 2025 11:49
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