Live data from Hacker News

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

bitecode.dev

241–250 of 401 posts

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

#241

Now we should just figure out why to stop here. Why not write everything in Rust? Recently I have moved all my projects to Rust from Python and never looked back. Of course we need projects like Torch and we are not yet there, but those simpler projects that do not require GPU libraries Rust is great.

Because Rust isn't Python.

Feel like that's super-obvious but yet here we are.

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

#242

A familiar tale: Joe is hesitant about switching to UV and isn't particularly excited about it. Eventually, he gives it a try and becomes a fan. Soon, Joe is recommending UV to everyone he knows.

Joe has found the One True God, Joe must proselytise, the true God demands it.

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

#243
post #43

A very well written article! I admire the analysis done by the author regarding the difficulties of Python packaging. With the advent of uv, I'm finally feeling like Python packaging is solved. As mentioned in the article, being able to have inline dependencies in a single-file Python script and running it naturally is just beautiful. #!/usr/bin/env -S uv run # /// script # dependencies = ['requests', 'beautifulsoup4…

Any flow that does not state checksums/hashsums is not ready for production and all but beautiful. But I haven't used uv yet, so maybe it is possible to specify the dependencies with hashsums in the same file too? Actually the order of import statement is one of the things, that Python does better than JS. It makes completions much less costly to calculate when you type the code. An IDE or other tool only has to chec…

Why did they do that? Why not have smaller venvs for separate projects?

What's a 'project'? If you count every throw away data processing script and one off exploratory Jupyter notebook, that can easily be 100 projects. Certainly before uv, having one huge venv or conda environment with 'everything' installed made it much faster and easier to get that sort of work done.

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

#244
post #141

I know good naming is hard, and there are an awful lot of project names that clash, but naming a project uv is unfortunate due to the ubiquitous nature of libuv https://libuv.org/

I don't think it's particularly problematic, uv the concurrency library and uv the Python tool cover such non-overlapping domains that opportunities for confusion are minimal. (The principle is recognized in trademark law -- some may remember Apple the record label and Apple the computer company. They eventually clashed, but I don't see either of the uv's encroaching on the other's territory.)

I'm not sure that's true. uvloop, built on libuv, is a pretty popular alternative event loop for async Python, much faster than the built-in. It certainly confused me at first to see a tool called "uv" that had nothing to do with that, because I'd been using libuv with Python for years before it came out.

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

#245
post #32

Earlier quoted context omitted.

I use ZFS everywhere EXCEPT on this drive. Not willing to have ZFS on the primary drive till native support lands in the kernel (so, never).

Have you tried borg [0]? Also, why not BTRFS? [0] https://borgbackup.readthedocs.io/en/stable/index.html

Have been using ZFS for the past thirteen years and all my workflows including backup are based on it. It just works.

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

#246
post #43

A very well written article! I admire the analysis done by the author regarding the difficulties of Python packaging. With the advent of uv, I'm finally feeling like Python packaging is solved. As mentioned in the article, being able to have inline dependencies in a single-file Python script and running it naturally is just beautiful. #!/usr/bin/env -S uv run # /// script # dependencies = ['requests', 'beautifulsoup4…

This looks horrible for anything but personal scripts/projects. For anything close to production purposes, this seems like a nightmare.

Anything that makes it easier to make a script that I wrote run on a colleagues machine without having to give them a 45 minute crash course of the current state of python environment setup and package management is a huge win in my book.

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

#247

Earlier quoted context omitted.

Did they run into a hard blocker, or was it just that using version overrides was possible but painful? I started looking seriously at uv/pdm once poetry made it entirely clear they didn't intend to support version overrides [1]. uv's support for overrides seems serviceable if unsophisticated [2][3]. [1] https://github.com/python-poetry/poetry/issues/697 [2] https://docs.astral.sh/uv/concepts/resolution/#dependency-o…

The linked poetry Issue is pretty understandable why they aren't going to support it. I've honestly never heard of any dependency resolver that allows you to dynamically inject an override of a package's built in specification for an indirect dependency. Point blank, that's a packaging failure and the solution is, and always has been, to immediately yank the offending package. That said, the Python case has pretty li…

Maven does it.

It's what I most miss about it.

Package com.foo.Something pins a dependency on crap.bollocks.SomethingElse v1.1.0?

But I want to use crap.bollocks.SomethingElse v1.1.5? And I know that they're compatible?

Then I can configure a dependency exclusion.

I really really miss this feature in every non-JVM build tool.

It's another one of those things that the JVM ecosystem did right that everyone else forgot to copy.

(The other massive one being packages having verifiable namespaces. Can't really typosquat Guava because it's namespace is com.google and they can prove it)

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

#248

Earlier quoted context omitted.

As an example of an edge case - you have Python dependencies that wrap C libs that come in x86-64 flavour and arm-64. Pipenv, when you create a lockfile, will only specify the architecture specific lib that your machine runs on. So if you're developing on an ARM Macbook, but deploying on an Ubuntu x86-64 box, the Pipenv lockfile will break. Whereas a Poetry lockfile will work fine. And I've not found any documentatio…

PEP 751 is defining a new lockfile standard for the ecosystem, and tools including uv look committed to collaborating on the design and implementing whatever results. From what I've been able to tell of the surrounding discussion, the standard is intended to address this use case - rather, to be powerful enough that tools can express the necessary per-architecture locking. The point of the PEP 723 comment style in th…

Your reply is unrelated to my query - is a uv lockfile able to handle multiple arches like a Poetry lockfile?

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

#249
post #225
post #164

Earlier quoted context omitted.

We've been working on all the shortcomings in `pixi`: pixi.sh It's very fast, comes with lockfiles and a project-based approach. Also comes with a `global` mode where you can install tools into sandboxed environments.

I am trying to configure Pixi to use it with Artifactory proxy in a corporate environment, still could not figure it out how to configure it.

Join our discord and we can help! There are lots of users that run it with Artifactory :)

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

#250
post #223

Honest question: is uv more reproducible/portable than cramming your Python project into a Docker container? I've used pyenv, pip, venv, and a couple of other things, and they all work fine, at first, in simple scenarios.

> 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).
Post reply on HN