diff options
| author | Mike Frysinger <vapier@google.com> | 2026-01-05 14:50:43 -0500 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2026-01-06 11:36:26 -0800 |
| commit | c687b5df9e049f928c295e771fdebf593cffaed7 (patch) | |
| tree | e7994b95159379bc6d38da121ed60b2a042d6471 | |
| parent | 1dd9c57a28e0839180995ad44cadf10b21dcc416 (diff) | |
| download | git-repo-c687b5df9e049f928c295e771fdebf593cffaed7.tar.gz | |
run_tests/release: require Python 3.9+
While we support running `repo` on clients with older Python versions,
we don't need to hold the runners & release code back. These are only
used by repo devs on their systems to develop & release repo.
Python 3.9 was picked due to its typing changs which we've already
started using in this code.
Change-Id: I6f8885c84298760514c25abeb1fccb0338947bf4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/539801
Commit-Queue: Mike Frysinger <vapier@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
| -rwxr-xr-x | release/sign-launcher.py | 3 | ||||
| -rwxr-xr-x | release/sign-tag.py | 3 | ||||
| -rwxr-xr-x | release/update-hooks | 2 | ||||
| -rw-r--r-- | release/update_manpages.py | 4 | ||||
| -rwxr-xr-x | run_tests | 10 |
5 files changed, 18 insertions, 4 deletions
diff --git a/release/sign-launcher.py b/release/sign-launcher.py index 865661227..e19a6fcaa 100755 --- a/release/sign-launcher.py +++ b/release/sign-launcher.py | |||
| @@ -27,6 +27,9 @@ import sys | |||
| 27 | import util | 27 | import util |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | assert sys.version_info >= (3, 9), "Release framework requires Python 3.9+" | ||
| 31 | |||
| 32 | |||
| 30 | def sign(opts): | 33 | def sign(opts): |
| 31 | """Sign the launcher!""" | 34 | """Sign the launcher!""" |
| 32 | output = "" | 35 | output = "" |
diff --git a/release/sign-tag.py b/release/sign-tag.py index fbfe7b260..ceef48b3a 100755 --- a/release/sign-tag.py +++ b/release/sign-tag.py | |||
| @@ -30,6 +30,9 @@ import sys | |||
| 30 | import util | 30 | import util |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | assert sys.version_info >= (3, 9), "Release framework requires Python 3.9+" | ||
| 34 | |||
| 35 | |||
| 33 | # We currently sign with the old DSA key as it's been around the longest. | 36 | # We currently sign with the old DSA key as it's been around the longest. |
| 34 | # We should transition to RSA by Jun 2020, and ECC by Jun 2021. | 37 | # We should transition to RSA by Jun 2020, and ECC by Jun 2021. |
| 35 | KEYID = util.KEYID_DSA | 38 | KEYID = util.KEYID_DSA |
diff --git a/release/update-hooks b/release/update-hooks index def4bba9e..3b61b01f4 100755 --- a/release/update-hooks +++ b/release/update-hooks | |||
| @@ -24,7 +24,7 @@ from typing import List, Optional | |||
| 24 | import urllib.request | 24 | import urllib.request |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | assert sys.version_info >= (3, 8), "Python 3.8+ required" | 27 | assert sys.version_info >= (3, 9), "Release framework requires Python 3.9+" |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | TOPDIR = Path(__file__).resolve().parent.parent | 30 | TOPDIR = Path(__file__).resolve().parent.parent |
diff --git a/release/update_manpages.py b/release/update_manpages.py index 9ada83ff3..8bd69b6a7 100644 --- a/release/update_manpages.py +++ b/release/update_manpages.py | |||
| @@ -30,6 +30,10 @@ import tempfile | |||
| 30 | from typing import List | 30 | from typing import List |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | # NB: This script is currently imported by tests/ to unittest some logic. | ||
| 34 | assert sys.version_info >= (3, 6), "Python 3.6+ required" | ||
| 35 | |||
| 36 | |||
| 33 | THIS_FILE = Path(__file__).resolve() | 37 | THIS_FILE = Path(__file__).resolve() |
| 34 | TOPDIR = THIS_FILE.parent.parent | 38 | TOPDIR = THIS_FILE.parent.parent |
| 35 | MANDIR = TOPDIR.joinpath("man") | 39 | MANDIR = TOPDIR.joinpath("man") |
| @@ -21,7 +21,11 @@ import shlex | |||
| 21 | import shutil | 21 | import shutil |
| 22 | import subprocess | 22 | import subprocess |
| 23 | import sys | 23 | import sys |
| 24 | from typing import List | 24 | |
| 25 | |||
| 26 | # NB: While tests/* support Python >=3.6 to match requirements.json for `repo`, | ||
| 27 | # the higher level runner logic does not need to be held back. | ||
| 28 | assert sys.version_info >= (3, 9), "Test/release framework requires Python 3.9+" | ||
| 25 | 29 | ||
| 26 | 30 | ||
| 27 | ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) | 31 | ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) |
| @@ -38,7 +42,7 @@ def is_ci() -> bool: | |||
| 38 | return os.getenv("LUCI_CQ") == "yes" | 42 | return os.getenv("LUCI_CQ") == "yes" |
| 39 | 43 | ||
| 40 | 44 | ||
| 41 | def run_pytest(argv: List[str]) -> int: | 45 | def run_pytest(argv: list[str]) -> int: |
| 42 | """Returns the exit code from pytest.""" | 46 | """Returns the exit code from pytest.""" |
| 43 | if is_ci(): | 47 | if is_ci(): |
| 44 | argv = ["-m", "not skip_cq"] + argv | 48 | argv = ["-m", "not skip_cq"] + argv |
| @@ -51,7 +55,7 @@ def run_pytest(argv: List[str]) -> int: | |||
| 51 | ).returncode | 55 | ).returncode |
| 52 | 56 | ||
| 53 | 57 | ||
| 54 | def run_pytest_py38(argv: List[str]) -> int: | 58 | def run_pytest_py38(argv: list[str]) -> int: |
| 55 | """Returns the exit code from pytest under Python 3.8.""" | 59 | """Returns the exit code from pytest under Python 3.8.""" |
| 56 | if is_ci(): | 60 | if is_ci(): |
| 57 | argv = ["-m", "not skip_cq"] + argv | 61 | argv = ["-m", "not skip_cq"] + argv |
