python pep 723の概要
概要
- ソースココードの中に依存関係を記す記法
- uvなどで実行した際に自動で依存関係をインストールが解決される
仕様
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "httpx",
# "rich",
# ]
# ///
import httpx
from rich.pretty import pprint
pprint(httpx.get("https://httpbin.org/json", timeout=10).json())
- 上記のような
/// script
〜///
のブロックがPEP 723のインラインメタデータ領域