diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 05d1139..ca75331 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,6 @@ repos: - types-mock - types-setuptools - types-docutils - - types-toml - repo: https://github.com/PyCQA/pylint rev: v2.13.3 hooks: diff --git a/README.rst b/README.rst index 605f9f8..5d6992d 100644 --- a/README.rst +++ b/README.rst @@ -102,7 +102,7 @@ instead. * ``$CWD/tox.ini`` * ``$CWD/pep8.ini`` * ``$CWD/setup.cfg`` -* ``$CWD/pyproject.toml`` in section ``[tool.doc8]`` if ``toml`` is installed +* ``$CWD/pyproject.toml`` in section ``[tool.doc8]`` if ``tomli`` is installed An example section that can be placed into one of these files:: diff --git a/src/doc8/main.py b/src/doc8/main.py index 628f340..6d8c3c7 100644 --- a/src/doc8/main.py +++ b/src/doc8/main.py @@ -36,7 +36,7 @@ import sys try: - import toml + import tomli HAVE_TOML = True except ImportError: @@ -134,7 +134,8 @@ def from_ini(fp): def from_toml(fp): - cfg = toml.load(fp).get("tool", {}).get("doc8", {}) + with open(fp, "rb") as f: + cfg = tomli.load(f).get("tool", {}).get("doc8", {}) return cfg diff --git a/test-requirements.txt b/test-requirements.txt index 737a6b5..658e46a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,3 @@ mock # BSD pytest # MIT -toml # MIT +tomli # MIT