-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print installation path when running uv pip install
#2155
Comments
Have you tried running with |
Yeah, indeed running with verbose prints this:
To me, this is not very easy to parse, and even find among the rest of the huge debug output. At least for the |
I've already been bitten multiple times by this, installing stuff in the wrong venv. with actual pip, it's not really an issue, because you are always using the pip from inside the virtualenv
A much more userfriendly output would be to include the path somewhere
|
So, I love the new more concise verbose output (-v), however, I will still lobby for As previous commenter pointed out, it's too easy to make a mistake and not notice it (e.g. forgetting to deactivate the environment, switch to different directory with its own .venv, and then running |
Considering starting by showing the path if it's not |
I think this would be really useful. I was just caught out by |
another separate, but related nicety would be printing out the
|
I think it'd be reasonable to start with this: #2155 (comment) |
Hi! I wanted to look into this - would it be a matter of updating the line in writeln!(
printer.stderr(),
"{}",
format!(
"Installed {} in {} to {}",
format!("{} package{}", wheels.len(), s).bold(),
elapsed(start.elapsed()),
venv.python_executable().display()
)
.dimmed()
)?; Based on the test results it looks correct (although it looks like we would need to update the snapshots)
|
We'd want to only display the path if it's not in the working directory which would require some sort of
before this message instead of adding to the end of it? |
Sure! I have something like this: let python_executable = venv.python_executable();
let venv_dir_canonical = fs::canonicalize(".venv").unwrap_or(PathBuf::from(".venv"));
let is_outside_working_directory = !(python_executable.starts_with(&venv_dir_canonical));
if is_outside_working_directory {
writeln!(
printer.stderr(),
"{}",
format!(
"Installing to environment at {}",
python_executable.user_display()
)
)?;
} I wasn't sure the best way to check for being in |
There are Should I print the path in every place or just at installing packages? |
I am trying to print the path at every place where some changes in packaging is occuring. |
Supersedes #4835 Closes #2155 e.g. ``` ❯ cargo run -q -- pip install --python ../../example httpx Using Python 3.12.1 environment at /Users/zb/example Resolved 7 packages in 561ms Prepared 4 packages in 62ms Installed 4 packages in 13ms + certifi==2024.8.30 + h11==0.14.0 + httpcore==1.0.5 + httpx==0.27.2 ❯ cargo run -q -- pip install httpx Resolved 7 packages in 17ms Installed 4 packages in 10ms + certifi==2024.8.30 + h11==0.14.0 + httpcore==1.0.5 + httpx==0.27.2 ```
Hey 👋
Small feature request: It would be great if
uv
printed the path where it is installing the packages when runninguv pip install
. I am currently debugging a weird issue in GHA while usinguv pip install --system
and it is not clear how to check where uv ends up installing stuff.The text was updated successfully, but these errors were encountered: