astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.6k stars 609 forks source link

`--python` should be allowed before command #3704

Open thejcannon opened 4 months ago

thejcannon commented 4 months ago

I'm writing some tests that ensure my funky build backend works for several build frontends (uv and pip).

I make a venv, and want to point uv and pip to it, however they currently disagree:

uv wants it after the command:

$ uv pip --python foo install bar
error: unexpected argument '--python' found

  tip: 'install --python' exists

Usage: uv pip [OPTIONS] <COMMAND>

For more information, try '--help'.

pip wants it before the command:

$ pip install --python foo bar
ERROR: The --python option must be placed before the pip subcommand name

I just want to the pain to stop:

$ make it-stop
make: *** No rule to make target `it-stop'.  Stop.
zanieb commented 4 months ago

Thanks for the report. --python isn't currently treated as a "global" pip flag. We might be able to change it.. but we'll need to make sure all the pip sub-commands support it the same way.

charliermarsh commented 3 months ago

We'll ship this in v0.3.0. It requires changing the -p specifier on uv pip compile.