News for hackers. Stuff that matters.
Re:Project Scripts by athrun on Wednesday February 26, 2025 @09:52PM (#43190814)
I 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

Re:Project Scripts by rednafi on Wednesday February 26, 2025 @10:10PM (#43190917)
It’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.

Re:Project Scripts by lgas on Thursday February 27, 2025 @08:03AM (#43194005)
I mean... at first blush it seems like `./scriptname` which is what the `uv` shebang provides beats having to remember two commands and && them together.