From 27c258fe7cfd9f4979b84e3fa74177b0a7d57426 Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 22 Aug 2024 12:05:39 -0400 Subject: [PATCH] Move static-checkers-only dependencies into their dedicated extras --- pyproject.toml | 13 +++++-------- .../tests/integration/test_pip_install_sdist.py | 5 ++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dcb581b09e..13a2e92341 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,14 +54,6 @@ test = [ # for tools/finalize.py 'jaraco.develop >= 7.21; python_version >= "3.9" and sys_platform != "cygwin"', "pytest-home >= 0.5", - # pin mypy version so a new version doesn't suddenly cause the CI to fail, - # until types-setuptools is removed from typeshed. - # For help with static-typing issues, or mypy update, ping @Avasam - "mypy==1.11.*", - # No Python 3.11 dependencies require tomli, but needed for type-checking since we import it directly - "tomli", - # No Python 3.12 dependencies require importlib_metadata, but needed for type-checking since we import it directly - "importlib_metadata", "pytest-subprocess", # workaround for pypa/setuptools#4333 @@ -134,6 +126,11 @@ type = [ "pytest-mypy", # local + + # pin mypy version so a new version doesn't suddenly cause the CI to fail, + # until types-setuptools is removed from typeshed. + # For help with static-typing issues, or mypy update, ping @Avasam + "mypy==1.11.*", ] diff --git a/setuptools/tests/integration/test_pip_install_sdist.py b/setuptools/tests/integration/test_pip_install_sdist.py index 2d59337aff..e5203d18f9 100644 --- a/setuptools/tests/integration/test_pip_install_sdist.py +++ b/setuptools/tests/integration/test_pip_install_sdist.py @@ -202,13 +202,12 @@ def build_deps(package, sdist_file): "Manually" install them, since pip will not install build deps with `--no-build-isolation`. """ - import tomli as toml - # delay importing, since pytest discovery phase may hit this file from a # testenv without tomli + from setuptools.compat.py310 import tomllib archive = Archive(sdist_file) - info = toml.loads(_read_pyproject(archive)) + info = tomllib.loads(_read_pyproject(archive)) deps = info.get("build-system", {}).get("requires", []) deps += EXTRA_BUILD_DEPS.get(package, []) # Remove setuptools from requirements (and deduplicate)