Standalone python script with uv

1 · Paul Willot · Jan. 23, 2025, 10:06 a.m.
Uv is a neat package manager, which took off last year in python land. Being written in Rust™ immediately gives it +100 street credibility. As it supports reading inline script metadata (see PEP 723) it's easy to write scripts that specify their own dependencies, in a single file. You still need to install uv itself though, and while it's simple it's still an extra step, which is exactly one too many. So here is how I inline that as well into the script: #!/usr/bin/env sh #!/usr/bin/env -S uv ru...