3 ms·
Not using shebang, but I've recently been using uv as an "installer". It's hard to package and distribute python CLI tools with complex dependencies. I used uv
by anotherpaulg 2y ago
Not using shebang, but I've recently been using uv as an "installer". It's hard to package and distribute python CLI tools with complex dependencies. I used uv in a couple of novel ways:
1. I copied their `curl | sh` install script and added a `uv tool install --python python3.12 my-tool` line at the end. So users can now install my CLI tool with a nice curl-pipe-sh one-liner.
2. I made a tiny pypi "installer" package that has "uv" as its only dependency. All it does is `uv tool install` my CLI tool.
Both methods install the CLI tool, python3.12 and all python dependencies in their own isolated environment. Users don't need to manage python virtual envs. They don't need to even have python installed for the curl-pipe-sh method.
I now get far fewer GitHub issues from users who have somehow mangled the complex dependencies of my tool.
I wrote it up with more detail and links to code:
https://aider.chat/2025/01/15/uv.html https://aider.chat/2025/01/15/uv.html
- CoolCold 2y agoI have not checked how that works under the hood, but > Both methods install the CLI tool, python3.12 Won't that require some compiler (GCC?), kernel headers, openssl-dev/gzip/ffi/other_lib headers to be present on end user system and then compiling Python? At least that's my experience with ASDF-VM, which uses someother Python-setup toolkit under the hood.
- Zizizizz 2y agohttps://docs.astral.sh/uv/concepts/python-versions/#cpython-distributions https://docs.astral.sh/uv/concepts/python-versions/#cpython-... it has pre-compiled versions
- deleted 2y ago[deleted]
- oulipo 2y agoNice! I think `mise` and `aqua` also have a notion of tool install which can be useful