Tags
Here's my thought on π Lazy self-installing Python scripts with uv
I really like Trey's steps to making an executable python script with uv
his old process seems to be the same with a new shebang
- Add an appropriate shebang line above the first line in the file (e.g. #!/usr/bin/env python3)
- Aet an executable bit on the file (chmod a+x my_script.py)
- Place the script in a directory thatβs in my shellβs PATH variable (e.g. cp my_script.py ~/bin/my_script)
And here is the new format the the shebang followed by the metadata comment block defined in PEP 723.
#!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.12" # dependencies = [ # "ffmpeg-normalize", # ] # ///
Note
This post is a thought. It's a short note that I make about someone else's content online. Learn more about the process thoughts
This post was a thought by Waylon Walker see all my thoughts at https://waylonwalker.com/thoughts