PEP 723 – Inline script metadata
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
PEP 723, now Final, standardizes how a single-file Python script declares its own metadata. A comment block opened with "# /// script" can hold dependencies (PEP 508 strings), a requires-python specifier and an optional [tool] table, all in TOML. It defines no runner, but lets tools such as Hatch read requirements without private formats. The Python Enhancement Proposals page says it was resolved on 8 January 2024. Tool support is stated as intent; the GitHub-uniqueness and tool-maintainer claims were not verified. Running untrusted scripts still means installing their dependencies.