Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can use this trick with mise (mise-en-place) for small tasks: https://mise.jdx.dev/tasks/toml-tasks.html#shell-shebang

  [tools]
  uv = 'latest'

  [tasks.python_uv_task]
  run = """
  #!/usr/bin/env -S uv run --script
  # /// script
  # dependencies = ["requests<3", "rich"]
  # ///

  import requests
  # your code here 
  """


Something similar is shown for uv here: https://simonwillison.net/2024/Aug/21/usrbinenv-uv-run/




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

Search: