-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
Milestone
Description
PEP 723 introduces a standard way to declare dependencies in single-file scripts. It has been accepted and has now been implemented in pip-run and pipx, which run scripts with dependencies like fades. I think fades should support it, too; then fades could run other runners' scripts and vice versa.
Here is an example of a script with embedded dependency data from the PEP:
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "requests<3",
# "rich",
# ]
# ///
import requests
from rich.pretty import pprint
resp = requests.get("https://peps.python.org/api/peps.json")
data = resp.json()
pprint([(k, v["title"]) for k, v in data.items()][:10])
smheidrich