For real though, this looks interesting. I am a long time poetry user, I’ve been mostly happy with it but I do think it could stand to be a little faster. I’ll have to try this out sometime.
What’s that mean, like they aim to become a drop-in replacement for poetry too? Or make uv able to work with a poetry-style pyproject.toml? I couldn’t find any info about that.
uv is fantastic. I would highly recommend it. I've used it in a quite complex environment, with no issues (quite an achievement!) and it's about 10x faster than pip.
I mean... I guess it's not surprising given uv is written in Rust and pip is written in Python, but even so given pip is surely IO bound I was expecting something like 4x improvement. 10x is impressive.
The actual dependency resolution part, so where you figure out which versions of the dependencies can be used together, is actually notoriously CPU-bound.
At least as far as I'm aware, you generally use a SAT solver for dependency resolution (unless you don't care for correctness), and as Wikipedia puts it:
Boolean satisfiability is an NP-complete problem in general. As a result, only algorithms with exponential worst-case complexity are known.
There are quite sophisticated algorithms at this point, making use of heuristics and whatnot, but they're still just backtracking algorithms at their core. And as Wikipedia puts it so fittingly again:
backtracking is often much faster than brute-force enumeration
You know shit's inefficient, when the best thing to compare it to, is just randomly trying solutions.
Interestingly, dependency resolution is not the only NP hard problem uv tries to solve. During development, it also became clear that we needed some way to simplify PEP 508 marker expressions and ask questions like, "are these marker expressions disjoint?"
you generally use a SAT solver for dependency resolution (unless you don’t care for correctness)
Actually Go's dependency system is specifically designed to avoid the need for global constraint solvers. Go has the most modern and elegant dependency versioning system that I'm aware of. Python was designed before people realised that it's dependency style was a mistake.
uv is now capable of installing and managing Python itself, making it entirely self-bootstrapping:
Looking forward to this. One of the blind spots of poetry was to ignore the issue of managing python versions themselves. I'm happy to see they're covering so many aspects of dependency management and replicability.
Having used it for work, I really don't understand the appeal, especially when compared to tools like Poetry. Uv persists in the dependency on requirements.txt, doesn't streamline the publishing process, and contrary to the claims, it's not a drop-in replacement for pip, as the command line API is different.
It's really fast, which is nice if you're working on a nightmare codebase with 3000 dependencies, but most of us aren't, and Poetry is pretty damned fast.
If uv offered some of what Poetry does for me, if at the very least we could finally do away with requirements.txt and adopt something more useable -- baked into pyproject.toml of course -- then I'd be sold. But this is just faster pip.
definitely not the real reason for a project like this to exist. Python package management can be nightmarish at times depending on what you’re doing. between barebones requirements.txt, Poetry, and the different condas there’s a ton of fragmentation, and none of them do everything you’d want in an ideal way. above and beyond speed, i think uv is another attempt at it. but it could just be another classic xkcd moment where now there’s just another standard to deal with
uv is a drop-in replacement for pip. There's no extra standard. It's pareto better. Honestly the Python community would do the world a favour if the deprecated pip and adopted uv as the official tool, but you can guess how likely that is...
Yes. For the project I work on pip install takes about 60 seconds and replacing it with uv reduces that to about 7 seconds. That's a very significant improvement. Much less annoying interactively and in CI we do this multiple times so it saves a significant chunk of time.
Python package management, especially at scale is infuriating. At work we use python microservices in docker containers and it infuriates me trying to update the one our team is responsible for.
I always like to rant that python 3rd party package management tools are a mistake. We should've gone for an "as simple as possible" setup instead of all this.
So I'm sceptical of UV on principle since it's yet another 3rd party package manager but if it can do all of this and not be a nightmare I'll be ok with it.
Very impressive results. I think I’ll give the tool a try next time we’re working on a small project. I’m dissatisfied with the existing packaging solutions.
Isn't uv being used as a package manager/resolver in rye? I'm using rye for my new projects and it's nice because ruff and pytest are being unified in it too.