Skip to content

Comment on PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.orgparent

Comments

PEP 723 should be preferred over 722. Using a .toml format makes a lot more sense over the arbitrary `Script Dependencies:` line in a comment block.

Both come with upsides and downsides: it's worth reading the discussion threads[1][2] on both!

I think I agree with you, but it's worth noting that embedding TOML into a here-string also raises some problems: it means that a maximally correct parser will need to handle string continuations, for example. It's also incompatible with what existing tools do, which is consume an unspecified form of PEP 722's syntax. These are not insurmountable problems, but they are reasonable considerations.

[1]: https://discuss.python.org/t/pep-722-dependency-specificatio...

[2]: https://discuss.python.org/t/pep-723-embedding-pyproject-tom...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.