chore: remove old versions of Python 3.8 (#2700)
Python 3.8 has reached EOL and this PR removes old toolchains and most
of the tests. Users can still use it if they register the toolchains
themselves, but `rules_python` will no longer keep testing the
toolchains.
Removing the toolchains all-together will be done at a later stage which
may require us to be more clever how we handle asks to include `3.8`.
Maybe
we can just fail if the user asks for a python version that does not
exist,
but I am concerned that `rules_python` depending on `protobuf` may pull
in
code that requests `3.8`. I'll look at this at some later time.
diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml
index f1a912c..3b70734 100644
--- a/.bazelci/presubmit.yml
+++ b/.bazelci/presubmit.yml
@@ -78,12 +78,10 @@
coverage_targets:
- //tests:my_lib_3_10_test
- //tests:my_lib_3_11_test
- - //tests:my_lib_3_8_test
- //tests:my_lib_3_9_test
- //tests:my_lib_default_test
- //tests:version_3_10_test
- //tests:version_3_11_test
- - //tests:version_3_8_test
- //tests:version_3_9_test
- //tests:version_default_test
tasks:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 96bf33d..c64241c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -60,13 +60,16 @@
* 3.12.9
* 3.13.2
* (pypi) Use `xcrun xcodebuild --showsdks` to find XCode root.
+* (toolchains) Remove all but `3.8.20` versions of the Python `3.8` interpreter who has
+ reached EOL. If users still need other versions of the `3.8` interpreter, please supply
+ the URLs manually {bzl:ob}`python.toolchain` or {bzl:obj}`python_register_toolchains` calls.
[20250317]: https://github.com/astral-sh/python-build-standalone/releases/tag/20250317
{#v0-0-0-fixed}
### Fixed
* (runfiles) ({obj}`--bootstrap_impl=script`) Follow symlinks when searching for runfiles.
-* Do not try to run `chmod` when downloading non-windows hermetic toolchain
+* (toolchains) Do not try to run `chmod` when downloading non-windows hermetic toolchain
repositories on Windows. Fixes
[#2660](https://github.com/bazel-contrib/rules_python/issues/2660).
diff --git a/examples/multi_python_versions/MODULE.bazel b/examples/multi_python_versions/MODULE.bazel
index 5783157..74cb4b0 100644
--- a/examples/multi_python_versions/MODULE.bazel
+++ b/examples/multi_python_versions/MODULE.bazel
@@ -12,10 +12,6 @@
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = True,
- python_version = "3.8",
-)
-python.toolchain(
- configure_coverage_tool = True,
# Only set when you have mulitple toolchain versions.
is_default = True,
python_version = "3.9",
@@ -38,11 +34,6 @@
use_repo(pip, "pypi")
pip.parse(
hub_name = "pypi",
- python_version = "3.8",
- requirements_lock = "//requirements:requirements_lock_3_8.txt",
-)
-pip.parse(
- hub_name = "pypi",
python_version = "3.9",
requirements_lock = "//requirements:requirements_lock_3_9.txt",
)
diff --git a/examples/multi_python_versions/WORKSPACE b/examples/multi_python_versions/WORKSPACE
index 48d2065..6b69e0a 100644
--- a/examples/multi_python_versions/WORKSPACE
+++ b/examples/multi_python_versions/WORKSPACE
@@ -15,7 +15,6 @@
name = "python",
default_version = default_python_version,
python_versions = [
- "3.8",
"3.9",
"3.10",
"3.11",
@@ -31,13 +30,11 @@
python_interpreter_target = {
"3.10": "@python_3_10_host//:python",
"3.11": "@python_3_11_host//:python",
- "3.8": "@python_3_8_host//:python",
"3.9": "@python_3_9_host//:python",
},
requirements_lock = {
"3.10": "//requirements:requirements_lock_3_10.txt",
"3.11": "//requirements:requirements_lock_3_11.txt",
- "3.8": "//requirements:requirements_lock_3_8.txt",
"3.9": "//requirements:requirements_lock_3_9.txt",
},
)
diff --git a/examples/multi_python_versions/requirements/BUILD.bazel b/examples/multi_python_versions/requirements/BUILD.bazel
index c9b695e..516a378 100644
--- a/examples/multi_python_versions/requirements/BUILD.bazel
+++ b/examples/multi_python_versions/requirements/BUILD.bazel
@@ -1,13 +1,6 @@
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
compile_pip_requirements(
- name = "requirements_3_8",
- src = "requirements.in",
- python_version = "3.8",
- requirements_txt = "requirements_lock_3_8.txt",
-)
-
-compile_pip_requirements(
name = "requirements_3_9",
src = "requirements.in",
python_version = "3.9",
diff --git a/examples/multi_python_versions/requirements/requirements_lock_3_8.txt b/examples/multi_python_versions/requirements/requirements_lock_3_8.txt
deleted file mode 100644
index 10b5df4..0000000
--- a/examples/multi_python_versions/requirements/requirements_lock_3_8.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# This file is autogenerated by pip-compile with Python 3.8
-# by the following command:
-#
-# bazel run //requirements:requirements_3_8.update
-#
-websockets==11.0.3 \
- --hash=sha256:01f5567d9cf6f502d655151645d4e8b72b453413d3819d2b6f1185abc23e82dd \
- --hash=sha256:03aae4edc0b1c68498f41a6772d80ac7c1e33c06c6ffa2ac1c27a07653e79d6f \
- --hash=sha256:0ac56b661e60edd453585f4bd68eb6a29ae25b5184fd5ba51e97652580458998 \
- --hash=sha256:0ee68fe502f9031f19d495dae2c268830df2760c0524cbac5d759921ba8c8e82 \
- --hash=sha256:1553cb82942b2a74dd9b15a018dce645d4e68674de2ca31ff13ebc2d9f283788 \
- --hash=sha256:1a073fc9ab1c8aff37c99f11f1641e16da517770e31a37265d2755282a5d28aa \
- --hash=sha256:1d2256283fa4b7f4c7d7d3e84dc2ece74d341bce57d5b9bf385df109c2a1a82f \
- --hash=sha256:1d5023a4b6a5b183dc838808087033ec5df77580485fc533e7dab2567851b0a4 \
- --hash=sha256:1fdf26fa8a6a592f8f9235285b8affa72748dc12e964a5518c6c5e8f916716f7 \
- --hash=sha256:2529338a6ff0eb0b50c7be33dc3d0e456381157a31eefc561771ee431134a97f \
- --hash=sha256:279e5de4671e79a9ac877427f4ac4ce93751b8823f276b681d04b2156713b9dd \
- --hash=sha256:2d903ad4419f5b472de90cd2d40384573b25da71e33519a67797de17ef849b69 \
- --hash=sha256:332d126167ddddec94597c2365537baf9ff62dfcc9db4266f263d455f2f031cb \
- --hash=sha256:34fd59a4ac42dff6d4681d8843217137f6bc85ed29722f2f7222bd619d15e95b \
- --hash=sha256:3580dd9c1ad0701169e4d6fc41e878ffe05e6bdcaf3c412f9d559389d0c9e016 \
- --hash=sha256:3ccc8a0c387629aec40f2fc9fdcb4b9d5431954f934da3eaf16cdc94f67dbfac \
- --hash=sha256:41f696ba95cd92dc047e46b41b26dd24518384749ed0d99bea0a941ca87404c4 \
- --hash=sha256:42cc5452a54a8e46a032521d7365da775823e21bfba2895fb7b77633cce031bb \
- --hash=sha256:4841ed00f1026dfbced6fca7d963c4e7043aa832648671b5138008dc5a8f6d99 \
- --hash=sha256:4b253869ea05a5a073ebfdcb5cb3b0266a57c3764cf6fe114e4cd90f4bfa5f5e \
- --hash=sha256:54c6e5b3d3a8936a4ab6870d46bdd6ec500ad62bde9e44462c32d18f1e9a8e54 \
- --hash=sha256:619d9f06372b3a42bc29d0cd0354c9bb9fb39c2cbc1a9c5025b4538738dbffaf \
- --hash=sha256:6505c1b31274723ccaf5f515c1824a4ad2f0d191cec942666b3d0f3aa4cb4007 \
- --hash=sha256:660e2d9068d2bedc0912af508f30bbeb505bbbf9774d98def45f68278cea20d3 \
- --hash=sha256:6681ba9e7f8f3b19440921e99efbb40fc89f26cd71bf539e45d8c8a25c976dc6 \
- --hash=sha256:68b977f21ce443d6d378dbd5ca38621755f2063d6fdb3335bda981d552cfff86 \
- --hash=sha256:69269f3a0b472e91125b503d3c0b3566bda26da0a3261c49f0027eb6075086d1 \
- --hash=sha256:6f1a3f10f836fab6ca6efa97bb952300b20ae56b409414ca85bff2ad241d2a61 \
- --hash=sha256:7622a89d696fc87af8e8d280d9b421db5133ef5b29d3f7a1ce9f1a7bf7fcfa11 \
- --hash=sha256:777354ee16f02f643a4c7f2b3eff8027a33c9861edc691a2003531f5da4f6bc8 \
- --hash=sha256:84d27a4832cc1a0ee07cdcf2b0629a8a72db73f4cf6de6f0904f6661227f256f \
- --hash=sha256:8531fdcad636d82c517b26a448dcfe62f720e1922b33c81ce695d0edb91eb931 \
- --hash=sha256:86d2a77fd490ae3ff6fae1c6ceaecad063d3cc2320b44377efdde79880e11526 \
- --hash=sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016 \
- --hash=sha256:8a34e13a62a59c871064dfd8ffb150867e54291e46d4a7cf11d02c94a5275bae \
- --hash=sha256:8c82f11964f010053e13daafdc7154ce7385ecc538989a354ccc7067fd7028fd \
- --hash=sha256:92b2065d642bf8c0a82d59e59053dd2fdde64d4ed44efe4870fa816c1232647b \
- --hash=sha256:97b52894d948d2f6ea480171a27122d77af14ced35f62e5c892ca2fae9344311 \
- --hash=sha256:9d9acd80072abcc98bd2c86c3c9cd4ac2347b5a5a0cae7ed5c0ee5675f86d9af \
- --hash=sha256:9f59a3c656fef341a99e3d63189852be7084c0e54b75734cde571182c087b152 \
- --hash=sha256:aa5003845cdd21ac0dc6c9bf661c5beddd01116f6eb9eb3c8e272353d45b3288 \
- --hash=sha256:b16fff62b45eccb9c7abb18e60e7e446998093cdcb50fed33134b9b6878836de \
- --hash=sha256:b30c6590146e53149f04e85a6e4fcae068df4289e31e4aee1fdf56a0dead8f97 \
- --hash=sha256:b58cbf0697721120866820b89f93659abc31c1e876bf20d0b3d03cef14faf84d \
- --hash=sha256:b67c6f5e5a401fc56394f191f00f9b3811fe843ee93f4a70df3c389d1adf857d \
- --hash=sha256:bceab846bac555aff6427d060f2fcfff71042dba6f5fca7dc4f75cac815e57ca \
- --hash=sha256:bee9fcb41db2a23bed96c6b6ead6489702c12334ea20a297aa095ce6d31370d0 \
- --hash=sha256:c114e8da9b475739dde229fd3bc6b05a6537a88a578358bc8eb29b4030fac9c9 \
- --hash=sha256:c1f0524f203e3bd35149f12157438f406eff2e4fb30f71221c8a5eceb3617b6b \
- --hash=sha256:c792ea4eabc0159535608fc5658a74d1a81020eb35195dd63214dcf07556f67e \
- --hash=sha256:c7f3cb904cce8e1be667c7e6fef4516b98d1a6a0635a58a57528d577ac18a128 \
- --hash=sha256:d67ac60a307f760c6e65dad586f556dde58e683fab03323221a4e530ead6f74d \
- --hash=sha256:dcacf2c7a6c3a84e720d1bb2b543c675bf6c40e460300b628bab1b1efc7c034c \
- --hash=sha256:de36fe9c02995c7e6ae6efe2e205816f5f00c22fd1fbf343d4d18c3d5ceac2f5 \
- --hash=sha256:def07915168ac8f7853812cc593c71185a16216e9e4fa886358a17ed0fd9fcf6 \
- --hash=sha256:df41b9bc27c2c25b486bae7cf42fccdc52ff181c8c387bfd026624a491c2671b \
- --hash=sha256:e052b8467dd07d4943936009f46ae5ce7b908ddcac3fda581656b1b19c083d9b \
- --hash=sha256:e063b1865974611313a3849d43f2c3f5368093691349cf3c7c8f8f75ad7cb280 \
- --hash=sha256:e1459677e5d12be8bbc7584c35b992eea142911a6236a3278b9b5ce3326f282c \
- --hash=sha256:e1a99a7a71631f0efe727c10edfba09ea6bee4166a6f9c19aafb6c0b5917d09c \
- --hash=sha256:e590228200fcfc7e9109509e4d9125eace2042fd52b595dd22bbc34bb282307f \
- --hash=sha256:e6316827e3e79b7b8e7d8e3b08f4e331af91a48e794d5d8b099928b6f0b85f20 \
- --hash=sha256:e7837cb169eca3b3ae94cc5787c4fed99eef74c0ab9506756eea335e0d6f3ed8 \
- --hash=sha256:e848f46a58b9fcf3d06061d17be388caf70ea5b8cc3466251963c8345e13f7eb \
- --hash=sha256:ed058398f55163a79bb9f06a90ef9ccc063b204bb346c4de78efc5d15abfe602 \
- --hash=sha256:f2e58f2c36cc52d41f2659e4c0cbf7353e28c8c9e63e30d8c6d3494dc9fdedcf \
- --hash=sha256:f467ba0050b7de85016b43f5a22b46383ef004c4f672148a8abf32bc999a87f0 \
- --hash=sha256:f61bdb1df43dc9c131791fbc2355535f9024b9a04398d3bd0684fc16ab07df74 \
- --hash=sha256:fb06eea71a00a7af0ae6aefbb932fb8a7df3cb390cc217d51a9ad7343de1b8d0 \
- --hash=sha256:ffd7dcaf744f25f82190856bc26ed81721508fc5cbf2a330751e135ff1283564
- # via -r requirements/requirements.in
diff --git a/examples/multi_python_versions/tests/BUILD.bazel b/examples/multi_python_versions/tests/BUILD.bazel
index e3dfb48..11fb98c 100644
--- a/examples/multi_python_versions/tests/BUILD.bazel
+++ b/examples/multi_python_versions/tests/BUILD.bazel
@@ -23,13 +23,6 @@
)
py_binary(
- name = "version_3_8",
- srcs = ["version.py"],
- main = "version.py",
- python_version = "3.8",
-)
-
-py_binary(
name = "version_3_9",
srcs = ["version.py"],
main = "version.py",
@@ -58,14 +51,6 @@
)
py_test(
- name = "my_lib_3_8_test",
- srcs = ["my_lib_test.py"],
- main = "my_lib_test.py",
- python_version = "3.8",
- deps = ["//libs/my_lib"],
-)
-
-py_test(
name = "my_lib_3_9_test",
srcs = ["my_lib_test.py"],
main = "my_lib_test.py",
@@ -103,14 +88,6 @@
)
py_test(
- name = "version_3_8_test",
- srcs = ["version_test.py"],
- env = {"VERSION_CHECK": "3.8"},
- main = "version_test.py",
- python_version = "3.8",
-)
-
-py_test(
name = "version_3_9_test",
srcs = ["version_test.py"],
env = {"VERSION_CHECK": "3.9"},
@@ -170,16 +147,6 @@
)
sh_test(
- name = "version_test_binary_3_8",
- srcs = ["version_test.sh"],
- data = [":version_3_8"],
- env = {
- "VERSION_CHECK": "3.8",
- "VERSION_PY_BINARY": "$(rootpaths :version_3_8)",
- },
-)
-
-sh_test(
name = "version_test_binary_3_9",
srcs = ["version_test.sh"],
data = [":version_3_9"],
diff --git a/python/versions.bzl b/python/versions.bzl
index 57a960c..6343ee4 100644
--- a/python/versions.bzl
+++ b/python/versions.bzl
@@ -47,91 +47,6 @@
#
# buildifier: disable=unsorted-dict-items
TOOL_VERSIONS = {
- "3.8.10": {
- "url": "20210506/cpython-{python_version}-{platform}-pgo+lto-20210506T0943.tar.zst",
- "sha256": {
- "x86_64-apple-darwin": "8d06bec08db8cdd0f64f4f05ee892cf2fcbc58cfb1dd69da2caab78fac420238",
- "x86_64-unknown-linux-gnu": "aec8c4c53373b90be7e2131093caa26063be6d9d826f599c935c0e1042af3355",
- },
- "strip_prefix": "python/install",
- },
- "3.8.12": {
- "url": "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz",
- "sha256": {
- "aarch64-apple-darwin": "f9a3cbb81e0463d6615125964762d133387d561b226a30199f5b039b20f1d944",
- # no aarch64-unknown-linux-gnu build available for 3.8.12
- "x86_64-apple-darwin": "f323fbc558035c13a85ce2267d0fad9e89282268ecb810e364fff1d0a079d525",
- "x86_64-pc-windows-msvc": "4658e08a00d60b1e01559b74d58ff4dd04da6df935d55f6268a15d6d0a679d74",
- "x86_64-unknown-linux-gnu": "5be9c6d61e238b90dfd94755051c0d3a2d8023ebffdb4b0fa4e8fedd09a6cab6",
- },
- "strip_prefix": "python",
- },
- "3.8.13": {
- "url": "20220802/cpython-{python_version}+20220802-{platform}-{build}.tar.gz",
- "sha256": {
- "aarch64-apple-darwin": "ae4131253d890b013171cb5f7b03cadc585ae263719506f7b7e063a7cf6fde76",
- # no aarch64-unknown-linux-gnu build available for 3.8.13
- "x86_64-apple-darwin": "cd6e7c0a27daf7df00f6882eaba01490dd963f698e99aeee9706877333e0df69",
- "x86_64-pc-windows-msvc": "f20643f1b3e263a56287319aea5c3888530c09ad9de3a5629b1a5d207807e6b9",
- "x86_64-unknown-linux-gnu": "fb566629ccb5f76ef56d275a3f8017d683f1c20c5beb5d5f38b155ed11e16187",
- },
- "strip_prefix": "python",
- },
- "3.8.15": {
- "url": "20221106/cpython-{python_version}+20221106-{platform}-{build}.tar.gz",
- "sha256": {
- "aarch64-apple-darwin": "1e0a92d1a4f5e6d4a99f86b1cbf9773d703fe7fd032590f3e9c285c7a5eeb00a",
- "aarch64-unknown-linux-gnu": "886ab33ced13c84bf59ce8ff79eba6448365bfcafea1bf415bd1d75e21b690aa",
- "x86_64-apple-darwin": "70b57f28c2b5e1e3dd89f0d30edd5bc414e8b20195766cf328e1b26bed7890e1",
- "x86_64-pc-windows-msvc": "2fdc3fa1c95f982179bbbaedae2b328197658638799b6dcb63f9f494b0de59e2",
- "x86_64-unknown-linux-gnu": "e47edfb2ceaf43fc699e20c179ec428b6f3e497cf8e2dcd8e9c936d4b96b1e56",
- },
- "strip_prefix": "python",
- },
- "3.8.16": {
- "url": "20230116/cpython-{python_version}+20230116-{platform}-{build}.tar.gz",
- "sha256": {
- "aarch64-apple-darwin": "d1f408569d8807c1053939d7822b082a17545e363697e1ce3cfb1ee75834c7be",
- "aarch64-unknown-linux-gnu": "15d00bc8400ed6d94c665a797dc8ed7a491ae25c5022e738dcd665cd29beec42",
- "x86_64-apple-darwin": "484ba901f64fc7888bec5994eb49343dc3f9d00ed43df17ee9c40935aad4aa18",
- "x86_64-pc-windows-msvc": "b446bec833eaba1bac9063bb9b4aeadfdf67fa81783b4487a90c56d408fb7994",
- "x86_64-unknown-linux-gnu": "c890de112f1ae31283a31fefd2061d5c97bdd4d1bdd795552c7abddef2697ea1",
- },
- "strip_prefix": "python",
- },
- "3.8.17": {
- "url": "20230826/cpython-{python_version}+20230826-{platform}-{build}.tar.gz",
- "sha256": {
- "aarch64-apple-darwin": "c6f7a130d0044a78e39648f4dae56dcff5a41eba91888a99f6e560507162e6a1",
- "aarch64-unknown-linux-gnu": "9f6d585091fe26906ff1dbb80437a3fe37a1e3db34d6ecc0098f3d6a78356682",
- "x86_64-apple-darwin": "155b06821607bae1a58ecc60a7d036b358c766f19e493b8876190765c883a5c2",
- "x86_64-pc-windows-msvc": "6428e1b4e0b4482d390828de7d4c82815257443416cb786abe10cb2466ca68cd",
- "x86_64-unknown-linux-gnu": "8d3e1826c0bb7821ec63288038644808a2d45553245af106c685ef5892fabcd8",
- },
- "strip_prefix": "python",
- },
- "3.8.18": {
- "url": "20240224/cpython-{python_version}+20240224-{platform}-{build}.tar.gz",
- "sha256": {
- "aarch64-apple-darwin": "4d493a1792bf211f37f98404cc1468f09bd781adc2602dea0df82ad264c11abc",
- "aarch64-unknown-linux-gnu": "6588c9eed93833d9483d01fe40ac8935f691a1af8e583d404ec7666631b52487",
- "x86_64-apple-darwin": "7d2cd8d289d5e3cdd0a8c06c028c7c621d3d00ce44b7e2f08c1724ae0471c626",
- "x86_64-pc-windows-msvc": "dba923ee5df8f99db04f599e826be92880746c02247c8d8e4d955d4bc711af11",
- "x86_64-unknown-linux-gnu": "5ae36825492372554c02708bdd26b8dcd57e3dbf34b3d6d599ad91d93540b2b7",
- },
- "strip_prefix": "python",
- },
- "3.8.19": {
- "url": "20240726/cpython-{python_version}+20240726-{platform}-{build}.tar.gz",
- "sha256": {
- "aarch64-apple-darwin": "fe4af1b6bc59478d027ede43f6249cf7b9143558e171bdf8711247337623af57",
- "aarch64-unknown-linux-gnu": "8dc598aca7ad43ea20119324af98862d198d8990151c734a69f0fc9d16384b46",
- "x86_64-apple-darwin": "4bc990b35384c83b5b0b3071e91455ec203517e569f29f691b159f1a6b2a19b2",
- "x86_64-pc-windows-msvc": "4e8e9ddda82062d6e111108ab72f439acac4ba41b77d694548ef5dbf6b2b3319",
- "x86_64-unknown-linux-gnu": "e81ea4dd16e6057c8121bdbcb7b64e2956068ca019f244c814bc3ad907cb2765",
- },
- "strip_prefix": "python",
- },
"3.8.20": {
"url": "20241002/cpython-{python_version}+20241002-{platform}-{build}.tar.gz",
"sha256": {