Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Lazy self-installing Python scripts with uv (treyhunner.com)
11 points by defulmere 11 months ago | hide | past | favorite | 1 comment


tldr: shebang that runs uv which understands https://peps.python.org/pep-0723/ to run Python script with dependencies installed on-the-fly (cached):

    #!/usr/bin/env -S uv run --script
    # /// script
    # requires-python = ">=3.12"
    # dependencies = [
    #     "ffmpeg-normalize",
    # ]
    # ///




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: