Repository navigation
feat(pipx): add per-tool registry URL - #11754
Conversation
📝 WalkthroughWalkthroughThe pipx backend now supports per-tool ChangesPipx registry configuration
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ToolConfiguration
participant PIPXBackend
participant RegistryCache
participant PackageRegistry
ToolConfiguration->>PIPXBackend: provide per-tool registry_url
PIPXBackend->>ToolConfiguration: resolve effective registry URL
PIPXBackend->>RegistryCache: select registry-specific cache
PIPXBackend->>PackageRegistry: request package versions
PackageRegistry-->>PIPXBackend: return available versions
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 56a3a7a. Configure here.
Greptile SummaryThe PR adds a per-tool pipx registry URL for version discovery and isolates cached version results by effective registry.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported registry-blind remote-version cache is now partitioned by registry context in memory and on disk, with dedicated two-registry coverage. Important Files Changed
Reviews (2): Last reviewed commit: "fix(pipx): isolate remote version cache ..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/backend/pipx.rs (1)
1043-1111: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd latest-version cache-isolation coverage.
This test validates
list_remote_versions, but it does not validate the separate cache used bylatest_stable_version. Add a two-registry test that callslatest_stable_versionon both backends and asserts1.0.0and2.0.0. This will detect a registry-hash collision or omitted registry key in the latest-version cache.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/backend/pipx.rs` around lines 1043 - 1111, Extend the per_tool_registries_isolate_remote_version_cache test to also call latest_stable_version for both configured backends and assert the registry-specific results are 1.0.0 and 2.0.0. Keep the separate mock registries and existing list_remote_versions assertions so the latest-version cache includes the registry identity and cannot reuse the other backend’s value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/backend/pipx.rs`:
- Around line 1043-1111: Extend the
per_tool_registries_isolate_remote_version_cache test to also call
latest_stable_version for both configured backends and assert the
registry-specific results are 1.0.0 and 2.0.0. Keep the separate mock registries
and existing list_remote_versions assertions so the latest-version cache
includes the registry identity and cannot reuse the other backend’s value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 1f918afd-5a0d-49d5-b526-ad6d352ee2c8
📒 Files selected for processing (1)
src/backend/pipx.rs
Instruction countsNothing was compared, and so nothing was gated. No series appears on both sides: either the base has no measurements recorded, or the two were measured on different runner classes, which are deliberately not comparable — counts shift between machine types by more than a real regression does. New, nothing to compare against: Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.
|

Summary
registry_urloption to the pipx backenduvx_argsandpipx_argsRoot cause
uvx_argsandpipx_argsare install-time options, whilelatestis resolved earlier through the globalpipx.registry_url. A private package could therefore be installed when pinned but could not resolvelatestwithout changing the registry globally.This adds a discovery-only per-tool override, so other pipx tools continue using PyPI and installation can retain explicit extra-index semantics.
Fixes the limitation reported in #11753.
Validation
cargo test backend::pipx::tests --all-featuresmise run lint-fixAI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.
Note
Medium Risk
Touches core pipx version-resolution and caching paths; install still relies on global index URL, so misconfiguration could mean resolved versions come from a different index than install unless
uvx_args/pipx_argsalign.Overview
Adds a per-tool
registry_urltool option on the pipx backend so version discovery can target a private PyPI-style index without changing the globalpipx.registry_url.registry_urlis read from tool options (overriding settings) and drives remote version listing,latestresolution, and exact-version validation for PyPI packages.remote_version_cache_contextand the latest-version cache are keyed by registry URL so two tools with different registries do not share cached version data.Install-time index behavior is unchanged:
uvx_args/pipx_argsstill control how pip/uv install packages. Documentation inpipx.mddescribes the new option and how it pairs with those args.New integration tests use mock HTTP servers to verify per-tool latest resolution and isolated remote-version caches.
Reviewed by Cursor Bugbot for commit 78deea6. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Documentation