WingNews logo WingNews
top | new | best | ask | show | jobs
top | item 42855936

(no title)

hv42 | 1 year ago

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 
  """

discuss

order

kseistrup|1 year ago

Something similar is shown for uv here: https://simonwillison.net/2024/Aug/21/usrbinenv-uv-run/
powered by hn/api // news.ycombinator.com