Live data from Hacker News

Uv overtakes pip in CI

wagtail.org

101–110 of 184 posts

Re: Uv overtakes pip in CI

#101
post #27
post #4

UV is super fast and great for environment management, however it's not at all well suited to a containerised environment, unless I'm missing something fundamental (unless you like using an env in your container that is).

> (unless you like using an env in your container that is). What's the problem with that? You just make your script's entry point be something like this: uv venv --clear uv sync uv run main.py

Doesn’t this mean pid 0 in the container is uv instead of python? Does uv run just spawn a child python process?

Re: Uv overtakes pip in CI

#102
post #29

Earlier quoted context omitted.

Honestly, I was skeptical when I learned about uv. I thought, just Python needs, another dependency manager… this was after fighting with pip, venv, venvwrapper, and poetry for years. Then I gave it a try and it just worked! It’s so much better that I immediately moved all my Python projects to it.

> I thought, just Python needs, another dependency manager… this was after fighting with pip, venv, venvwrapper, and poetry for years. Pip, venv and virtualenvwrapper (people still use this?) are not meaningfully "dependency managers". A venv is just a place to put things, and pip does only basic tracking and tries to maintain a consistent environment. It isn't trying to help you figure out what dependencies you need…

I actually did use virtualenvwrapper quite a bit until uv. I had built up various shell aliases and functions, so it was fairly painless to create and manage venvs. uv just means that I don’t have to think about that part now.

Re: Uv overtakes pip in CI

#103
post #97

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?

It really is just that good. That is why it's had such massive uptake. No matter how many times you've been burned before, no matter how skeptical you are, it's so good that, seriously, just try it, and you'll be instantly converted.

Ok, sold, I’ll try it.

Re: Uv overtakes pip in CI

#104
post #84

Earlier quoted context omitted.

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.

What’s more obnoxious is dismissing it as a rust fanboy conspiracy. Know what I like about it? `uv install .` with a few dozen top-level dependencies takes under a second on my machine. All the tools work as documented all the time. `uv run …` is nearly instant. Those are the reasons I like it. I couldn’t care less that it’s written in rust. It could be conjured from malbolge for all I care. It works as advertised, w…

I use golang, rust and c++ here and there, but majority of my time is spent working in Python projects. I'm not alien to the concept of speed and performance, especially the tooling around them.

While I like the idea of pip or uv to be insanely fast, I still don't see it revolutionize my development experience.

Installing and uninstalling package is not something I do every 1 to 10 minutes. It doesn't save me any much time. Also, activating a venv is once a session in terminal and sometime a week goes by without ever activating a venv, because the IDE does that automatically on whatever I do.

That's why, personally for me it really doesn't change much.

Where I like things being fast in my development time is pre-commit and linting, where ruff shines. Which that I also don't use, even though I work on a small-medium 600k LoC project, I only pass the changed files to isort, flake8 and black and it's all done in less than 5 seconds.

To me, the only advantage of uv is being fast, which is something I haven't been bothered with so far, where 99% of things happen in less than 1 or max couple of seconds.

Re: Uv overtakes pip in CI

#105
post #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.

What criticism do you have of it?

Re: Uv overtakes pip in CI

#106
post #40

This shouldn’t be a surprise to anyone who has been using Python and has tried uv. Python dependency management and environments have been a pain for 15 years. Poetry was nice but slow and sometimes difficult. Uv is lightning fast and damn easy to use. It’s so functional and simple.

I’ll bite - I could care less about speed, that feels like a talking point I see often repeated despite other package managers not being particularly slow. Maybe there’s some workload I’m missing that this is more important for? I’ve tried uv a couple places where it’s been forced on me, and it didn’t work for whatever reason. I know thats anecdotal and I’m sure it mostly works, but it obviously was off putting. For…

> I have a feeling this is some kind of Rust fan thing and that’s where the push comes from, to try and insinuate it into more people’s workflows.

When I first started using uv, I did not know what language it was written in; it was a good tool which worked far better than its predecessors (and I used pdm/pipenv/pyenv/etc. pretty heavily and in non-basic ways). I still don’t particularly care if it’s written in Rust or Brainfuck, it works well. Rust is just a way to get to “don’t bootstrap Python environments in Python or shell”.

> I’ve tried uv a couple places where it’s been forced on me, and it didn’t work for whatever reason.

I’m curious what issues you encountered. Were these bugs/failures of uv, issues using it in a specific environment, or workflow patterns that it didn’t support? Or something else entirely?

Re: Uv overtakes pip in CI

#107
post #100

This shouldn’t be a surprise to anyone who has been using Python and has tried uv. Python dependency management and environments have been a pain for 15 years. Poetry was nice but slow and sometimes difficult. Uv is lightning fast and damn easy to use. It’s so functional and simple.

It’s a little too fast, I’m having trouble believing it’s actually doing anything sometimes.

uv is so over-the-top fast compared to what we're used to that I would argue it's actually bad for the language. Suddenly it dawns on you that by far the most capable and performant package manager (and linter) (and code formatter) (and type checker) for Python is in fact not written in Python. Leaves an odd taste. Makes you wonder what else ought not be written in Python ... or why anything should be written in Python. Here be dragons ...

Re: Uv overtakes pip in CI

#108
post #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`

I feel like the new terminology matches what it's doing better, though. You don't install things anymore, uv just makes the state of the world match what you asked for.

Re: Uv overtakes pip in CI

#109
post #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.

Yeah, but it sold itself on its merrits. That is the point. Maybe venv and pip works fine for some toy projects that are deployed on the developer controlled OS without regular dependency updates, but let me assure you I had hours of fights with updating python services with complex needs on Debian boxes from various ages while ensuring whst I ran as a dev is the stuff that is guaranteed to run in production.

With uv it just works and that in a fraction of the time. Where before updates would mean to mentally prepare that a thing that should take 5 seconds in the best and 15 minutes in the worst case could occupy my whole day, it has now become very predictable.

I don't care what it is written in. It works. If you think people love it because it was written in some language it just means you never had a job where what uv brings was really needed and thus you can't really judge its usefulness.

Re: Uv overtakes pip in CI

#110
post #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.

I'm not a Rustacean, but I'll tell you what merited me installing uv (via its MacPorts package) last week.

I had decided to do something via a one-off Python script. I wanted to use some Python packages for the script (like `progressbar2`). I decided to use Inline Script Metadata[0], so I could include the package dependencies at the top of the script.

I'm not using pipenv or poetry right now, and decided to give uv a try for this. So I did a `sudo port install uv`, followed by a `uv run myscript.py --arguments`. It worked fine, making & managing a venv somewhere. As I developed the script, adding & changing dependencies, the `uv run …` installed things as needed.

After everything was done, cleanup was via `uv cache clean`.

Will I immediately go and replace everything with uv? No. As I mentioned in another post, I'll probably next look at using uv in my CI runs. But I don't feel any need to rush.

[0]: https://packaging.python.org/en/latest/specifications/inline...

Post reply on HN