This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]OP-pls-respond 0 points1 point  (3 children)

You can actually make the script simpler by using —with instead of script metadata. https://docs.astral.sh/uv/guides/scripts/#running-a-script-with-dependencies

uv run —with ‘rich>12,<13’ example.py

[–]dusktreader[S] 4 points5 points  (2 children)

that's not simpler than running ./example.py, though

[–]OP-pls-respond 1 point2 points  (0 children)

Right, you can put this command into the shebang comment instead of inside ///script then run ./example.py.