n8's blog

"but really, what's so good about uv???"

note: i chronically write in hyperbole

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:

# 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"

do it now


to answer the question, I'll just show some examples:

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.py

RuntimeError: 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...

[image or embed]

— n8 (@alternatebuild.dev) November 20, 2024 at 9:28 PM

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!

[image or embed]

— Simon Willison (@simonwillison.net) November 21, 2024 at 2:35 PM

i mean, come on

p.s. this is a good article

#opinion #python #uv