diff --git a/pyproject.toml b/pyproject.toml index 38eeacaf42..cd80eec75b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -134,12 +134,6 @@ type = [ # until types-setuptools is removed from typeshed. # For help with static-typing issues, or mypy update, ping @Avasam "mypy==1.11.*", - # Conditionally imported vendored dependencies. - # They're not needed at runtime for Python version outside the [core] extra, - # but they're still needed for type-checking since we import them directly - "tomli", - "importlib_resources", - "importlib_metadata", ] diff --git a/setuptools/tests/integration/test_pip_install_sdist.py b/setuptools/tests/integration/test_pip_install_sdist.py index 2d59337aff..cdd4e4caa8 100644 --- a/setuptools/tests/integration/test_pip_install_sdist.py +++ b/setuptools/tests/integration/test_pip_install_sdist.py @@ -202,13 +202,15 @@ 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 + if sys.version_info >= (3, 11): + import tomllib + else: # pragma: no cover + import tomli as 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)