10000 pytype_test.py: Fix typechecking errors following #9747 (#9849) · python/typeshed@14b06ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 14b06ae

Browse files
authored
pytype_test.py: Fix typechecking errors following #9747 (#9849)
1 parent 4118b5f commit 14b06ae

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ termcolor>=2
1616
tomli==2.0.1
1717
tomlkit==0.11.6
1818
types-pyyaml>=6.0.12.7
19-
types-setuptools
19+
types-setuptools>=67.5.0.0
2020
typing-extensions

tests/pytype_test.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,10 @@ def get_missing_modules(files_to_test: Sequence[str]) -> Iterable[str]:
159159
missing_modules = set()
160160
for distribution in stub_distributions:
161161
for pkg in read_dependencies(distribution).external_pkgs:
162+
egg_info = pkg_resources.get_distribution(pkg).egg_info
163+
assert isinstance(egg_info, str)
162164
# See https://stackoverflow.com/a/54853084
163-
top_level_file = os.path.join(
164-
# Fixed in #9747
165-
pkg_resources.get_distribution(pkg).egg_info, # type: ignore[attr-defined] # pyright: ignore[reportGeneralTypeIssues]
166-
"top_level.txt",
167-
)
165+
top_level_file = os.path.join(egg_info, "top_level.txt")
168166
with open(top_level_file) as f:
169167
missing_modules.update(f.read().splitlines())
170168
return missing_modules

0 commit comments

Comments
 (0)
0