Skip to content

Commit

Permalink
build/env: ignore no-untyped-call errors on importlib.metadata.distyr…
Browse files Browse the repository at this point in the history
…ibutions

We are now pulling importlib_metadata in the mypy run, which makes mypy
raise these errors, as importlib_metadata is only partially typed.

Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed Sep 15, 2021
1 parent e74eddb commit 9b766d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/build/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def check_dependency(
return

try:
dist = importlib_metadata.distribution(req.name)
dist = importlib_metadata.distribution(req.name) # type: ignore[no-untyped-call]
except importlib_metadata.PackageNotFoundError:
# dependency is not installed in the environment.
yield ancestral_req_strings + (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 @@ -258,7 +258,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])))
pip_distribution = next(iter(metadata.distributions(name='pip', path=[purelib]))) # type: ignore[no-untyped-call]
current_pip_version = packaging.version.Version(pip_distribution.version)

if platform.system() == 'Darwin' and int(platform.mac_ver()[0].split('.')[0]) >= 11:
Expand Down

0 comments on commit 9b766d1

Please sign in to comment.