←back to thread

/usr/bin/env -S uv run

(simonwillison.net)
117 points jcbhmr | 2 comments | | HN request time: 0.422s | source
Show context
mrweasel ◴[] No.42202316[source]
While neat, doesn't it also comes with certain issues?

Startup times has to be slower, but probably only for the first run?

There's a some level of violation of the "Principle Of Least Surprise", depending on the setting. For some it will be the reverse, the script they got just works, without any setup or package installation. For others we'll wonder why it just started downloading a bunch of packages we already have.

Probably not the greatest idea for production environments, where you should not or can not just pull in packages from the internet.

It's really cool that it works, but I think I'd recommended using it highly selectively.

replies(3): >>42202633 #>>42202803 #>>42202806 #
1. chippiewill ◴[] No.42202803[source]
> but probably only for the first run?

It's slow on every run because it has to build the python virtual environment every time, even if it's cached all the packages

replies(1): >>42204564 #
2. simonw ◴[] No.42204564[source]
If you benchmark that you'll find uv spends microseconds getting the virtual environment up and running - that's its USP, they've invested a huge amount of work and ingenuity into making virtual environments so fast to create that you no longer have to think about that.

(Mainly through tricks involving hard links)