-
Notifications
You must be signed in to change notification settings - Fork 8
Add trusted publishing (while using uv) #770
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
|
""" WalkthroughThe GitHub Actions workflows for publishing and verifying Python package releases were updated to use the Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant uv Tool
participant PyPI/TestPyPI
GitHub Actions->>uv Tool: Install and seed virtual environment
GitHub Actions->>uv Tool: Build package (uv build)
alt On merge (PyPI)
GitHub Actions->>uv Tool: Publish to PyPI (uv publish)
uv Tool->>PyPI/TestPyPI: Upload package
else On verify (TestPyPI)
GitHub Actions->>TestPyPI: Check if version exists
alt Version does not exist
GitHub Actions->>uv Tool: Publish to TestPyPI (uv publish)
uv Tool->>PyPI/TestPyPI: Upload package
else Version exists
GitHub Actions-->>GitHub Actions: Skip publish step
end
end
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #770 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 3382 3382
=========================================
Hits 3382 3382 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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: 2
🧹 Nitpick comments (3)
CHANGELOG.md (1)
3-6: Minor grammar & casing tweak improves changelog readability- - Chores move module publishing on (test)pypi to Trusted Publishing (and using uv) + - Chore: move module publishing on (test)PyPI to Trusted Publishing (using uv).github/workflows/merge.yml (1)
35-45: Remove trailing whitespace & keep command section tidyLines 41 and 45 contain trailing spaces – causes YAML-lint failures.
- uv build␠ + uv build … - uv publish ␠ + uv publish.github/workflows/verify.yml (1)
251-286: Optional: fail fast on script errors & pinuvAdding
set -euo pipefailand pinninguvkeeps the publishing step predictable.- run: | - pip install uv + run: | + set -euo pipefail + pip install "uv==0.1.43" # keep CI deterministic uv venv --seed venv
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/merge.yml(2 hunks).github/workflows/verify.yml(2 hunks)CHANGELOG.md(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
.github/workflows/verify.yml (1)
Learnt from: CoMPaTech
PR: plugwise/python-plugwise#656
File: .pre-commit-config.yaml:9-9
Timestamp: 2024-11-28T19:54:45.351Z
Learning: The project's dependencies and pre-commit hooks (e.g., ruff at v0.8.0, bandit at 1.8.0, pyupgrade at v3.19.0) are confirmed to be compatible with Python 3.13.
🪛 YAMLlint (1.37.1)
.github/workflows/merge.yml
[warning] 23-23: wrong indentation: expected 6 but found 8
(indentation)
[error] 41-41: trailing spaces
(trailing-spaces)
[error] 45-45: trailing spaces
(trailing-spaces)
.github/workflows/verify.yml
[warning] 242-242: wrong indentation: expected 6 but found 8
(indentation)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Process test coverage
bouwew
left a comment
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.
LGTM!
|
Succesfully deployed to https://test.pypi.org/project/plugwise/#history @bouwew all honour to you to merge and publish :) |
|



As requested by @bouwew
On purpose no bumping the release (which should be done to completely test/cycle this).
Changed code has been tested using another, unrelated, module. Given the creation of the environments (Github->Settings->Environments) and the TP on both testpypi and pypi it should pass.
Initial should become green, but not upload (since v1.7.7 already exists). Proofing the pudding will be in a minor version bump or an alpha or patch bump.
Summary by CodeRabbit