Live data from Hacker News

Self-contained Python scripts with uv

blog.dusktreader.dev

111–114 of 114 posts

Re: Self-contained Python scripts with uv

#111
post #92

Overall, and admittedly from a bit of a distance, uv run feels like a reinvention of Zero Install, but for only Python. I also wondered why virtual environments were invented for Python when general environment managers (like Modules) already existed. These packaging and environment problems have never been specific to Python https://0install.net/ https://modules.sourceforge.net/

uv has little in common with 0install, which has its origins in RISC OS's application directories. uv is an attempt to fix the fragments Python development environment tooling story.

I mean yes, you are correct. UV does a lot of different things, but this particular "self-contained app" feature is a lot like zero install. You run your app, its dependencies are automatically downloaded and cached for other uv/zero install apps to use, and it's all transparent and easy.

Re: Self-contained Python scripts with uv

#112

Earlier quoted context omitted.

No, the alternative is to package it yourself and offer it with a signing key. If you make a .deb and .rpm, you’ve covered a large majority of end users.

That sounds worse than the status quo, a lot of developers use Arch Linux, NixOS, other uncommon (to non-devs) distros. Why is signing key with .deb/.rpm better than `curl | sh` from a HTTPS link on a domain owned by the author? .deb/.rpm also contain arbitrary shell commands.

If the shell script happens to have key verification built in to it, then not much from the perspective of provenance verification, but that’s rare IME. Also, using the OS’s package manager means that you can trivially uninstall it.

Re: Self-contained Python scripts with uv

#113
post #111

Earlier quoted context omitted.

uv has little in common with 0install, which has its origins in RISC OS's application directories. uv is an attempt to fix the fragments Python development environment tooling story.

I mean yes, you are correct. UV does a lot of different things, but this particular "self-contained app" feature is a lot like zero install. You run your app, its dependencies are automatically downloaded and cached for other uv/zero install apps to use, and it's all transparent and easy.

In this case, it's nothing specific to uv though: there's a PEP outlining how this stuff is declared and uv is just one of the tools that happens to support the format. I wouldn't be at all surprised of pipx also supports it.

Re: Self-contained Python scripts with uv

#114
post #92

Overall, and admittedly from a bit of a distance, uv run feels like a reinvention of Zero Install, but for only Python. I also wondered why virtual environments were invented for Python when general environment managers (like Modules) already existed. These packaging and environment problems have never been specific to Python https://0install.net/ https://modules.sourceforge.net/

Ironically zero install is pretty difficult to install: https://docs.0install.net/details/macos/
Post reply on HN