Honor [pipx.run] for typed --spec app names on the uv backend - #2006
Merged
gaborbernat merged 5 commits intoAug 25, 2026
Merged
Conversation
uv tool run has no knowledge of pipx's [pipx.run] group, so a typed app name that is not the PEP 503-normalized distribution name now goes through the venv path instead.
for more information, see https://pre-commit.ci
The regression covered the InvalidRequirement path and missed parsed specs such as registry requirements and direct references. Exercise each branch through CLI behavior and mock os.execvpe. The uv guide described [pipx.run] as unsupported. Align its cache guidance with the routing predicate.
Ruff 0.16 reports selector codes as fixable configuration errors. Store canonical names so Ruff accepts the project config without a migration pass.
Routing a named `--spec` to the venv path means a spec without a distribution name now pays for a throwaway venv, since pipx installs the package once to learn its name and once for the run. `_prepare_venv` left `package_name_from_spec` to resolve its own backend, so that first venv ignored `--backend uv` and fell back to pip. Pass the backend through, and note the double install in the uv how-to. `test_run_matching_name_uses_uv_tool_run` patched `os.execvpe`, which `exec_app` reaches on POSIX but not on Windows. There the patch never fires, so the test shells out to a real `uv tool run` and then trips over a mock that recorded no call. Patch the handover in `run_uv` instead, and assert that it happened. The changelog promised `[pipx.run]` discovery for `--spec` runs. The guard delivers it for an app name the spec does not carry; an app named after the package still goes to uvx, which does not read `[pipx.run]` metadata. State that limit in the fragment and the how-to.
gaborbernat
enabled auto-merge (squash)
August 25, 2026 03:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uv tool runhas no knowledge of pipx's[pipx.run]entry-point group. After 🐛 fix(run): discover entry points for inferred names #1996,pipx run coherent.testalready falls off the uvx fast-path because the name normalizes, butpipx run --spec <spec> <app>still handed the typed app name touv tool run.[pipx.run]case, e.g.pipx run --spec 'coherent.test>=0.7.0' coherent.test), route through the venv path so_find_entry_point(..., "pipx.run")can honor it. Matching names such aspipx run --spec pycowsay pycowsaystill useuv tool run.--specvalues also take the venv path, since they are not requirement namesuv tool runcan look up as console scripts.Fixes #2004.
Test plan
test_run_spec_typed_pipx_run_name_skips_uv_tool_run—--spec coherent.test>=0.7.0 coherent.testdoes not callrun_via_uv_tool_runtest_run_spec_matching_name_uses_uv_tool_run—--spec pycowsay pycowsaystill uses the uvx fast-pathtest_run_spec_honors_dotted_pipx_run_entry_point— local project with only[pipx.run] empty.projectruns via the venv path under--backend uv--spectests still pass