←back to thread

Fun with uv and PEP 723

(www.cottongeeks.com)
619 points deepakjois | 1 comments | | HN request time: 0.201s | source
Show context
ACAVJW4H ◴[] No.44370555[source]
finally feels like Python scripts can Just Work™ without a virtualenv scavenger hunt.

Now if only someone could do the same for shell scripts. Packaging, dependency management, and reproducibility in shell land are still stuck in the Stone Ages. Right now it’s still curl | bash and hope for the best, or a README with 12 manual steps and three missing dependencies.

Sure, there’s Nix... if you’ve already transcended time, space, and the Nix manual. Docker? Great, if downloading a Linux distro to run sed sounds reasonable.

There’s got to be a middle ground simple, declarative, and built for humans.

replies(16): >>44370574 #>>44370603 #>>44370609 #>>44370667 #>>44370757 #>>44370943 #>>44371081 #>>44371402 #>>44372258 #>>44372278 #>>44372472 #>>44372942 #>>44373775 #>>44374090 #>>44374399 #>>44376192 #
nothrabannosir ◴[] No.44372942[source]
Nix is overkill for any of the things it can do. Writing a simple portable script is no exception.

But: it’s the same skill set for every one of those things. This is why it’s an investment worth making IMO. If you’re only going to ever use it for one single thing, it’s not worth it. But once you’ve learned it you’ll be able to leverage it everywhere.

Python scripts with or without dependencies, uv or no uv (through the excellent uv2nix which I can’t plug enough, no affiliation), bash scripts with any dependencies you want, etc. suddenly it’s your choice and you can actually choose the right tool for the job.

Not trying to derail the thread but it feels germane in this context. All these little packaging problems go away with Nix, and are replaced by one single giant problem XD

replies(1): >>44379577 #
1. exe34 ◴[] No.44379577[source]
> Nix is overkill for any of the things it can do. Writing a simple portable script is no exception.

ChatGPT writes pretty good nix now. You can simply paste any errors in and it will fix it.