diff --git a/requirements-tests.txt b/requirements-tests.txt index c8dab9528..f7faf5506 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -16,5 +16,5 @@ termcolor>=2 tomli==2.0.1 tomlkit==0.11.6 types-pyyaml>=6.0.12.7 -types-setuptools +types-setuptools>=67.5.0.0 typing-extensions diff --git a/tests/pytype_test.py b/tests/pytype_test.py index b24d7cb79..4d7a1f888 100755 --- a/tests/pytype_test.py +++ b/tests/pytype_test.py @@ -159,12 +159,10 @@ def get_missing_modules(files_to_test: Sequence[str]) -> Iterable[str]: missing_modules = set() for distribution in stub_distributions: for pkg in read_dependencies(distribution).external_pkgs: + egg_info = pkg_resources.get_distribution(pkg).egg_info + assert isinstance(egg_info, str) # See https://stackoverflow.com/a/54853084 - top_level_file = os.path.join( - # Fixed in #9747 - pkg_resources.get_distribution(pkg).egg_info, # type: ignore[attr-defined] # pyright: ignore[reportGeneralTypeIssues] - "top_level.txt", - ) + top_level_file = os.path.join(egg_info, "top_level.txt") with open(top_level_file) as f: missing_modules.update(f.read().splitlines()) return missing_modules