-
Notifications
You must be signed in to change notification settings - Fork 22
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
Replace toml with tomli for TOML v1 support #43
Conversation
What version of toml is used as standard in PEP? We should stick to that. If minimal version for PEP is 0.5, then we cannot use 1.0 (even if 1.0 is a superset of 0.5, we shouldn't allow anything that is not allowed by PEP). I tried looking it up (mainly in PEP-621) but wasn't able to find any specification... |
All PEP 518 mentions is that it should be "in the TOML format" (https://www.python.org/dev/peps/pep-0518/#file-format). This has caused issues: psf/black#2280 There is a discussion on updating the PEP to specify the version, which I would assume would be v1:
pip used to use The PEP for a tomllib proposes incorporating tomli:
Many psf tools have moved to tomli, as the PEP mentions and as pip has moved to toml v1. See flit, pip, black, etc. and other psf projects. I would say the "standard" right now is whatever pip does, which is v1 since July of 2021. |
Looks legit, thanks for the clarification :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! I had one minor comment regarding the tomli version. LMK when you fix that and I'l merge.
In order to make taskipy works for newer toml syntax, this replaces the
toml
library which only supports v0.5 withtomli
for v1 support.Example from toml spec (https://toml.io/en/v1.0.0#array):
test.toml
The choice for tomli comes down to the fact we only need read-only support for the toml file. We're never writing to the toml file. So in that case, it makes sense to use a smaller and simpler library.
In the future, we could see support for this in the standard library and not need a third party library: https://www.python.org/dev/peps/pep-0680/