Live data from Hacker News

Uv is the best thing to happen to the Python ecosystem in a decade

emily.space

571–580 of 1001 posts

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#571

Earlier quoted context omitted.

> you should just use virtualenv with pip This is the most insulting take in the ongoing ruination of Python. You used to be able to avoid virtualenvs and install scripts and dependencies directly runnable from any shell. Now you get endlessly chastised for trying to use Python as a general purpose utility. Debian was a bastion of sanity with the split between dist_packages and site_packages but that's ruined now too…

it's because so many essential system tools now rely on python, and if you install arbitrary code outside of a venv it can clobber the global namespace and break the core OS' guarantees. I do agree it is annoying, and what they need to do is just provide an automatic "userspace" virtualenv for anything a user installs themselves... but that is a pandoras box tbh. (Do you do it per user? How does the user become aware…

That couldn't happen with Debian's dist_packages which was explicitly for the the system tools managed by apt.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#572
post #541
post #520

Earlier quoted context omitted.

On performance: 3.13 removed the GIL and added experimental first-party JIT (like PyPy). In two years I bet we’ll be seeing v8 level performance out of CPython.

The “Faster CPython” team were let go from Microsoft because they could only produce a 1.5x speedup in four years instead of the planned 5x. It’s wildly optimistic to now expect a 10x speedup in two years, with fewer resources.

Depends if they are the right resources.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#573

Earlier quoted context omitted.

Never underestimate cultural momentum I guess. NBA players shot long 2 pointers for decades before people realized 3 > 2. Doctors refused to wash their hands before doing procedures. There’s so many things that seem obvious in retrospect but took a long time to become accepted

They did wash their hands. Turns out that soap and water wasn't quite enough. Lister used carbolic acid (for dressing and wound cleaning) and Semmelweis used chlorinated lime (for hand washing).

And Semmelweis is a perfect case against being an asshole who's right: He was more right than wrong (he didn't fully understand why what he was doing helped, but it did) but he was such a horrible personality and such an amazing gift for pissing people off it probably cost lives by delaying the uptake of his ideas.

But this is getting a bit off topic, I suppose.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#574
post #21

I must be the odd man out but I am not a fan of uv. 1. It tries to do too many things. Please just do one thing and do it well. It's simultaneously trying to replace pip, pyenv, virtualenv, and ruff in one command. 2. You end up needing to use `uv pip` so it's not even a full replacement for pip. 3. It does not play well with Docker. 4. It adds more complexity. You end up needing to understand all of these new enviro…

oh look, the average golang fan. here’s a challenge for you: explain _why_ the complexity is bad without:

- resorting to logical fallacies, or

- relying on your unstated assumption that all complexity is bad

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#576
post #445

For single-file Python scripts, which 99% of mine seem to be, you can simplify your life immensely by just putting this at the top of the script: #!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.11" # dependencies = [ "modules", "here" ] # /// The script now works like a standalone executable, and uv will magically install and use the specified modules.

> The script now works like a standalone executable But whoever runs this has to install uv first, so not really standalone.

This is a PEP and not specific to uv: https://peps.python.org/pep-0723/

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#577

Earlier quoted context omitted.

Webdev since 1998 here. Tabling the python vs JS/etc to comment on npm per se. PNPM is better than npm in every way. Strongest possible recommendation to use it instead of npm; it's faster, more efficient, safer, and more deterministic. See https://pnpm.io/motivation

Deno is pretty sweet too... shell scripts that don't need a package.json or a node_modules directory for dependencies.

Yeah, Deno 2 is pretty compelling.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#578
I’m surprised not to see a discussion of the biggest drawback: despite being fewer characters, “uv” is harder to type than “pip”. It requires two different hands to participate and a longer reach with my left index finger. pip is convenient – just a little rattle off with my right hand.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#579
post #46

For single-file Python scripts, which 99% of mine seem to be, you can simplify your life immensely by just putting this at the top of the script: #!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.11" # dependencies = [ "modules", "here" ] # /// The script now works like a standalone executable, and uv will magically install and use the specified modules.

> uv will magically install and use the specified modules. As long as you have internet access, and whatever repository it's drawing from is online, and you may get different version of python each time, ...

You can specify python version requirements in the comment, as the standard describes
Post reply on HN