Skip to content

Commit 910397c

Browse files
authored
mypy_test.py: Simplify add_third_party_files() (#9476)
1 parent 41de531 commit 910397c

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

tests/mypy_test.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -284,20 +284,8 @@ def add_third_party_files(
284284
if distribution in seen_dists:
285285
return
286286
seen_dists.add(distribution)
287-
288-
stubs_dir = Path("stubs")
289-
dependencies = get_recursive_requirements(distribution).typeshed_pkgs
290-
291-
for dependency in dependencies:
292-
if dependency in seen_dists:
293-
continue
294-
seen_dists.add(dependency)
295-
files_to_add = sorted((stubs_dir / dependency).rglob("*.pyi"))
296-
files.extend(files_to_add)
297-
for file in files_to_add:
298-
log(args, file, f"included as a dependency of {distribution!r}")
299-
300-
root = stubs_dir / distribution
287+
seen_dists.update(get_recursive_requirements(distribution).typeshed_pkgs)
288+
root = Path("stubs", distribution)
301289
for name in os.listdir(root):
302290
if name.startswith("."):
303291
continue

0 commit comments

Comments
 (0)