Live data from Hacker News

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

emily.space

511–520 of 1001 posts

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

#511

Earlier quoted context omitted.

The article shows some advantages compared to plain virtual environments: In principle, you can ‘activate’ this new virtual environment like any typical virtual environment that you may have seen in other tools, but the most ‘uv-onic’ way to use uv is simply to prepend any command with uv run. This command automatically picks up the correct virtual environment for you and runs your command with it. For instance, to r…

> The article shows some advantages compared to plain virtual environments No; they are plain virtual environments. There is no special kind of virtual environment. Uv simply offers its own command structure for managing those environments. In particular, `uv run` just ensures a venv in a specific location, then uses it. There is no requirement to activate virtual environments in order to use them (unless you have so…

Sorry, you're right I should have said "plain venv", as in the program.

`uv run` will also sync the environment to be sure it exists and meets the correct specifications.

But yes, it's optional. You can also just do `uv sync` to sync the environment and then activate it like normal.

Or use `uv venv`, `uv pip` commands and just take the speed advantage.

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

#512

I gotta say, I feel pretty vindicated after hearing for years how Python’s tooling was just fine and you should just use virtualenv with pip and how JS must be worse, that when Python devs finally get a taste of npm/cargo/bundler in their ecosystem, they freaking love it. Because yes, npm has its issues but lock files and consistent installs are amazing

Why did it take this long? Why did so many prior solutions ultimately fall flat after years and years of attempts? Was Python package/environment management such a hard problem that only VC money could have fixed it?

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

#513

Earlier quoted context omitted.

There is nothing I dread more within the general context of software development, broadly , than trying to run other people's Python projects. Nothing. It's shocking that it has been so bad for so long.

Same! And Python was my first, and is currently my second-highest-skill language. If someone's software's installation involves Python, I move on without trying. It used to be that it would require a Python 2 interpreter. Honorable mention: Compiling someone else's C code. Come on; C compiles to a binary; don't make the user compile.

> Honorable mention: Compiling someone else's C code. Come on; C compiles to a binary; don't make the user compile.

Unless you’re on a different architecture, then having the source code is much more useful.

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

#515
post #483

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

People paid 100x more for their hosting when using aws cloud until they realized they never neded 99.97% uptime for their t-shirt business. Oh wait too soon. Save for post for the future.

People spent half their job figuring out self hosted infrastructure until they realized they rather just have some other company deploy their website when they make a commit.

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

#516
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…

Yeah, I find that I like to use uv for one thing, quickly/efficiently getting a Python into a new venv for some project. A la:

  uv venv ~/.venvs/my_new_project --python 3.13
  source ~/.venvs/my_new_project/bin/activate
  python3 -m ensurepip --upgrade
  cp -r /path/from/source/* .
  python3 -m pip install -r requirements.txt
So here uv installs the Python version wanted. But it's just a venv. And we pip install using requirements.txt, like normal, within that venv.

Someone, please tell me what's wrong with this. To me, this seems much less complicated that some uv-centric .toml config file, plus some uv-centric commands for more kinds of actions.

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

#517
Uv is so good. I'm a curmudgeon about adopting new tooling, and tried uv with a lot of skepticism, but it was just better in every way. And even if it wasn't so polished and reliable, the raw speed makes it hard to go back to any other tool.

Uv combined with type hints reaching critical mass in the Python ecosystem, and how solid PyLance is in VSCode, feels so good it has made me consider investing in Python as my primary language for everything. But then I remember that Python is dog slow compared to other languages with comparable ergonomics and first-class support for static typing, and...idk it's a tough sell.

I know the performance meta in Python is to...not use python (bind to C, Rust, JVM) - and you can get pretty far with that (see: uv), but I'd rather spend my limited time building expertise in a language that isn't constantly hemorrhaging resources unless your code secretly calls something written in another language :/

There are so many good language options available today that compete. Python has become dominant in certain domains though, so you might not have a choice - which makes me grateful for these big steps forward in improving the tooling and ecosystem.

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

#518
post #88
post #58

I hadn't paid any attention to rust before uv, but since starting to use uv, I've switched a lot of my performance-sensitive code dev to rust (with interfaces to python). These sorts of improvements really do improve my quality of life significantly. My hope is that conda goes away completely. I run an ML cluster and we have multi-gigabyte conda directories and researchers who can't reproduce anything because just to…

You might be interested in pixi, which is roughly to conda as uv is to pip (also written in Rust, it reuses the uv solver for PyPI packages)

Pixi is what FreeCAD is now using. (Along with Rattler).

It makes building FreeCAD pretty trivial, which is a huge deal considering FreeCAD’s really complex Python and non-python, cross-platform dependencies.

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

#519

Earlier quoted context omitted.

There is nothing I dread more within the general context of software development, broadly , than trying to run other people's Python projects. Nothing. It's shocking that it has been so bad for so long.

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

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

#520

Uv is so good. I'm a curmudgeon about adopting new tooling, and tried uv with a lot of skepticism, but it was just better in every way. And even if it wasn't so polished and reliable, the raw speed makes it hard to go back to any other tool. Uv combined with type hints reaching critical mass in the Python ecosystem, and how solid PyLance is in VSCode, feels so good it has made me consider investing in Python as my pr…

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.

Post reply on HN