5 ms·
I'm not worried about matching the build script language to the project language. I am worried when I have to install a full dependency graph to run your build
by jasonpeacock 2y ago
I'm not worried about matching the build script language to the project language.
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/ https://typer.tiangolo.com/
[1] https://plumbum.readthedocs.io/en/latest/ https://plumbum.readthedocs.io/en/latest/
[3] https://www.pyinvoke.org/ 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.
- deleted 2y ago[deleted]
- athrun 2y agoI feel this is where uv's PEP 723 support of inline dependencies in a single-file Python script shines. 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 https://news.ycombinator.com/item?id=43097006
- rednafi 2y agoIt’s much better with uv, but nothing beats the ergonomics of running go mod tidy && go run script.go. 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.
- lgas 2y agoI mean... at first blush it seems like `./scriptname` which is what the `uv` shebang provides beats having to remember two commands and && them together.