"but really, what's so good about uv???"
background: uv
is fast pip
(more like cargo
) in rust
I can't tell you how many times I've seen this take so far
"ok its a bit faster, but pip isn't broken? blah blah xkcd 15 competing standards"
I try hard not to be a sensationalist - however at this point if you're still writing python for your job and saying these words, then I assume one of the following is true:
- you know better, and you just like being contrarian
- you are missing out bc you're too stubborn to check it out
- you don't value your time or want to put a stick in the spokes
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
to answer the question, I'll just show some examples:
Here's the entire set of commands necessary to run Flask in a fresh Ubuntu container. There are no hidden steps. It fits in a Tweet:
— Charlie Marsh (@charliermarsh) August 20, 2024
$ apt-get update && apt-get install -y curl
$ curl -LsSf https://t.co/kFTLdx5zAL | sh
$ source $HOME/.cargo/env
$ uvx flask --help
uv makes it so easy to go zero to MRE
say i find bug in foo==x.y.z, i can repro with:
uv run
--with foo==x.y.z
repro.pyRuntimeError: oh no!
test the branch with a fix:
uv run
--with foo@git+https://{giturl}.git@hotfix-foo
repro.py✅
just used this today!
github.com/pydantic/pyd...
— n8 (@alternatebuild.dev) November 20, 2024 at 9:28 PM
[image or embed]
If the minimal reproducible example is short enough you can take this a step further and not even need an extra file:
uv run --with 'foo==x.y.z' python -c ' import foo print("Thing that recreates the error")'
Gives you an example people can copy and paste directly into their shell from your issue!
— Simon Willison (@simonwillison.net) November 21, 2024 at 2:35 PM
[image or embed]
i mean, come on
p.s. this is a good article