From 8e37625005acbf7683ccf63bd5d93b422be72b96 Mon Sep 17 00:00:00 2001
From: Paul Moore
Date: Tue, 16 Apr 2024 19:39:37 +0100
Subject: [PATCH] Allow passing a venv to `uv pip --python` (#3064)
Fixes https://github.com/astral-sh/uv/issues/3060
## Summary
Allows passing a virtual environment (the path to the directory, rather
than the path to the Python interpreter within the directory) to the
`--python` option of the `uv pip` command.
## Test Plan
Tested manually to confirm that the expected new functionality works.
The test suite still passes after this change.
I don't know how to add tests for a new feature like this. I would be
happy to do so if someone can give me some pointers on how to do it.
---
crates/uv-interpreter/src/find_python.rs | 70 +++++++++++++++---------
1 file changed, 43 insertions(+), 27 deletions(-)
diff --git a/crates/uv-interpreter/src/find_python.rs b/crates/uv-interpreter/src/find_python.rs
index 0acc5b557..c24b58b7b 100644
--- a/crates/uv-interpreter/src/find_python.rs
+++ b/crates/uv-interpreter/src/find_python.rs
@@ -43,16 +43,35 @@ pub fn find_requested_python(request: &str, cache: &Cache) -> Result