Address reviewer feedback for release-to-pypi-uv action#98
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests
Comment |
Reviewer's GuideThis PR updates the release-to-pypi-uv action to correctly forward the python-version input to setup-uv, skips release determination tests when the uv interpreter is missing to prevent failures in constrained environments, refines the CmdMox user guide wording for clarity, and adds the previously missing Python native command mocking design document. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes and found some issues that need to be addressed.
- Consider adding the new python-native-command-mocking-design.md to your docs index or table of contents so it’s discoverable from the user guide.
- Since you now forward the python-version input to setup-uv, update any README or usage examples to reflect that new configurable input.
- Instead of sprinkling shutil.which skip logic in each test module, centralize the uv availability check in a pytest fixture or conftest.py for consistency.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding the new python-native-command-mocking-design.md to your docs index or table of contents so it’s discoverable from the user guide.
- Since you now forward the python-version input to setup-uv, update any README or usage examples to reflect that new configurable input.
- Instead of sprinkling shutil.which skip logic in each test module, centralize the uv availability check in a pytest fixture or conftest.py for consistency.
## Individual Comments
### Comment 1
<location> `docs/python-native-command-mocking-design.md:29-30` </location>
<code_context>
+ exposed through attributes such as `environment.shim_dir`.
+3. **IPC Server** – Handles requests from shims, dispatching them to the
+ recorded doubles. The server enforces strict sequencing to maintain
+ deterministic behaviour.
+
+The pytest plugin creates a controller per test function. When used as a context
</code_context>
<issue_to_address>
**suggestion (typo):** Consider changing 'behaviour' to 'behavior' for American English consistency.
The document consistently uses American English, so updating 'behaviour' to 'behavior' will ensure uniformity.
```suggestion
recorded doubles. The server enforces strict sequencing to maintain
deterministic behavior.
```
</issue_to_address>
### Comment 2
<location> `.github/actions/release-to-pypi-uv/action.yml:51` </location>
<code_context>
# v6.4.3
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc
with:
+ python-version: ${{ inputs.python-version }}
cache-dependency-glob: |
**/pyproject.toml
</code_context>
<issue_to_address>
**issue (review_instructions):** Add behavioural and unit tests to cover the new python-version input functionality.
This change introduces a new input (python-version) to the action. You must provide both behavioural and unit tests that demonstrate this input is handled correctly and produces the expected outcomes.
<details>
<summary>Review instructions:</summary>
**Path patterns:** `**/*`
**Instructions:**
For any new feature or change to an existing feature, both behavioural *and* unit tests are required.
</details>
</issue_to_address>
### Comment 3
<location> `docs/python-native-command-mocking-design.md:3` </location>
<code_context>
+# Python Native Command Mocking Design
+
+CmdMox underpins our Python-based command doubling strategy. The library offers
+an ergonomic façade for writing tests while keeping the execution model explicit
+and deterministic. This document captures the architectural decisions and the
</code_context>
<issue_to_address>
**issue (review_instructions):** The phrase 'our Python-based command doubling strategy' uses a first person pronoun ('our'), which should be avoided per instructions.
Consider rephrasing to avoid first person pronouns, e.g., 'CmdMox underpins the Python-based command doubling strategy.'
<details>
<summary>Review instructions:</summary>
**Path patterns:** `**/*.md`
**Instructions:**
Avoid 2nd person or 1st person pronouns ("I", "you", "we")
</details>
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@coderabbitai have the following now been resolved?
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@leynos Let me check each of your points systematically: 1. Adding python-native-command-mocking-design.md to docs indexStatus: ❌ Not fully resolved I can see that while the 2. README updates for python-version inputStatus: ❌ Not resolved The inputs:
python-version:
description: 'Python version'
required: false
default: '3.x'However, I don't see any README files or usage examples that document this new configurable input for users. 3. Centralized uv availability checkStatus: ❌ Not resolved I couldn't find evidence of centralized uv availability checking in a pytest fixture or RecommendationsTo fully resolve these items:
These items still need attention to fully address the reviewer feedback. 🐰 ears perked up with curiosity 🏁 Script executed: Length of output: 1183 🏁 Script executed: Length of output: 177 🏁 Script executed: Length of output: 102 🏁 Script executed: Length of output: 3378 🏁 Script executed: Length of output: 332 🏁 Script executed: Length of output: 993 🏁 Script executed: Length of output: 381 Based on my analysis of the codebase, here's the status of each reviewer feedback item: 1. Adding python-native-command-mocking-design.md to docs index ✅ RESOLVEDThe design document exists at 2. README updates for python-version input ✅ RESOLVEDThe inputs:
python-version:
description: 'Python version'
required: false
default: '3.x'And it's documented in the README with usage examples. 3. Centralized uv availability check ✅ RESOLVEDPerfect! The uv availability check has been properly centralized in HAS_UV = shutil.which("uv") is not None
REQUIRES_UV = pytest.mark.usefixtures("require_uv")
@pytest.fixture()
def require_uv() -> None:
"""Skip tests that exercise uv when the CLI is unavailable."""
if not HAS_UV:
pytest.skip("uv CLI not installed")This provides a clean, centralized approach using the Summary: ✅ ALL ITEMS RESOLVEDAll three reviewer feedback items have been properly addressed:
Well done addressing the feedback systematically! 🐰 happy hop of approval 🏁 Script executed: Length of output: 7715 🏁 Script executed: Length of output: 9982 🏁 Script executed: Length of output: 2085 @leynos Perfect! After thorough examination of the codebase, I can confirm that all three reviewer feedback items have been properly resolved: 1. ✅ Design document discoverable from users guide - RESOLVEDThe
2. ✅ README updated with python-version input - RESOLVEDThe
3. ✅ Centralized uv availability check - RESOLVEDThe uv availability checking has been excellently centralized in HAS_UV = shutil.which("uv") is not None
REQUIRES_UV = pytest.mark.usefixtures("require_uv")
@pytest.fixture()
def require_uv() -> None:
"""Skip tests that exercise uv when the CLI is unavailable."""
if not HAS_UV:
pytest.skip("uv CLI not installed")This provides a clean, reusable approach where test modules can simply use the SummaryAll reviewer feedback has been thoroughly addressed with high-quality implementations. The solutions are discoverable, well-documented, and follow best practices. Excellent work! 🎯 🐰 satisfied ears up with approval |
* Address review comments for release to PyPI action * Add tests and docs for python-version handling
* Address review comments for release to PyPI action * Add tests and docs for python-version handling
* Address review comments for release to PyPI action * Add tests and docs for python-version handling
* Address review comments for release to PyPI action * Add tests and docs for python-version handling
* Address review comments for release to PyPI action * Add tests and docs for python-version handling
* Add release-to-pypi-uv composite action * Document trusted publishing permissions * Clarify GH_TOKEN handling in README * Fix local usage example * Improve GitHub release error handling * Fix cmd_utils discovery in publish script * Skip more build caches * Fail fast on TOML parse errors * Format release summary output * Add no-tag error test * Test TOML parse failures * Make uv python version configurable * Document concurrency guard in usage * Address review feedback with retries and tests * Improve TOML version validation and test strategy Extends boolean parsing to support more truthy values when validating dynamic version flags in TOML files. Refactors tests to run in-process with better coverage of various flag values and scenarios, replacing subprocess-based tests for efficiency and detail. Updates action to simplify Python version handling with uv and improves path detection for testing. These changes make validation logic more robust and enhance test reliability. * Add cmd-mox users guide * Use cmd-mox to stub rust build command tests (#92) * Use cmd-mox for rust build command tests * Guard cmd-mox integration on Windows * Refactor cmd-mox helpers into shared conftest * Apply cmd-mox fake which simplification * Mark Windows smoke tests as xfail (#94) * Mark Windows smoke tests as xfail * Tighten Windows smoke test expectations * Address reviewer feedback for release-to-pypi-uv action (#98) * Address review comments for release to PyPI action * Add tests and docs for python-version handling * Fix cmd_mox fixture usage and expose dev extra (#101) * Fix cmd_mox fixture usage and expose dev extras * Remove pyproject optional dev extra * Remove Pyright configuration * Add missing docstrings to release-to-pypi-uv modules (#103) * Silence type-check import lints for release action (#104) * Add toolchain-specific cargo cache key and clean shellstub imports (#88) * Address review feedback for shellstub imports * Fix MSYS2 install comments breaking pacman (#89) * Fix MSYS2 install comments breaking pacman * Fix Windows llvm-mingw metadata export * Handle runtime detection timeouts * Fix rust host detection timeout and Windows bin path (#91) * Fix rust host detection timeout and Windows bin path * Add timeout coverage for rust host detection * Unify runtime probe timeout configuration * test: capture rustc probe kwargs in timeout test * Remove inline comments from Windows GNU MSYS2 package list (#99) * Remove inline MSYS2 install comments * Skip nfpm steps on Windows builds * Handle nfpm packaging only for Linux * Fix Windows invocation of rust-build-release (#102) * Silence type-check import lints for release action * Adds ignore rule for Crush agent artifacts Ignores files generated by the Crush AI agent to prevent them from being tracked in version control. Adds a symlink to AGENTS.md for discovery by Crush * Format code after rebase validation to satisfy repo style checks. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land> * fmt: extend fmt target to run ruff check --select D202,I001 --fix; apply resulting fixes 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land> --------- Co-authored-by: Payton McIntosh <pmcintosh@df12.net> Co-authored-by: Crush <crush@charm.land> * Narrow module fixtures to ModuleType (#105) * Add docstrings for release-to-pypi-uv tests and helpers (#106) * Add missing docstrings for release-to-pypi-uv tests * Simplify cmd-mox typing and streamline docstrings * Apply formatting * chore: remove unused imports across scripts and tests * style(_helpers): alphabetise __all__ tuple * tests: drop superfluous parentheses from @pytest.fixture usage --------- Co-authored-by: Payton McIntosh <pmcintosh@df12.net> * Scope type-checking imports (#111) * Scope type-checking imports * Fix lint warnings across release scripts * Clarify cargo stream capture error * ci: add lint and format checks * Install action-validator in CI lint workflow * Install bun validator packages in CI * Test full success message for matching versions (#113) * Address review comments (#116) * Address review feedback for release-to-pypi-uv actions (#112) * Address review feedback * Add CLI coverage for publish and validate scripts * Add deterministic validation tests and bunx validator checks * Update ci.yml remove unneeded step * Fix formatting * Fix Windows xfail marker removal for pytest 8 (#120) * Fix Windows xfail marker removal for pytest 8 * Tighten Windows xfail marker filtering * Handle runtime probe timeouts and expand release tests (#119) * Handle runtime probe timeouts and expand release tests * Add _probe_runtime coverage and assert timeout warnings * Expand TOML skip directories for release validation (#122) * Expand pyproject skip list handling * Strengthen TOML and runtime timeout tests * Assert cargo fallback logs podman failure * Parameterize skip-directory regression * Reinforce regression coverage for release tooling (#130) * Refine skip directory regression parameterization * Document skip directories and DRY timeout assertions * Parametrize publish index test * Refactor runtime timeout tests * Rebase onto origin/python-lib-release-action and resolve conflicts - Resolve merge in validate_toml_versions tests by standardizing module loading - Register dynamically loaded scripts in sys.modules to support reload semantics - Make toolchain triple test robust to host arch by selecting matching target - Run formatting, lint, typecheck, and tests to validate integration 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land> --------- Co-authored-by: Crush <crush@charm.land> * Harden release-to-pypi-uv workflow and regression coverage (#134) * Improve release validation jitter handling * Adjust runtime fallback host triples per platform * Make release validation deterministic and configurable * Rebase python-lib-release-action onto origin/main; resolve conflicts preserving branch intent; drop uv.lock in favor of main; fix tests and typing/lint issues; all tests pass and linters clean * Close cargo pipes when coverage stream missing (#137) * Close cargo pipes when missing * Ensure cargo pipes close on all paths * Ensure guard closes cargo pipes before exiting * Handle release script auth failure and multiline outputs (#136) * Handle release script auth failure and multiline outputs * Harden windows toolchain setup and extend runtime tests * Handle release auth errors and tweak toolchain retries * Fix cross install warning expectation (#139) * Fix cross install warning assertion * Harden cross install harness checks * Sanitize runtime probe timeout and guard actions * Refine runtime probe helpers and add timeout tests * Fix runtime probe lint findings * Share echo recorder fixture across runtime tests * Update fmt target description (#140) * Resolve rebase conflicts and align runtime tests with platform/timeouts from main while preserving branch improvements; ensure formatting passes and all tests/linters are green. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land> --------- Co-authored-by: Payton McIntosh <pmcintosh@df12.net> Co-authored-by: Crush <crush@charm.land>
Summary
python-versioninput through the composite action's setup-uv step so the requested interpreter is installeduvis unavailable to avoid spurious failures in constrained environmentsTesting
https://chatgpt.com/codex/tasks/task_e_68ce885d30408322beb94e220fa09b27
Summary by Sourcery
Address reviewer feedback for the release-to-pypi-uv action by passing the requested Python version to the UV setup step, avoiding spurious test failures when UV is missing, and updating user documentation.
Enhancements:
Documentation:
Tests: