Address review feedback for release-to-pypi-uv actions#112
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
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Comment |
Reviewer's GuidePins Typer dependencies across uv scripts, refactors the publish_release entrypoint to decouple CLI and programmatic APIs, updates tests to accept optional CLI parameters, and tightens cross-install fallback assertions. 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.
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/actions/release-to-pypi-uv/tests/test_validate_toml_versions.py:199` </location>
<code_context>
""",
)
- _invoke_main(module, version="1.0.0", fail_on_dynamic="")
+ _invoke_main(module, version="1.0.0", fail_on_dynamic=None)
captured = capsys.readouterr()
</code_context>
<issue_to_address>
**suggestion (testing):** Consider adding a test for when all optional CLI parameters are omitted.
Adding a test case with all optional CLI parameters omitted will help verify that default values are correctly applied and prevent unexpected errors.
</issue_to_address>
### Comment 2
<location> `.github/actions/release-to-pypi-uv/scripts/publish_release.py:52` </location>
<code_context>
-def main(index: str = INDEX_OPTION) -> None:
+def main(index: str = "") -> None:
"""Publish the built distributions with uv.
</code_context>
<issue_to_address>
**issue (review_instructions):** Add behavioural and unit tests for the refactored main function and CLI entrypoint.
You refactored the CLI entrypoint and changed the signature of main, but did not add or update behavioural and unit tests to cover these changes. Ensure that both types of tests are present and demonstrate the new behaviour.
<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> `.github/actions/release-to-pypi-uv/scripts/publish_release.py:69` </location>
<code_context>
run_cmd(["uv", "publish"])
+def cli(index: str = INDEX_OPTION) -> None:
+ """CLI entrypoint."""
+
</code_context>
<issue_to_address>
**issue (review_instructions):** Add behavioural and unit tests for the new cli function.
The new cli function is a feature addition and must be covered by both behavioural and unit tests. Please add tests that exercise this entrypoint and verify its behaviour.
<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 4
<location> `.github/actions/release-to-pypi-uv/scripts/publish_release.py:60-61` </location>
<code_context>
def main(index: str = "") -> None:
"""Publish the built distributions with uv.
Parameters
----------
index : str
Optional package index name or URL to pass to ``uv publish``.
"""
index = index.strip()
if index:
typer.echo(f"Publishing with uv to index '{index}'")
run_cmd(["uv", "publish", "--index", index])
else:
typer.echo("Publishing with uv to default index (PyPI)")
run_cmd(["uv", "publish"])
</code_context>
<issue_to_address>
**suggestion (code-quality):** Use named expression to simplify assignment and conditional ([`use-named-expression`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/use-named-expression/))
```suggestion
if index := index.strip():
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
0335e04 to
8817eeb
Compare
* Address review feedback * Add CLI coverage for publish and validate scripts * Add deterministic validation tests and bunx validator checks
* Address review feedback * Add CLI coverage for publish and validate scripts * Add deterministic validation tests and bunx validator checks
* Address review feedback * Add CLI coverage for publish and validate scripts * Add deterministic validation tests and bunx validator checks
* 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
Testing
https://chatgpt.com/codex/tasks/task_e_68d06afce5fc8322bac2a931856c9a28
Summary by Sourcery
Pin release-to-pypi-uv scripts to a fixed Typer minor version, refactor publish_release to decouple its CLI entrypoint from the core API, clean up path-extension logic, and improve related tests for cross-install fallback and TOML version validation
Enhancements:
Tests: