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 dependency with tomli #828

Closed
mkniewallner opened this issue Feb 27, 2022 · 0 comments · Fixed by #829
Closed

Replace toml dependency with tomli #828

mkniewallner opened this issue Feb 27, 2022 · 0 comments · Fixed by #829
Labels
enhancement New feature or request

Comments

@mkniewallner
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Support for defining bandit options in pyproject.toml was added in #401, using toml library.

toml contributions have been stagnating, and the last commit dates back (at the time of writing) to November 1st, 2020.

tomli library is another library that has multiple advantages over toml:

  • it is well maintained, as can be seen in the contributions graph
  • it supports version 1.0.0 of the TOML specification (toml only supports 0.5.0, as can be seen here and in 1.0 release? uiri/toml#300)
  • PEP 680, which will add a TOML parser to Python 3.11 stdlib, has been accepted, and the code will be based on tomli library, as specified here, so this would be easier to conditionally import either tomli or tomllib based on the Python version, as APIs should be identical
  • a lot of widely used Python projects have switched to it (black, mypy, pytest, pip, ...), for some of the reasons mentioned above, so this would also make the ecosystem more consistent, especially for people that use features of TOML 1.0 in their pyproject.toml

Describe the solution you'd like
Relying on tomli library for parsing options defined in pyproject.toml instead of toml library.

Describe alternatives you've considered
Keep relying on toml for parsing options defined in pyproject.toml.

Additional context
n/a

@mkniewallner mkniewallner added the enhancement New feature or request label Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant