8000 pytype_test.py: Fix typechecking errors following #9747 by Avasam · Pull Request #9849 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content
8000

pytype_test.py: Fix typechecking errors following #9747 #9849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 3 additions & 5 deletions tests/pytype_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
0