Skip to content

Commit 3d64cc0

Browse files
authored
Encode Python 3.12 requirement in PEP-723 block (#3445)
## Why I tried running `gh_report.py` with system Python and it failed with: ``` AttributeError: 'PosixPath' object has no attribute 'walk' ``` This was added in Python 3.12. ## Tests I can now run the script through `uv run`.
1 parent 2f4a638 commit 3d64cc0

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

tools/gh_parse.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.12"
4+
# ///
25
"""
36
Analyze downloaded GH logs and print a report. Use gh_report.py instead of this script directly.
47
"""

tools/gh_report.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.12"
4+
# ///
25
"""
36
Download integration logs artifacts for a given run id (--run RUNID) or commit (--commit) and call gh_parse.py on those to print the report.
47

tools/lintdiff.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.12"
4+
# ///
25
"""
36
Drop in replacement for golangci-lint that runs it only on changed packages.
47

tools/start_integration_tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.12"
4+
# ///
25
"""
36
Start integration test jobs for PRs by non-team members that are approved by team members.
47
"""

tools/update_github_links.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.12"
4+
# ///
25
"""Update PR references in changelog files.
36
47
1. Convert occurrences of `#1234` to the canonical markdown link

tools/validate_whitespace.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.12"
4+
# ///
25
import os
36
import re
47
import sys

0 commit comments

Comments
 (0)