Skip to content

Commit 9df9a98

Browse files
committed
gh-129707: Check Tools/build/compute-changes.py with mypy
1 parent cdcacec commit 9df9a98

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Tools/build/compute-changes.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
from dataclasses import dataclass
1515
from pathlib import Path
1616

17-
TYPE_CHECKING = False
18-
if TYPE_CHECKING:
19-
from collections.abc import Set
20-
2117
GITHUB_DEFAULT_BRANCH = os.environ["GITHUB_DEFAULT_BRANCH"]
2218
GITHUB_CODEOWNERS_PATH = Path(".github/CODEOWNERS")
2319
GITHUB_WORKFLOWS_PATH = Path(".github/workflows")
@@ -83,7 +79,7 @@ def git_branches() -> tuple[str, str]:
8379

8480
def get_changed_files(
8581
ref_a: str = GITHUB_DEFAULT_BRANCH, ref_b: str = "HEAD"
86-
) -> Set[Path]:
82+
) -> frozenset[Path]:
8783
"""List the files changed between two Git refs, filtered by change type."""
8884
args = ("git", "diff", "--name-only", f"{ref_a}...{ref_b}", "--")
8985
print(*args)
@@ -94,7 +90,7 @@ def get_changed_files(
9490
return frozenset(map(Path, filter(None, map(str.strip, changed_files))))
9591

9692

97-
def process_changed_files(changed_files: Set[Path]) -> Outputs:
93+
def process_changed_files(changed_files: frozenset[Path]) -> Outputs:
9894
run_tests = False
9995
run_ci_fuzz = False
10096
run_docs = False

Tools/build/mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[mypy]
2-
files = Tools/build/generate_sbom.py
2+
files = Tools/build/generate_sbom.py, Tools/build/compute-changes.py
33
pretty = True
44

55
# Make sure Python can still be built

0 commit comments

Comments
 (0)