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

Replace toml package with tomli #1195

Closed
wylliec opened this issue Dec 13, 2023 · 3 comments · Fixed by #1200
Closed

Replace toml package with tomli #1195

wylliec opened this issue Dec 13, 2023 · 3 comments · Fixed by #1200
Milestone

Comments

@wylliec
Copy link

wylliec commented Dec 13, 2023

The tomli package is faster and more standards compliant than the toml package.

tomli is fully compatible with TOML v1.0.0, while toml is not. tomli is the fastest pure Python parser at 2.4x as fast as toml. tomli is used by major packages like jupyterlab and pytest. tomli is even included in the Python Standard Library as tomllib starting in Python 3.11.

The change should be straightforward. Replace all import toml with import tomli, and replace all toml.load with tomli.load.

tomli is hosted on PyPI at https://pypi.org/project/tomli/

@mwouts
Copy link
Owner

mwouts commented Dec 16, 2023

Thanks @wylliec for suggesting this!

Indeed I see that the toml dependency for jupyterlab is "tomli;python_version<\"3.11\"", it would be great to use the same dependencies for jupytext.

@mwouts
Copy link
Owner

mwouts commented Jan 9, 2024

Hi @wylliec , would you mind to confirm that the PR above is what you were suggesting? Thanks!

@wylliec
Copy link
Author

wylliec commented Jan 10, 2024

Looks good to me! Thanks for making this change.

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 a pull request may close this issue.

2 participants