by jasonpeacock · 1y ago · 0 comments
I am worried when I have to install a full dependency graph to run your build scripts...that's where things become brittle and annoying.
Python with Typer[0] and Plumbum[1] is great for quickly cranking out ergonomic build scripts, or Invoke[3] which is intended for exactly this purpose.
[0] https://typer.tiangolo.com/ [1] https://plumbum.readthedocs.io/en/latest/ [3] https://www.pyinvoke.org/
But then I've gone from "any Python 3.x can be used as-is" to "setup a Python venv and install these dependencies" as soon as I add any dependency :(
So you either have to constrain yourself to Argparse and Subprocess in the Python stdlib, or accept that your build scripts are a project unto themselves.
This applies similarly to Ruby, TS/JS/Node, Perl, etc.
Just use something like this as a shebang, and you can have your cake and eat it too!
#!/usr/bin/env -S uv run
previous HN thread: https://news.ycombinator.com/item?id=43097006
I wish Python had a native way to build self-contained executables like Go. The binary would be larger since it’s a dynamically interpreted language, but as long as it’s self-contained, I wouldn’t mind.