Fall back to pip when external uv fails to install uv into penv#387
Conversation
When external uv is available but fails to install uv into the penv (e.g. due to transient network errors), fall through to the pip installation path instead of returning False and aborting the build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
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 Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR modifies the uv installation flow in the Python environment setup process. It now attempts external uv installation first, then gracefully falls back to pip-based installation if that fails, while simplifying error handling logic by consolidating specific exceptions into a broader fallback mechanism. Changes
Sequence DiagramsequenceDiagram
participant Installer as Installation Flow
participant ExtUV as External uv Executable
participant Pip as pip (Fallback)
participant Penv as Python Environment
Installer->>ExtUV: Attempt to install uv externally
alt External uv Installation Succeeds
ExtUV-->>Installer: Success
Installer->>Penv: Mark uv_in_penv_available = True
else External uv Installation Fails
ExtUV-->>Installer: Error
Installer->>Pip: Fall back to pip-based installation
Pip->>Penv: Install uv via pip
Pip-->>Installer: Installation complete
Installer->>Penv: Mark uv_in_penv_available (based on outcome)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
|
It is worth trying pip if uv fails, easy to fallback to pip |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Added a warning message for failed external uv installation.
|
Thx. Overlooked it was designed to act like that. |
|
Thanks! |
Summary
if/elseto two sequential attempts: try external uv first, on any failure silently fall back to pipSummary by CodeRabbit