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

Switch toml TOML library for tomli #2301

Merged
merged 1 commit into from Jul 12, 2021
Merged

Switch toml TOML library for tomli #2301

merged 1 commit into from Jul 12, 2021

Conversation

ichard26
Copy link
Collaborator

@ichard26 ichard26 commented Jun 2, 2021

toml unfortunately has a lack of maintainership issue right now. It's
evident by the fact toml only supports TOML v0.5.0. TOML v1.0.0 has
been recently released and right now Black crashes hard on its usage.

tomli is a brand new parse only TOML library. It supports TOML
v1.0.0. Although TBH we're switching to this one mostly because
pip is doing the same.


Blocked on pypa/pip#10035, fixes #2280.

@cooperlees cooperlees self-requested a review June 2, 2021 20:26
src/black/__init__.py Outdated Show resolved Hide resolved
@cooperlees
Copy link
Collaborator

Sweet - I am all for this. I've been watching the pip issue and was planning to do this once accepted. It's been verbally so I am happy to go this route too.

@JelleZijlstra JelleZijlstra marked this pull request as draft June 4, 2021 04:19
@ichard26 ichard26 marked this pull request as ready for review June 4, 2021 18:20
Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

Nice. LGTM especially with the test.toml being loaded with new syntax.

pyproject.toml Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@ambv
Copy link
Collaborator

ambv commented Jul 3, 2021

While I agree with Hynek's article, if the maintainer of a library we want to use is explicitly asking us for an upper bound then I think we should respect that. Thanks for your work on tomli, @hukkin.

toml unfortunately has a lack of maintainership issue right now. It's
evident by the fact toml only supports TOML v0.5.0. TOML v1.0.0 has
been recently released and right now Black crashes hard on its usage.

tomli is a brand new parse only TOML library. It supports TOML
v1.0.0. Although TBH we're switching to this one mostly because
pip is doing the same.

*The upper bound was included at the library maintainer's request.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com>
@cooperlees
Copy link
Collaborator

Damn, I can't re-approve this.

@JelleZijlstra
Copy link
Collaborator

Now you can!

Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

One small step for Black, one giant leap for Python kind.

@ichard26
Copy link
Collaborator Author

ichard26 commented Jul 12, 2021

I totally forgot about this PR after updating it, merging!

edit: you can also mark a PR review as stale fyi

@ichard26 ichard26 merged commit 2946d3b into main Jul 12, 2021
@ichard26 ichard26 deleted the better-toml-support branch July 12, 2021 20:01
mgmarino added a commit to mgmarino/black_nbconvert that referenced this pull request Jul 20, 2021
black recently dropped this requirement
(psf/black#2301), so this results in an error if
this is run with a newer version of black.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Valid toml syntax causes black to crash
7 participants