Would the authors not have been better off adding their performance improvements to pip rather than creating their own tool? I remember this being a complaint from Node maintainers when Bun was released: they had multiple open performance-related issues with no one available to work on them.
uv isn't a performance improvement on pip but a ground-up rewrite in a completely different language.
Uv saves Home Assistant 215 compute hours per month
51–60 of 60 posts
Re: Uv saves Home Assistant 215 compute hours per month
#52Earlier quoted context omitted.
Yeah but I suspect there’s something more going on than Rust magic. They’re claiming a savings of about an hour and a half. (4% of the original time) That sounds like an architecture change, or more likely a whole lot of caching.
If the first step of your build process is creating a new pip venv from scratch, it's entirely believable to me. Pip resolves packages sequentially, so there's a lot of low hanging fruit even without yoinking a state of the art constraint solver. As a concrete example, I have a raspberry pi 4 I use for "what's the most pathetic hardware a user might try". It takes 5-10 minutes to build up a fresh venv even when it ha…
Re: Uv saves Home Assistant 215 compute hours per month
#53Earlier quoted context omitted.
Rust, the language, has rather successfully worked towards and demonstrated that, in many areas, you CAN have your pie and eat it too. But that doesn't carry over to applications, where it must be demonstrated again.
I’m doubtful the fact that uv is written in rust is directly responsible for the speed increase, it’s probably just a better dependency determination algorthm. Stop talking about fancy pies, you don’t need it even if it smells nice. What you actually need is to eat healthy and nutritious foods.
Re: Uv saves Home Assistant 215 compute hours per month
#54Earlier quoted context omitted.
I’m guessing “rewrite it in Rust” would have been an unpalatable PR for the pip maintainers to merge.
Yeah but I suspect there’s something more going on than Rust magic. They’re claiming a savings of about an hour and a half. (4% of the original time) That sounds like an architecture change, or more likely a whole lot of caching.
Re: Uv saves Home Assistant 215 compute hours per month
#55I'm going to ask a stupid question, but why not just keep the packages installed?
Re: Uv saves Home Assistant 215 compute hours per month
#56Earlier quoted context omitted.
If the first step of your build process is creating a new pip venv from scratch, it's entirely believable to me. Pip resolves packages sequentially, so there's a lot of low hanging fruit even without yoinking a state of the art constraint solver. As a concrete example, I have a raspberry pi 4 I use for "what's the most pathetic hardware a user might try". It takes 5-10 minutes to build up a fresh venv even when it ha…
Is that on a SD card? My expectation is that SD cards are garbage and any number of IO access patterns break down vs a SSD.
Re: Uv saves Home Assistant 215 compute hours per month
#57Re: Uv saves Home Assistant 215 compute hours per month
#58I guess I don't have enough context to really understand this. It takes 1.5 hours to calculate what dependencies Home Assistant needs? Wouldn't you normally amortize that out for each top-level dependency you add to the project and write it to a lock file or something, so that builds just become fetching the relevant artifacts? Even then, I'm not sure how it would take 1.5 hours even on pen and paper.
Plain pip doesn't really have a lockfile. You can generate a freeze file, but that's something different in practice.
I haven't really been in the Python ecosystem in several years, but my surprise was mostly how there was no mention of Poetry or pipenv. Didn't they address that need before? Are they already out of favor?
Re: Uv saves Home Assistant 215 compute hours per month
#59Getting to a consensus is hard work. They have a vision for how Python packaging and tooling could be better (I assume cargo-like), and a roadmap for improving that. They could have tried to convince the pip maintainers their roadmap was best, but with large fragmented communities like Python it is impossible to reason about how the community will receive changes to tooling. It’s better to build something and get feedback to prove the hypothesis.
The choice of Rust is just because they like the developer ergonomics in that language (I suspect a big reason is that they wanted to ship a single binary independent of any Python env). CPython is written in C because… Guido started to write it in C.
Many comments here don’t understand that their competitors are actually NOT just pip but the conda ecosystem including micromamba (written in C++) which does not attempt to maintain pip interop at all. Conda realized that there are millions of Python programmers who are not developers and could not debug a GCC error message when pip installing scipy.
There are thousands of Python packages that are basically tested on whatever version of Python and libraries the author had installed at the time they wrote it, and literally millions of Github issues that are something like “this doesn’t work because I installed version Y of package X and package Z requires If you haven’t lost days of work to solving stupid dependency issues in Python I’m not sure you can relate.
Re: Uv saves Home Assistant 215 compute hours per month
#60I guess I don't have enough context to really understand this. It takes 1.5 hours to calculate what dependencies Home Assistant needs? Wouldn't you normally amortize that out for each top-level dependency you add to the project and write it to a lock file or something, so that builds just become fetching the relevant artifacts? Even then, I'm not sure how it would take 1.5 hours even on pen and paper.
> Wouldn't you normally amortize that out for each top-level dependency you add to the project and write it to a lock file or something Plain pip doesn't really have a lockfile. You can generate a freeze file, but that's something different in practice. I haven't really been in the Python ecosystem in several years, but my surprise was mostly how there was no mention of Poetry or pipenv. Didn't they address that need…
uv looks like a good and fast replacement for pip or venv-update but those only take a fraction of a second to run (on a noop, my main use case) so I personally haven't seen where uv would fit in my workflow yet. Maybe building in containers from scratch each time, though again pip is performant enough for me when not doing the hard work of dependency resolution, and for some reason it's not cached.
I am not sure why dependency resolution outside of dev or build systems would be done. But maybe I have escaped the loop.