Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 680: "tomllib" Support for parsing TOML in the Standard Library #2218

Merged
merged 23 commits into from
Jan 10, 2022

Conversation

hauntsaninja
Copy link
Contributor

No description provided.

pep-9999.rst Outdated
PEP: for core Python packaging use cases or for tools that need to read
configuration.

Use cases that involve editing TOML (as opposed to writing brand new TOML) are
Copy link
Member

@sobolevn sobolevn Jan 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you refer to cases like poetry add here? For example, poetry add requests will write requests = "^x.y" to your pyproject.toml file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a good example.

@encukou
Copy link
Member

encukou commented Jan 10, 2022

The next available number is PEP 680. Could you use that, to make the PEP editors' work easier?
Preferably check the PRs beforehand: if someone takes 680, get the next number.

Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to sponsor this. Some of the details aren't what I'd choose, but it's a good draft PEP.

pep-9999.rst Outdated Show resolved Hide resolved
pep-9999.rst Outdated
<https://github.com/PyCQA/flake8/issues/234#issuecomment-812800657>`_.

Given the special place TOML already has in the Python ecosystem, it makes sense
for this to be an included battery.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest getting buy-in from the maintainers of tools that support pyproject.toml, e.g. poetry, pdm, and the tools mentioned above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mypy should be easy seeing that @hauntsaninja is a maintainer 😄

flit is not currently listed but I'm fairly sure I won't have to persuade @takluyver ?

isort has a no-dependencies policy (vendor instead) so I bet @timothycrosley also has no objections?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a maintainer of Black and mypy I'd also be happy to see a TOML parser in the stdlib :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect @pradyunsg could do so for pip and some other packaging tools?

pip switched vendoring toml to tomli: pypa/pip#10035

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be in favour as a pip maintainer.

@hauntsaninja hauntsaninja changed the title PEP ???: "tomllib" Support for parsing TOML in the Standard Library PEP 680: "tomllib" Support for parsing TOML in the Standard Library Jan 10, 2022
@JelleZijlstra JelleZijlstra merged commit 5056f2a into python:main Jan 10, 2022
this PEP, listed in `Appendix A`_.

Finally, the ``toml`` package on PyPI is not actively maintained and `we have
been unable to contact the author <https://github.com/uiri/toml/issues/361>`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

underscores are missing to make this a link

Copy link
Contributor

@hukkin hukkin Jan 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed this here: #2223

https://grep.app.

The ``toml.TomlDecoder`` interface exposed is not simple, containing nine methods.
See `here <https://github.com/uiri/toml/blob/3f637dba5f68db63d4b30967fedda51c82459471/toml/decoder.pyi#L36>`__.
Copy link
Member

@merwok merwok Jan 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using here or click for link texts is poor metadata (try for example context menu on link → save bookmark, browser defaults to link text for bookmark title) and accessibility (features like jump to link or display list of all links in document rely on text link too)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed here

(haha 😄 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants