seddonym / import-linter

Import Linter allows you to define and enforce rules for the internal and external imports within your Python project.
https://import-linter.readthedocs.io/
BSD 2-Clause "Simplified" License
679 stars 48 forks source link

Switch from toml to tomli/tomllib #152

Closed mwgamble closed 1 year ago

mwgamble commented 1 year ago

The toml package is unmaintained, so it was appropriate to move away from it as a dependency. The tomli package is the most appropriate alternative, because it was incorporated into the Python standard library as of Python 3.11, under the name tomllib.

Due to the prevalence of tomli as a compulsory dependency of many other Python code quality tools (such as black, mypy, pytest and pylint), there's a big chance that users will already have it installed if they're using Import Linter. Therefore, tomli is now a compulsory dependency (if you're using versions of Python earlier than 3.11).

This change has several benefits:

Fixes #146

mwgamble commented 1 year ago

@seddonym I've updated the PR as requested :+1:

mwgamble commented 1 year ago

@seddonym Any chance this PR could be merged? That way my grimp types update is based off this work.

seddonym commented 1 year ago

Done, apologies for the delay. Thanks again!

seddonym commented 1 year ago

Hmm, interestingly the merge has caused master mypy checks to fail, because it's now installing the latest version of Grimp. I wonder if we should pin the dependencies on Grimp in the toxfile?

Anyway it sounds like your types update will address these issues, so I'll leave it to you if that's ok?

mwgamble commented 1 year ago

Yep, it's gonna be easiest to just wait a bit for my next PR :+1:

mwgamble commented 1 year ago

Speaking of: https://github.com/seddonym/import-linter/pull/153

By the way I think these failures could have been avoided if the intermediary protocol didn't exist (a la #148)