Live data from Hacker News

PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.org

peps.python.org

21–30 of 30 posts

Re: PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.org

#21
post #18

Earlier quoted context omitted.

> On that note, I will never understand why they chose .toml instead of just json or yaml.. https://peps.python.org/pep-0518/#other-file-formats

I think "easy for humans to edit" is where I mostly disagree with. To this day I have not worked with anyone that understood the .toml format.

How much time have you spent towards TOML vs -- say -- YAML?

More editable than JSON and far simpler than YAML.

---

The Rust ecosystem also uses TOML.

Re: PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.org

#22
post #8

Earlier quoted context omitted.

It's probably because pyproject.toml is the direction in which the python ecosystem is going. On that note, I will never understand why they chose .toml instead of just json or yaml..

> On that note, I will never understand why they chose .toml instead of just json or yaml.. https://peps.python.org/pep-0518/#other-file-formats

YAML is only fun when you're not tripping in the numerous landmines in the way: https://noyaml.com/

Re: PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.org

#23
post #19

It's interesting that they tested for AI code completion compatibility. It makes sense as AI code completion is now a big part of tooling and standards should accomodate for common tools.

AI code completion is a complete grift.

Re: PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.org

#24

Is there a reason, why the __pyproject__ variable is not a dict but a toml string?

It does seem like over-complicating things for a dynamic language not to use itself as the standard configuration format.

Re: PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.org

#27
One thing I don't quite get is why the proposal here is so insistent on triple quoted strings only. Shouldn't a \n formatted string also be considered valid? Its practically just a string after all.

Other than that, this isn't a bad proposal. Generally for single-file scripts, figuring out the imports isn't too difficult but you do have the occasionally weirdly named pypi package vs installed import package.

Re: PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.org

#28

One thing I don't quite get is why the proposal here is so insistent on triple quoted strings only. Shouldn't a \n formatted string also be considered valid? Its practically just a string after all. Other than that, this isn't a bad proposal. Generally for single-file scripts, figuring out the imports isn't too difficult but you do have the occasionally weirdly named pypi package vs installed import package.

The syntax is restricted so the toml content can be extracted without actually parsing the Python file, a regex is enough.

Re: PEP 723 – Embedding pyproject.toml in single-file scripts – peps.python.org

#29

One thing I don't quite get is why the proposal here is so insistent on triple quoted strings only. Shouldn't a \n formatted string also be considered valid? Its practically just a string after all. Other than that, this isn't a bad proposal. Generally for single-file scripts, figuring out the imports isn't too difficult but you do have the occasionally weirdly named pypi package vs installed import package.

I think the reason for being so specific about using tripple quoted strings is that this stuff needs to be parsed out without running it through the interpreter. e.g. pip needs to be able to fish out the pyproject.toml data to install dependencies before running the script is even going to work.

It's just lightening the load on developers by making the parsing simpler.

Post reply on HN