Skip to content

Commit 5f3d3f2

Browse files
FlosckowDaniil Dumchenkosobolevn
authored
gh-133403: Check Tools/build/verify_ensurepip_wheels.py with mypy (#133453)
Co-authored-by: Daniil Dumchenko <[email protected]> Co-authored-by: sobolevn <[email protected]>
1 parent 421ba58 commit 5f3d3f2

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/mypy.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ on:
1313
- "Lib/test/libregrtest/**"
1414
- "Lib/tomllib/**"
1515
- "Misc/mypy/**"
16+
- "Tools/build/compute-changes.py"
1617
- "Tools/build/generate_sbom.py"
18+
- "Tools/build/verify_ensurepip_wheels.py"
19+
- "Tools/build/update_file.py"
1720
- "Tools/cases_generator/**"
1821
- "Tools/clinic/**"
1922
- "Tools/jit/**"

Tools/build/mypy.ini

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[mypy]
2+
3+
# Please, when adding new files here, also add them to:
4+
# .github/workflows/mypy.yml
25
files =
36
Tools/build/compute-changes.py,
47
Tools/build/generate_sbom.py,
8+
Tools/build/verify_ensurepip_wheels.py,
59
Tools/build/update_file.py
610

711
pretty = True

Tools/build/verify_ensurepip_wheels.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"
2121

2222

23-
def print_notice(file_path: str, message: str) -> None:
23+
def print_notice(file_path: str | Path, message: str) -> None:
2424
if GITHUB_ACTIONS:
2525
message = f"::notice file={file_path}::{message}"
2626
print(message, end="\n\n")
2727

2828

29-
def print_error(file_path: str, message: str) -> None:
29+
def print_error(file_path: str | Path, message: str) -> None:
3030
if GITHUB_ACTIONS:
3131
message = f"::error file={file_path}::{message}"
3232
print(message, end="\n\n")
@@ -67,6 +67,7 @@ def verify_wheel(package_name: str) -> bool:
6767
return False
6868

6969
release_files = json.loads(raw_text)["releases"][package_version]
70+
expected_digest = ""
7071
for release_info in release_files:
7172
if package_path.name != release_info["filename"]:
7273
continue
@@ -95,6 +96,7 @@ def verify_wheel(package_name: str) -> bool:
9596
return True
9697

9798

99+
98100
if __name__ == "__main__":
99101
exit_status = int(not verify_wheel("pip"))
100102
raise SystemExit(exit_status)

0 commit comments

Comments
 (0)