Skip to content

Commit

Permalink
Remove conditionally installed dependencies from [type] extra
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Aug 21, 2024
1 parent 759722e commit 6405fa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]


Expand Down
8 changes: 5 additions & 3 deletions setuptools/tests/integration/test_pip_install_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6405fa9

Please sign in to comment.