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>
diff --git a/release/sign-launcher.py b/release/sign-launcher.py
index 8656612..e19a6fc 100755
--- a/release/sign-launcher.py
+++ b/release/sign-launcher.py
@@ -27,6 +27,9 @@
 import util
 
 
+assert sys.version_info >= (3, 9), "Release framework requires Python 3.9+"
+
+
 def sign(opts):
     """Sign the launcher!"""
     output = ""
diff --git a/release/sign-tag.py b/release/sign-tag.py
index fbfe7b2..ceef48b 100755
--- a/release/sign-tag.py
+++ b/release/sign-tag.py
@@ -30,6 +30,9 @@
 import util
 
 
+assert sys.version_info >= (3, 9), "Release framework requires Python 3.9+"
+
+
 # We currently sign with the old DSA key as it's been around the longest.
 # We should transition to RSA by Jun 2020, and ECC by Jun 2021.
 KEYID = util.KEYID_DSA
diff --git a/release/update-hooks b/release/update-hooks
index def4bba..3b61b01 100755
--- a/release/update-hooks
+++ b/release/update-hooks
@@ -24,7 +24,7 @@
 import urllib.request
 
 
-assert sys.version_info >= (3, 8), "Python 3.8+ required"
+assert sys.version_info >= (3, 9), "Release framework requires Python 3.9+"
 
 
 TOPDIR = Path(__file__).resolve().parent.parent
diff --git a/release/update_manpages.py b/release/update_manpages.py
index 9ada83f..8bd69b6 100644
--- a/release/update_manpages.py
+++ b/release/update_manpages.py
@@ -30,6 +30,10 @@
 from typing import List
 
 
+# NB: This script is currently imported by tests/ to unittest some logic.
+assert sys.version_info >= (3, 6), "Python 3.6+ required"
+
+
 THIS_FILE = Path(__file__).resolve()
 TOPDIR = THIS_FILE.parent.parent
 MANDIR = TOPDIR.joinpath("man")
diff --git a/run_tests b/run_tests
index 2e1cddb..0cd53e6 100755
--- a/run_tests
+++ b/run_tests
@@ -21,7 +21,11 @@
 import shutil
 import subprocess
 import sys
-from typing import List
+
+
+# NB: While tests/* support Python >=3.6 to match requirements.json for `repo`,
+# the higher level runner logic does not need to be held back.
+assert sys.version_info >= (3, 9), "Test/release framework requires Python 3.9+"
 
 
 ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
@@ -38,7 +42,7 @@
     return os.getenv("LUCI_CQ") == "yes"
 
 
-def run_pytest(argv: List[str]) -> int:
+def run_pytest(argv: list[str]) -> int:
     """Returns the exit code from pytest."""
     if is_ci():
         argv = ["-m", "not skip_cq"] + argv
@@ -51,7 +55,7 @@
     ).returncode
 
 
-def run_pytest_py38(argv: List[str]) -> int:
+def run_pytest_py38(argv: list[str]) -> int:
     """Returns the exit code from pytest under Python 3.8."""
     if is_ci():
         argv = ["-m", "not skip_cq"] + argv