diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt index f52e1de7..dbd91b79 100644 --- a/docs/requirements-docs.txt +++ b/docs/requirements-docs.txt @@ -1,4 +1,4 @@ myst-parser>=0.12.0 -Sphinx>=3.2.0 +Sphinx>=3.2.0,<4.1.0 sphinx-copybutton>=0.3.0 sphinx-rtd-theme>=0.5.0 diff --git a/nbqa/__main__.py b/nbqa/__main__.py index 21d61b68..566b6212 100644 --- a/nbqa/__main__.py +++ b/nbqa/__main__.py @@ -19,7 +19,7 @@ Tuple, ) -import toml +import tomli from pkg_resources import parse_version from nbqa import replace_source, save_source @@ -309,9 +309,10 @@ def _get_configs(cli_args: CLIArgs, project_root: Path) -> Configs: config = get_default_config() # If a section is in pyproject.toml, use that. - if (project_root / "pyproject.toml").is_file(): + pyproject_path = project_root / "pyproject.toml" + if pyproject_path.is_file(): - config_file = toml.load(str(project_root / "pyproject.toml")) + config_file = tomli.loads(pyproject_path.read_text("utf-8")) if "tool" in config_file and "nbqa" in config_file["tool"]: file_config = config_file["tool"]["nbqa"] for section in config: diff --git a/setup.cfg b/setup.cfg index af6dc688..c5f9babc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ py_modules = nbqa install_requires = ipython>=7.8.0 tokenize-rt>=3.2.0 - toml + tomli<2.0.0 importlib_metadata;python_version < '3.8' python_requires = >=3.6.0