diff --git a/pyproject.toml b/pyproject.toml index 06f6ceba..a77e99f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ test = [ ] typing = [ "importlib-metadata >= 5.1", - "mypy == 0.991", + "mypy == 1.2.0", "tomli", "typing-extensions >= 3.7.4.3", ] diff --git a/src/build/_util.py b/src/build/_util.py index 18168fe0..2fe3d7cb 100644 --- a/src/build/_util.py +++ b/src/build/_util.py @@ -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) diff --git a/src/build/env.py b/src/build/env.py index d416e104..9fbd7118 100644 --- a/src/build/env.py +++ b/src/build/env.py @@ -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: diff --git a/tox.ini b/tox.ini index 4b8a69bd..159d8b45 100644 --- a/tox.ini +++ b/tox.ini @@ -55,6 +55,8 @@ commands_pre = [testenv:type] description = run type check on code base extras = typing +setenv = + PYTHONWARNDEFAULTENCODING = commands = mypy