Live data from Hacker News

A year of uv: pros, cons, and should you migrate

bitecode.dev

301–310 of 401 posts

Re: A year of uv: pros, cons, and should you migrate

#301

I am a casual python user, and for that I love uv. Something I haven't quite figured out yet is integration with the pyright lsp - when I edit random projects in neovim, any imports have red squiggles. Does anyone know of a good way to resolve imports for the lsp via uv?

You probably need to make sure you have the correct python version set. By default it is in the .venv directory with uv

Re: A year of uv: pros, cons, and should you migrate

#302
post #223

Earlier quoted context omitted.

> Honest question: is uv more reproducible/portable than cramming your Python project into a Docker container? Yes (unless you use uv in your Dockerfile). I mean, a Docker container will freeze one set of dependencies, but as soon as you change one dependency you've got to run your Dockerfile again and will end up with completely different versions of all your transitive dependencies.

People used pip-tools for this prior to uv (uv also replaces pip-tools).

I've literally never heard of that until just now, and I've heard of a lot of Python packaging tools.

Re: A year of uv: pros, cons, and should you migrate

#303

Like so many other articles that make some offhand remarks about conda, this article raves about a bunch of "new" features that conda has had for years. > Being independent from Python bootstrapping Yep, conda. > Being capable of installing and running Python in one unified congruent way across all situations and platforms. Yep, conda. > Having a very strong dependency resolver. Yep, conda (or mamba). The main thing…

Good to see you again. >Like so many other articles that make some offhand remarks about conda, this article raves about a bunch of "new" features that conda has had for years. Agreed. (I'm also tired of seeing advances like PEP 723 attributed to uv, or uv's benefits being attributed to it being written in Rust, or at least to it not being written in Python , in cases where that doesn't really hold up to scrutiny.) >…

> I still haven't found anything that requires packages to contain any Python code (aside from any build system configuration). In principle you can make a wheel today that just...

Ah, I forgot the best illustration of this: uv itself is available this way - and you can trivially install it with Pipx as a result. (I actually did this a while back, and forgot about it until I wanted to test venv creation for another comment...)

Re: A year of uv: pros, cons, and should you migrate

#304
post #106

Earlier quoted context omitted.

Maybe I'm missing something, but why wouldn't you just pin to an exact version of `requests` (or whatever) instead? I think that would be equivalent in practice to limiting resolutions by release date, except that it would express your intent directly ("resolve these known working things") rather than indirectly ("resolve things from when I know they worked").

Pinning deps is a good thing, but it won't necessarily solve the issue of transitive dependencies (ie: the dependencies of requests itself for example), which will not be pinned themselves, given you don't have a lock file. To be clear, a lock file is strictly the better option—but for single file scripts it's a bit overkill.

I'm not a python packaging expert or anything but an issue I run into with lock files is they can become machine dependent (for example different flavors of torch on some machines vs others).

Re: A year of uv: pros, cons, and should you migrate

#305

Since this seems to be a love fest let me offer a contrarian view. I use conda for environment management and pip for package management. This neatly separates the concerns into two tools that are good at what they do. I'm afraid that uv is another round of "Let's fix everything" just to create another soon to be dead set of patterns. I find nothing innovative or pleasing in its design, nor do I feel that it is parti…

Yeah, I don't want my build tool to manage my Python, and I don't want my tool that installs Pythons to manage my builds. In JVM land I used Sdkman to manage JVMs, and I used Maven or Gradle to manage builds. I don't want them both tied to one tool, because that's inflexible.

What does the additional flexibility get you? It's just one less thing to worry about when coordinating with a team, and it's easy to shift between different versions for a project if need be.

Re: A year of uv: pros, cons, and should you migrate

#306

Earlier quoted context omitted.

1 file, 2 files, N files, why does it matter how many files? Use a lock file if you want transitive dependencies pinned. I can't think of any other language where "I want my script to use dependencies from the Internet, pinned to precise versions" is a thing.

If there's a language that does this right, all ears? But I havn't seen it - The use case described is for a small one off script for use in CI, or a single file script you send off to a colleague over Slack. Very, very common scenario for many of us. If your script depends on a => c b => c You can pin versions of those direct dependencies like "a" and "b" easy enough, but 2 years later you may not get the same versi…

Try Scala with an Ammonite script like https://ammonite.io/#ScalaScripts . The JVM ecosystem does dependencies right, there's no need to "pin" in the first place because dependency resolution is deterministic to start with. (Upgrading to e.g. all newer patch versions of your current dependencies is easy, but you have to make an explicit action to do so, it will never happen "magically")

Re: A year of uv: pros, cons, and should you migrate

#307

Since this seems to be a love fest let me offer a contrarian view. I use conda for environment management and pip for package management. This neatly separates the concerns into two tools that are good at what they do. I'm afraid that uv is another round of "Let's fix everything" just to create another soon to be dead set of patterns. I find nothing innovative or pleasing in its design, nor do I feel that it is parti…

> soon to be dead set of patterns. Dozens of threads of people praising how performant and easy uv is, how it builds on standards and current tooling instead of inventing new incompatible set of crap, and every time one comment pops up with “akshually my mix of conda, pyenv, pipx, poetry can already do that in record time of 5 minutes, why do you need uv? Its going to be dead soon”.

To be fair here: conda was praised as the solution to everything by many when it was new. It did have its own standards of course. Now most people hate it.

Every packaging PEP is also hailed as the solution to everything, only to be superseded by a new and incompatible PEP within two years.

Re: A year of uv: pros, cons, and should you migrate

#308

Earlier quoted context omitted.

So what? If someone doesn’t want to use it, or doesn’t like it, or is, quite reasonably skeptical that “this time it’ll be different!” … let them be. If it’s good, it’ll stand on its own despite the criticism. If it can’t survive with some people disliking and criticising it is, it deserves to die. Right? Live and let live. We don’t have to all agree all the time about everything . uv is great. So use it if you want…

Naive take. https://gwern.net/holy-war counsels that, in fact, becoming the One True Package Manager for a very popular programming language is an extremely valuable thing to aim towards. This is even outside of the fact that `uv` is backed by a profit-seeking company (cf https://astral.sh/about ). I'm all for people choosing what works best for them, but I'm also staunchly pro-arguing over it.

> becoming the One True Package Manager for a very popular programming language is an extremely valuable thing

For companies. Which is why when random people start acting like it’s important, you have to wonder why it’s important to them.

For example, being a corporate shill. Or so deep in coolaid you can’t allow alternative opinions? Hm?

It’s called an echo chamber.

Re: A year of uv: pros, cons, and should you migrate

#310

Earlier quoted context omitted.

You didn’t mention an important point: speed. Suppose conda had projects. Still, it is somewhat incredible to see uv resolve + install in 2 seconds what takes conda 10 minutes. It immediately made me want to replace conda with uv whenever possible. (I have actively used conda for years, and don’t see myself stopping entirely because of non Python support, but I do see myself switching primarily to uv.)

It's true conda used to be slow, but that was mostly at a time when pip had no real dependency resolver at all. Since I started using mamba, I haven't noticed meaningful speed problems. I confess I'm always a bit puzzled at how much people seem to care about speed for things like install. Like, yes, 10 minutes is a problem, but these days mamba often takes like 15 seconds or so. Okay, that could be faster, but instal…

The near instant install speed is just such a productivity boost. It's not the time you save, it's how it enables you to stay in flow. In my previous job we had a massive internal library hosted on Azure that took like 5 minutes to install with pip or conda. Those on my team not using uv either resorted to using a single global environment for everything, which they dreaded experiment with, or made a new environment once in the project's history and avoided installing new dependencies like the plague. Uv took less than 30 seconds to install the packages, so it freed up a way better workflow of having disposable envs that I could just nuke and start over if they went bad.
Post reply on HN