Repository navigation
fix(hook): rewrite pytest under uv run - #2416
Conversation
|
Hey @jbellis ! Thanks for this PR, clean direction and code, lgtm. Possible enhancement Generalize the allowlistRight now strip_uv_run_pytest_prefix hardcodes the two pytest forms. But uv run is conceptually the same as the wrappers RTK already strips generically (poetry run, bundle exec, docker exec, the doc comment in this file even lists them): strip the prefix, recurse, re-prepend if the inner command rewrote. If uv run is handled by that same mechanism instead of a pytest-specific helper, every tool RTK already filters gets covered under uv run for free |
|
Hey @jbellis ready to merge , just waiting in case you want to go a little further with the review. Waiting for your call on this ! |
17f0f59 to
34441dd
Compare
|
Wow, apologies for missing this, that's a much better solution. Force-pushed rather than cluttering the history. |
|
@jbellis All look good to me Thanks for this clean contribution ! Will be available in next release, should land by the end of the week |
Summary
Teach hook rewrite detection to preserve
uv runfor the two common pytest forms:uv run pytest ...uv run python -m pytest ...These now rewrite to:
uv run rtk pytest ...[This covers almost 10% of the "uv run" commands that Codex has executed on my machine]
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testAdded/kept coverage for:
uv run pytest ...PYTHONPATH=. uv run pytest ...uv run python -m pytest ...uv run ...commands remain unreviseduv runoption-bearing forms remain unrevised