mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-133403: Check Tools/build/verify_ensurepip_wheels.py with mypy (#133453)
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com> Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
421ba589d0
commit
5f3d3f2a6c
3 changed files with 11 additions and 2 deletions
3
.github/workflows/mypy.yml
vendored
3
.github/workflows/mypy.yml
vendored
|
|
@ -13,7 +13,10 @@ on:
|
|||
- "Lib/test/libregrtest/**"
|
||||
- "Lib/tomllib/**"
|
||||
- "Misc/mypy/**"
|
||||
- "Tools/build/compute-changes.py"
|
||||
- "Tools/build/generate_sbom.py"
|
||||
- "Tools/build/verify_ensurepip_wheels.py"
|
||||
- "Tools/build/update_file.py"
|
||||
- "Tools/cases_generator/**"
|
||||
- "Tools/clinic/**"
|
||||
- "Tools/jit/**"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
[mypy]
|
||||
|
||||
# Please, when adding new files here, also add them to:
|
||||
# .github/workflows/mypy.yml
|
||||
files =
|
||||
Tools/build/compute-changes.py,
|
||||
Tools/build/generate_sbom.py,
|
||||
Tools/build/verify_ensurepip_wheels.py,
|
||||
Tools/build/update_file.py
|
||||
|
||||
pretty = True
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@
|
|||
GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"
|
||||
|
||||
|
||||
def print_notice(file_path: str, message: str) -> None:
|
||||
def print_notice(file_path: str | Path, message: str) -> None:
|
||||
if GITHUB_ACTIONS:
|
||||
message = f"::notice file={file_path}::{message}"
|
||||
print(message, end="\n\n")
|
||||
|
||||
|
||||
def print_error(file_path: str, message: str) -> None:
|
||||
def print_error(file_path: str | Path, message: str) -> None:
|
||||
if GITHUB_ACTIONS:
|
||||
message = f"::error file={file_path}::{message}"
|
||||
print(message, end="\n\n")
|
||||
|
|
@ -67,6 +67,7 @@ def verify_wheel(package_name: str) -> bool:
|
|||
return False
|
||||
|
||||
release_files = json.loads(raw_text)["releases"][package_version]
|
||||
expected_digest = ""
|
||||
for release_info in release_files:
|
||||
if package_path.name != release_info["filename"]:
|
||||
continue
|
||||
|
|
@ -95,6 +96,7 @@ def verify_wheel(package_name: str) -> bool:
|
|||
return True
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit_status = int(not verify_wheel("pip"))
|
||||
raise SystemExit(exit_status)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue