-
Notifications
You must be signed in to change notification settings - Fork 37
CI: Add PyPI release workflow #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Caution Review failedThe pull request is closed. Summary by CodeRabbit
WalkthroughThe changes include renaming an existing GitHub Actions workflow for clarity and introducing a new workflow dedicated to building and publishing Python packages to PyPI. The new workflow is triggered by various events and automates the build and publish process using trusted publishing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~6 minutes Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/release-pypi.yml (2)
55-58
: Pin build tooling for reproducibility
uv pip install build
installs the latestbuild
every run, which can introduce breaking changes. Pin to a known good version (e.g.,build==1.2.1
) or cache the wheel to keep builds deterministic.- uv pip install build + uv pip install build==1.2.1
60-61
: Safer condition for tag publishing
github.event.ref
does not exist onpull_request
orschedule
events. Usegithub.ref
and guard by event name to avoid evaluation issues:- if: startsWith(github.event.ref, 'refs/tags') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/release-github.yml
(1 hunks).github/workflows/release-pypi.yml
(1 hunks)
🔇 Additional comments (3)
.github/workflows/release-github.yml (1)
1-1
: Ensure concurrency group continuity after renaming the workflowThe
concurrency
block in.github/workflows/release-github.yml
is defined as:concurrency: cancel-in-progress: true group: ${{ github.workflow }}-${{ github.ref }}By renaming the workflow from
"Release"
to"Release: GitHub"
, the group key will change from
Release-${{ github.ref }}
→Release: GitHub-${{ github.ref }}
. In-flight runs started under the old key will no longer be cancelled by new runs.Please verify whether you rely on that cancellation behavior. If you do, consider:
- Pinning
group:
to a constant (for example,release-${{ github.ref }}
)- Extracting only the desired part of
github.workflow
via${{ github.workflow == 'Release: GitHub' && 'Release' }}
or similar- Running a quick test to confirm that in-progress jobs cancel as expected after this rename
.github/workflows/release-pypi.yml (2)
35-41
: Ensure thepypi
environment is configured for Trusted Publishing
The job assumes an environment namedpypi
with “OpenID-Connect” enabled and the project registered on PyPI for trusted-publisher auth. Without that, the publish step will 403. Verify the environment exists and OIDC is authorised.
28-29
: No changes needed — Python 3.13 is stable and supported
GitHub’s ubuntu-latest runners and actions/setup-python@v5 have included Python 3.13 since its October 2023 release. You can safely keep:python-version: ["3.13"]Likely an incorrect or invalid review comment.
env: | ||
OS_TYPE: ${{ matrix.os }} | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
UV_SYSTEM_PYTHON: true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Environment variable needs a string, not a boolean
UV_SYSTEM_PYTHON
is parsed as a string. Passing a bare true
serialises to "true"
in YAML 1.2, but some tooling treats it as boolean and emits True/False
. Make it explicit to avoid surprises:
- UV_SYSTEM_PYTHON: true
+ UV_SYSTEM_PYTHON: "1"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
env: | |
OS_TYPE: ${{ matrix.os }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
UV_SYSTEM_PYTHON: true | |
env: | |
OS_TYPE: ${{ matrix.os }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
UV_SYSTEM_PYTHON: "1" |
🤖 Prompt for AI Agents
In .github/workflows/release-pypi.yml around lines 30 to 34, the environment
variable UV_SYSTEM_PYTHON is set to a bare boolean true, which can be
interpreted inconsistently by different tools. To fix this, explicitly set
UV_SYSTEM_PYTHON to the string "true" by enclosing it in quotes to ensure
consistent string parsing across all tooling.
What the title says.