Skip to content

Commit

Permalink
fix: mypy update & env change
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii authored and layday committed Apr 24, 2023
1 parent 900ed62 commit 69620d4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ test = [
'setuptools >= 42.0.0; python_version < "3.10"',
'setuptools >= 56.0.0; python_version >= "3.10"',
]
typing = [
"importlib-metadata >= 5.1",
"mypy == 0.991",
"tomli",
"typing-extensions >= 3.7.4.3",
]
virtualenv = [
"virtualenv >= 20.0.35",
]
Expand Down
2 changes: 1 addition & 1 deletion src/build/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def check_dependency(
return

try:
dist = importlib_metadata.distribution(req.name) # type: ignore[no-untyped-call]
dist = importlib_metadata.distribution(req.name)
except importlib_metadata.PackageNotFoundError:
# dependency is not installed in the environment.
yield (*ancestral_req_strings, normalised_req_string)
Expand Down
2 changes: 1 addition & 1 deletion src/build/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def _create_isolated_env_venv(path: str) -> tuple[str, str]:
executable, script_dir, purelib = _find_executable_and_scripts(path)

# Get the version of pip in the environment
pip_distribution = next(iter(metadata.distributions(name='pip', path=[purelib]))) # type: ignore[no-untyped-call]
pip_distribution = next(iter(metadata.distributions(name='pip', path=[purelib])))
current_pip_version = packaging.version.Version(pip_distribution.version)

if platform.system() == 'Darwin' and int(platform.mac_ver()[0].split('.')[0]) >= 11:
Expand Down
10 changes: 9 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ commands_pre =

[testenv:type]
description = run type check on code base
extras = typing
skip_install = true
setenv =
PYTHONWARNDEFAULTENCODING =
deps =
importlib-metadata>=5.1
mypy==1.2.0
tomli
typing-extensions>=3.7.4.3
packaging
commands =
mypy

Expand Down

0 comments on commit 69620d4

Please # to comment.