Live data from Hacker News

Uv overtakes pip in CI

wagtail.org

81–90 of 184 posts

Re: Uv overtakes pip in CI

#81
post #21
post #9

Earlier quoted context omitted.

for me the surprise is the pace? I’d expect people to be more set in their tools that it takes longer than a few months for a new tool, no matter how good, to become the majority use one. Though perhaps people adopt new tools more easily in CI where install times matter more

I think it’s been long enough now. Uv just has so much velocity. Pyproject.toml and pep support just keeps getting better. Poetry which I think is the closest analogue, still requires a [tool.poetry.depenencies] section afaik.

Yep. Poetry was such a delightful upgrade from pipenv, which we’d tested as an upgrade from bare pip, which didn’t have a dependency resolver at the time. If someone’s already fully bought in on poetry, that’d be the one case where I could plausibly imagine them wanting to leave well enough alone.

For everyone else, just try uv and don’t look back.

Re: Uv overtakes pip in CI

#82

Earlier quoted context omitted.

Is this like when everyone on here had already been saying Yarn was a no-brainer replacement for npm, having totally obsoleted it, for like two-plus years, but it was still lacking safety/sanity checks, missing features, and broke in bizarre ways on lots of packages in-the-wild? Or is the superior replacement actually up to the job this time?

I’m certain there’s going to be so bizarre edge case where pip is fine and uv isn’t. It’s inevitable. However, in every situation where I’ve used it, pip is better than pip or poetry or any other package manager I’ve ever used. I just found out they’re still making pipenv. Yes, if you’re using pipenv, I’m confident that uv will be a better experience in every way, except maybe “I like using pipenv so I can take long…

Yeah, I’m just skeptical because I was at an agency in the heat of yarn-mania, waaaay after people online were proclaiming npm dead and pointless, and it went poorly enough that we developed a ha-ha-only-serious joke that you knew a project was properly in-development when someone had lost a half-day debugging some really weird error only to find that “npm install” instantly fixed it, and then switched the started-in-yarn codebase over to npm.

Re: Uv overtakes pip in CI

#83
The Astral team did a great job with uv (and ruff!). I just wish they had used `install` instead of `add` and `sync`.

`uv install` = `uv sync`

`uv install rich` = `uv add rich`

Re: Uv overtakes pip in CI

#84
post #63

I seriously still don't know why I should use "uv". I just create my .venv and pip install. Rarely I'd need a different version of python, in case I do, either I let the IDE to take care of it or just do pyenv. I know there's the argument of being fast with uv, but most of the time, the actual downloading is the slowest part. I'm not sure how big a project should be, before I feel pip is slow for me. Currently, I hav…

If it sold itself on its merits I don’t think we’d see all these fawning posts about it. It’s a Rust fan thing. You can see how any criticism gets treated. I’m sure it works for some people and obviously if it does, then great. But it’s got this same weird cult following and pretend talk of speed that lots of Rust stuff has. It’s getting a little tiring. If you like it, use it, evangelizing is obnoxious.

Re: Uv overtakes pip in CI

#85
post #58

Earlier quoted context omitted.

Python 2.0 was released in October 2000. The Python ecosystem has witnessed several significant shifts in expectation as far as how software is built and delivered, from Slackware-style source builds to vendor packages to containers to uv just downloading a standalone binary archive. And the deadsnakes ppa and venvs, plus the ongoing awkwardness about whether pip should be writing stuff into usr/local or ~/.local or…

> the deadsnakes ppa Please don't use this. You need to be careful about how you place any secondary installation of Python on Ubuntu. Meanwhile, it's easy to build from source on Ubuntu and you can easily control its destination this way (by setting a prefix when you ./configure, and using make altinstall) and keep it out of Apt's way. > and venvs, plus the ongoing awkwardness about whether pip should be writing stu…

> Meanwhile, it's easy to build from source on Ubuntu and you can easily control its destination this way

word of warning: I spent a lot of years working off of "built from source" Python on Ubuntu and every once in a while I'd have really awkward issues downstream of me not realizing I was missing some lib when I built Python and then some random standard library was just missing for me.

I think it's all generally good, but real easy to miss optional package stuff.

Re: Uv overtakes pip in CI

#86
post #63

I seriously still don't know why I should use "uv". I just create my .venv and pip install. Rarely I'd need a different version of python, in case I do, either I let the IDE to take care of it or just do pyenv. I know there's the argument of being fast with uv, but most of the time, the actual downloading is the slowest part. I'm not sure how big a project should be, before I feel pip is slow for me. Currently, I hav…

TBH I feel the same. And for development on my laptop, that seems fine. For the Python package I'm working on how, a single run of pytest takes less than five seconds.

Where things get annoying is when I push to GitHub and Tox runs through GitHub Actions. I've set up parallel runs for each Python version, but the "Prepare Tox" step (which is where Python packages are downloaded & installed) can take up to 3 minutes, where the "Run Tox" step (which is where pytest runs) takes 1½ minutes.

GitHub Actions has a much better network connection than me, but the free worker VMs are much slower. That is where I would look at making a change, continuing to use pip locally but using uv in GitHub Actions.

Re: Uv overtakes pip in CI

#87
post #68
post #57

Earlier quoted context omitted.

The place where speed really matters is in virtual environment management. uv uses some very neat tricks involving hard links such that if you start a new uv-managed virtual environment and install packages into it that you've used previously, the packages are symlinked in. This means the new environment becomes usable almost instantly and you don't end up wasting filesystem space on a bunch of duplicate files. This…

Ooooh that's a neat one. I really like the hard links. On my machine, there are like 100s of not thousands of venvs. I simply have all of them under ~/.python_venvs/ / Does that mean, no matter how many projects I install pytorch and tensoflow and huggingface and all the heavy machinery, they'll be counted only once as long as they're unique? If that's the case, then I can leave my habit of pip and move to uv. This i…

"Does that mean, no matter how many projects I install pytorch and tensoflow and huggingface and all the heavy machinery, they'll be counted only once as long as they're unique?"

I think so, based on my understanding of how this all works. You may end up with different copies for different Python versions, but it should still save you a ton of space.

Re: Uv overtakes pip in CI

#89
post #76
post #61

Earlier quoted context omitted.

Many would say that's the problem; i.e. that he should have had more impact. Check out the history of Conda.

right but "BDFL left" is clearly the wrong thing to blame when "BDFL never cared enough" so it doesnt matter if he left

That’s right. And we switched from eggs to wheel’s on Guido’s watch, but that was from him being a good leader and letting other smart people do clever things on their own.

Re: Uv overtakes pip in CI

#90
post #79
post #63

I seriously still don't know why I should use "uv". I just create my .venv and pip install. Rarely I'd need a different version of python, in case I do, either I let the IDE to take care of it or just do pyenv. I know there's the argument of being fast with uv, but most of the time, the actual downloading is the slowest part. I'm not sure how big a project should be, before I feel pip is slow for me. Currently, I hav…

There's a swarm on HN that upvotes anything uv related and downvotes anything questioning it's added value as compared to pip

Yes, that's a shame.

I noticed the comment from andy99 got several downvotes (became grey) and mine here also immediately got some.

Post reply on HN