Live data from Hacker News

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

bitecode.dev

361–370 of 401 posts

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

#361
post #327

Earlier quoted context omitted.

What exactly do you imagine that such "recognition" would entail? Are you expecting the IDE to provide its own package manager, for example?

Generally it means "my inspections and autocomplete works as expected".

It can't possibly autocomplete or inspect based off code it doesn't actually have.

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

#362

Earlier quoted context omitted.

>Any flow that does not state checksums/hashsums is not ready for production It's not designed nor intended for such. There are tons of Python users out there who have no concept of what you would call "production"; they wrote something that requires NumPy to be installed and they want to communicate this as cleanly and simply (and machine-readably) as possible, so that they can give a single Python file to associate…

> It's not designed nor intended for such. There are tons of Python users out there who have no concept of what you would call "production"; they wrote something that requires NumPy to be installed and they want to communicate this as cleanly and simply (and machine-readably) as possible, so that they can give a single Python file to associates and have them be able to use it in an appropriate environment. It's expli…

>I did not claim them to be related to package management, and I agree.

Sure, but TFA is about installation, and I wanted to make sure we're all on the same page.

>I understand that. The issue is, that people keep complaining about things that can be solved in rather simple ways.

Can be. But there are many comparably simple ways, none of which is obvious. For example, using the most basic level of tooling, I put my venvs within a `.local` directory` which contains other things I don't want to put in my repo nor mention in .gitignore. Other workflow managers put them in an entirely separate directory and maintain their own mapping.

>Whether you delete the venv and re-create it, or have a dependency managing tool, that removes unused dependencies, I don't care, but you will know it, when you use such a tool.

Well, yes. That's the entire point. When people are accustomed to using a single venv, it's because they haven't previously seen the point of separating things out. When they realize the error of their ways, they may "prefer to delegate to other tooling", as I said. Because it represents a pretty radical change to their workflow.

> That Pip is 19 years older than NPM doesn't have to be a negative. Those are 19 years more time to have worked on the issues as well.

In those 19 years people worked out ways to use Python and share code that bear no resemblance to anything that people mean today when they use the term "ecosystem". And they will be very upset if they're forced to adapt. Reading the Packaging section of the Python Discourse forum (https://discuss.python.org/c/packaging/14) is enlightening in this regard.

> In those 19 years no one had issues with non-reproducible builds?

Of course they have. That's one of the reasons why uv is the N+1th competitor in its niche; why Conda exists; why meson-python (https://mesonbuild.com/meson-python/index.html) exists; why https://pypackaging-native.github.io/ exists; etc. Pip isn't in a position to solve these kinds of problems because of a) the core Python team's attitude towards packaging; b) Pip's intended and declared scope; and c) the sheer range of needs of the entire Python community. (Pip doesn't actually even do builds; it delegates to whichever build backend is declared in the project metadata, defaulting to Setuptools.)

But it sounds more like you're talking about lockfiles with hashes. In which case, please just see https://peps.python.org/pep-0751/ and the corresponding discussion ("Post-History" links there).

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

#363

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.) >…

> The only reason they wouldn't connect up - that I can think of, anyway - is because their own Python wrappers currently don't hard-code the right relative path

It's not just that, it's that you can't specify them as dependencies in a coordinated way as you can with Python libs. You can dump a DLL somewhere but if it's the wrong version for some other library, it will break, and there's no way for packages to tell each other what versions of those shared libraries they need. With conda you can directly specify the version constraints on non-Python packages. Now, yeah, they still need to be built in a consistent manner to work, but that's what conda-forge handles.

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

#364
post #318

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…

Also conda does not have a free licence, every organisation with more than 200 employes should pay for it ( https://www.datacamp.com/blog/navigating-anaconda-licensing ). uv is at date, Apache 2.0.

That is the license for the anaconda package channel, not conda. The page you linked explains that conda and conda-forge are not subject to those licensing issues.

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

#365

Earlier quoted context omitted.

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.) >…

> The only reason they wouldn't connect up - that I can think of, anyway - is because their own Python wrappers currently don't hard-code the right relative path It's not just that, it's that you can't specify them as dependencies in a coordinated way as you can with Python libs. You can dump a DLL somewhere but if it's the wrong version for some other library, it will break, and there's no way for packages to tell e…

Ah, right, I forgot about those issues (I'm thankful I don't write that sort of code myself - I can't say I ever enjoyed C even if I used to use it regularly many years ago). I guess PEP 725 is meant to address this sort of thing, too (as well as build-time requirements like compilers)... ?

I guess one possible workaround is to automate making a wheel for each version of the compiled library, and have the wheel version move in lockstep. Then you just specify the exact wheel versions in your dependencies, and infer the paths according to the wheel package names... it certainly doesn't sound pleasant, though. And, C being what it is, I'm sure that still overlooks something.

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

#366

Earlier quoted context omitted.

> And I had to deal with Scala's SBT ("Simple Build Tool") in another life. I feel you.

For someone who was just about to give Scala a try, what's wrong with it and are there alternative build tools?

It defines a DSL for your build that looks roughly like Scala code. But… it’s not! And there is a confusing “resolution” system for build tasks/settings. It’s also slow as shit. See https://www.lihaoyi.com/post/SowhatswrongwithSBT.html for a comprehensive takedown. If you’re interested in just playing around with scala I would use

https://scala-cli.virtuslab.org

Or for larger projects, the thing the author of the linked article is plugging (mill).

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

#367
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…

You know what we need? In both python and JS, and every other scripting language, we should be able to import packages from a url, but with a sha384 integrity check like exists in HTML. Not sure why they didn't adopt this into JS or Deno. Otherwise installing random scripts is a security risk

Deno and npm both store the hashes of all the dependencies you use in a lock file and verify them on future reinstalls.

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

#368
post #12

Well, big fan of uv. But... the 86GB python dependency download cache on my primary SSD, most of which can be attributed to the 50 different versions of torch, is testament to the fact that even uv cannot salvage the mess that is pip. Never felt this much rage at the state of a language/build system in the 25 years that I have been programming. And I had to deal with Scala's SBT ("Simple Build Tool") in another life.

If you are using uv: $ uv cache prune $ uv cache clean Take your pick and schedule to run weekly/monthly.

Light user of uv here. `prune` just saved me 1.1GiB. Thanks!

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

#369

Earlier quoted context omitted.

Oooh! Do you end up doing a binary search by hand and/or does uv provide tools for that?

Where would binary search come into it? In the example, the version solver just sees the world as though no versions released after `2023-10-16T00:00:00Z` existed.

I mean a binary search or a bisect over dates.

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

#370
post #327

Earlier quoted context omitted.

Generally it means "my inspections and autocomplete works as expected".

It can't possibly autocomplete or inspect based off code it doesn't actually have.

That’s the point. Many modern IDEs are in fact capable of downloading their own copy off some source and praising it.
Post reply on HN