8000 gh-129707: Check `Tools/build/compute-changes.py` with `mypy` by sobolevn · Pull Request #129708 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-129707: Check Tools/build/compute-changes.py with mypy #129708

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 4 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
sobolevn committed Feb 6, 2025
commit cad043062a7b4fd018c9beb022415ea2b703e508
8 changes: 6 additions & 2 deletions Tools/build/compute-changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
from dataclasses import dataclass
from pathlib import Path

TYPE_CHECKING = False
if False:
from collections.abc import Set # type: ignore[unreachable]

GITHUB_DEFAULT_BRANCH = os.environ["GITHUB_DEFAULT_BRANCH"]
GITHUB_CODEOWNERS_PATH = Path(".github/CODEOWNERS")
GITHUB_WORKFLOWS_PATH = Path(".github/workflows")
Expand Down Expand Up @@ -79,7 +83,7 @@ def git_branches() -> tuple[str, str]:

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


def process_changed_files(changed_files: frozenset[Path]) -> Outputs:
def process_changed_files(changed_files: Set[Path]) -> Outputs:
run_tests = False
run_ci_fuzz = False
run_docs = False
Expand Down
Loading
0