Skip to content

Commit bfa59b9

Browse files
authored
chore: remove old versions of Python 3.8 (bazel-contrib#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.
1 parent 06f6f31 commit bfa59b9

File tree

8 files changed

+4
-218
lines changed

8 files changed

+4
-218
lines changed

.bazelci/presubmit.yml

-2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@ buildifier:
7878
coverage_targets:
7979
- //tests:my_lib_3_10_test
8080
- //tests:my_lib_3_11_test
81-
- //tests:my_lib_3_8_test
8281
- //tests:my_lib_3_9_test
8382
- //tests:my_lib_default_test
8483
- //tests:version_3_10_test
8584
- //tests:version_3_11_test
86-
- //tests:version_3_8_test
8785
- //tests:version_3_9_test
8886
- //tests:version_default_test
8987
tasks:

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ Unreleased changes template.
6060
* 3.12.9
6161
* 3.13.2
6262
* (pypi) Use `xcrun xcodebuild --showsdks` to find XCode root.
63+
* (toolchains) Remove all but `3.8.20` versions of the Python `3.8` interpreter who has
64+
reached EOL. If users still need other versions of the `3.8` interpreter, please supply
65+
the URLs manually {bzl:ob}`python.toolchain` or {bzl:obj}`python_register_toolchains` calls.
6366

6467
[20250317]: https://github.com/astral-sh/python-build-standalone/releases/tag/20250317
6568

6669
{#v0-0-0-fixed}
6770
### Fixed
6871
* (runfiles) ({obj}`--bootstrap_impl=script`) Follow symlinks when searching for runfiles.
69-
* Do not try to run `chmod` when downloading non-windows hermetic toolchain
72+
* (toolchains) Do not try to run `chmod` when downloading non-windows hermetic toolchain
7073
repositories on Windows. Fixes
7174
[#2660](https://github.com/bazel-contrib/rules_python/issues/2660).
7275

examples/multi_python_versions/MODULE.bazel

-9
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ local_path_override(
1010
)
1111

1212
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
13-
python.toolchain(
14-
configure_coverage_tool = True,
15-
python_version = "3.8",
16-
)
1713
python.toolchain(
1814
configure_coverage_tool = True,
1915
# Only set when you have mulitple toolchain versions.
@@ -36,11 +32,6 @@ use_repo(
3632

3733
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
3834
use_repo(pip, "pypi")
39-
pip.parse(
40-
hub_name = "pypi",
41-
python_version = "3.8",
42-
requirements_lock = "//requirements:requirements_lock_3_8.txt",
43-
)
4435
pip.parse(
4536
hub_name = "pypi",
4637
python_version = "3.9",

examples/multi_python_versions/WORKSPACE

-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ python_register_multi_toolchains(
1515
name = "python",
1616
default_version = default_python_version,
1717
python_versions = [
18-
"3.8",
1918
"3.9",
2019
"3.10",
2120
"3.11",
@@ -31,13 +30,11 @@ multi_pip_parse(
3130
python_interpreter_target = {
3231
"3.10": "@python_3_10_host//:python",
3332
"3.11": "@python_3_11_host//:python",
34-
"3.8": "@python_3_8_host//:python",
3533
"3.9": "@python_3_9_host//:python",
3634
},
3735
requirements_lock = {
3836
"3.10": "//requirements:requirements_lock_3_10.txt",
3937
"3.11": "//requirements:requirements_lock_3_11.txt",
40-
"3.8": "//requirements:requirements_lock_3_8.txt",
4138
"3.9": "//requirements:requirements_lock_3_9.txt",
4239
},
4340
)

examples/multi_python_versions/requirements/BUILD.bazel

-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
22

3-
compile_pip_requirements(
4-
name = "requirements_3_8",
5-
src = "requirements.in",
6-
python_version = "3.8",
7-
requirements_txt = "requirements_lock_3_8.txt",
8-
)
9-
103
compile_pip_requirements(
114
name = "requirements_3_9",
125
src = "requirements.in",

examples/multi_python_versions/requirements/requirements_lock_3_8.txt

-78
This file was deleted.

examples/multi_python_versions/tests/BUILD.bazel

-33
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ py_binary(
2222
srcs = ["version_default.py"],
2323
)
2424

25-
py_binary(
26-
name = "version_3_8",
27-
srcs = ["version.py"],
28-
main = "version.py",
29-
python_version = "3.8",
30-
)
31-
3225
py_binary(
3326
name = "version_3_9",
3427
srcs = ["version.py"],
@@ -57,14 +50,6 @@ py_test(
5750
deps = ["//libs/my_lib"],
5851
)
5952

60-
py_test(
61-
name = "my_lib_3_8_test",
62-
srcs = ["my_lib_test.py"],
63-
main = "my_lib_test.py",
64-
python_version = "3.8",
65-
deps = ["//libs/my_lib"],
66-
)
67-
6853
py_test(
6954
name = "my_lib_3_9_test",
7055
srcs = ["my_lib_test.py"],
@@ -102,14 +87,6 @@ py_test(
10287
env = {"VERSION_CHECK": "3.9"}, # The default defined in the WORKSPACE.
10388
)
10489

105-
py_test(
106-
name = "version_3_8_test",
107-
srcs = ["version_test.py"],
108-
env = {"VERSION_CHECK": "3.8"},
109-
main = "version_test.py",
110-
python_version = "3.8",
111-
)
112-
11390
py_test(
11491
name = "version_3_9_test",
11592
srcs = ["version_test.py"],
@@ -169,16 +146,6 @@ sh_test(
169146
},
170147
)
171148

172-
sh_test(
173-
name = "version_test_binary_3_8",
174-
srcs = ["version_test.sh"],
175-
data = [":version_3_8"],
176-
env = {
177-
"VERSION_CHECK": "3.8",
178-
"VERSION_PY_BINARY": "$(rootpaths :version_3_8)",
179-
},
180-
)
181-
182149
sh_test(
183150
name = "version_test_binary_3_9",
184151
srcs = ["version_test.sh"],

python/versions.bzl

-85
Original file line numberDiff line numberDiff line change
@@ -47,91 +47,6 @@ DEFAULT_RELEASE_BASE_URL = "https://github.com/astral-sh/python-build-standalone
4747
#
4848
# buildifier: disable=unsorted-dict-items
4949
TOOL_VERSIONS = {
50-
"3.8.10": {
51-
"url": "20210506/cpython-{python_version}-{platform}-pgo+lto-20210506T0943.tar.zst",
52-
"sha256": {
53-
"x86_64-apple-darwin": "8d06bec08db8cdd0f64f4f05ee892cf2fcbc58cfb1dd69da2caab78fac420238",
54-
"x86_64-unknown-linux-gnu": "aec8c4c53373b90be7e2131093caa26063be6d9d826f599c935c0e1042af3355",
55-
},
56-
"strip_prefix": "python/install",
57-
},
58-
"3.8.12": {
59-
"url": "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz",
60-
"sha256": {
61-
"aarch64-apple-darwin": "f9a3cbb81e0463d6615125964762d133387d561b226a30199f5b039b20f1d944",
62-
# no aarch64-unknown-linux-gnu build available for 3.8.12
63-
"x86_64-apple-darwin": "f323fbc558035c13a85ce2267d0fad9e89282268ecb810e364fff1d0a079d525",
64-
"x86_64-pc-windows-msvc": "4658e08a00d60b1e01559b74d58ff4dd04da6df935d55f6268a15d6d0a679d74",
65-
"x86_64-unknown-linux-gnu": "5be9c6d61e238b90dfd94755051c0d3a2d8023ebffdb4b0fa4e8fedd09a6cab6",
66-
},
67-
"strip_prefix": "python",
68-
},
69-
"3.8.13": {
70-
"url": "20220802/cpython-{python_version}+20220802-{platform}-{build}.tar.gz",
71-
"sha256": {
72-
"aarch64-apple-darwin": "ae4131253d890b013171cb5f7b03cadc585ae263719506f7b7e063a7cf6fde76",
73-
# no aarch64-unknown-linux-gnu build available for 3.8.13
74-
"x86_64-apple-darwin": "cd6e7c0a27daf7df00f6882eaba01490dd963f698e99aeee9706877333e0df69",
75-
"x86_64-pc-windows-msvc": "f20643f1b3e263a56287319aea5c3888530c09ad9de3a5629b1a5d207807e6b9",
76-
"x86_64-unknown-linux-gnu": "fb566629ccb5f76ef56d275a3f8017d683f1c20c5beb5d5f38b155ed11e16187",
77-
},
78-
"strip_prefix": "python",
79-
},
80-
"3.8.15": {
81-
"url": "20221106/cpython-{python_version}+20221106-{platform}-{build}.tar.gz",
82-
"sha256": {
83-
"aarch64-apple-darwin": "1e0a92d1a4f5e6d4a99f86b1cbf9773d703fe7fd032590f3e9c285c7a5eeb00a",
84-
"aarch64-unknown-linux-gnu": "886ab33ced13c84bf59ce8ff79eba6448365bfcafea1bf415bd1d75e21b690aa",
85-
"x86_64-apple-darwin": "70b57f28c2b5e1e3dd89f0d30edd5bc414e8b20195766cf328e1b26bed7890e1",
86-
"x86_64-pc-windows-msvc": "2fdc3fa1c95f982179bbbaedae2b328197658638799b6dcb63f9f494b0de59e2",
87-
"x86_64-unknown-linux-gnu": "e47edfb2ceaf43fc699e20c179ec428b6f3e497cf8e2dcd8e9c936d4b96b1e56",
88-
},
89-
"strip_prefix": "python",
90-
},
91-
"3.8.16": {
92-
"url": "20230116/cpython-{python_version}+20230116-{platform}-{build}.tar.gz",
93-
"sha256": {
94-
"aarch64-apple-darwin": "d1f408569d8807c1053939d7822b082a17545e363697e1ce3cfb1ee75834c7be",
95-
"aarch64-unknown-linux-gnu": "15d00bc8400ed6d94c665a797dc8ed7a491ae25c5022e738dcd665cd29beec42",
96-
"x86_64-apple-darwin": "484ba901f64fc7888bec5994eb49343dc3f9d00ed43df17ee9c40935aad4aa18",
97-
"x86_64-pc-windows-msvc": "b446bec833eaba1bac9063bb9b4aeadfdf67fa81783b4487a90c56d408fb7994",
98-
"x86_64-unknown-linux-gnu": "c890de112f1ae31283a31fefd2061d5c97bdd4d1bdd795552c7abddef2697ea1",
99-
},
100-
"strip_prefix": "python",
101-
},
102-
"3.8.17": {
103-
"url": "20230826/cpython-{python_version}+20230826-{platform}-{build}.tar.gz",
104-
"sha256": {
105-
"aarch64-apple-darwin": "c6f7a130d0044a78e39648f4dae56dcff5a41eba91888a99f6e560507162e6a1",
106-
"aarch64-unknown-linux-gnu": "9f6d585091fe26906ff1dbb80437a3fe37a1e3db34d6ecc0098f3d6a78356682",
107-
"x86_64-apple-darwin": "155b06821607bae1a58ecc60a7d036b358c766f19e493b8876190765c883a5c2",
108-
"x86_64-pc-windows-msvc": "6428e1b4e0b4482d390828de7d4c82815257443416cb786abe10cb2466ca68cd",
109-
"x86_64-unknown-linux-gnu": "8d3e1826c0bb7821ec63288038644808a2d45553245af106c685ef5892fabcd8",
110-
},
111-
"strip_prefix": "python",
112-
},
113-
"3.8.18": {
114-
"url": "20240224/cpython-{python_version}+20240224-{platform}-{build}.tar.gz",
115-
"sha256": {
116-
"aarch64-apple-darwin": "4d493a1792bf211f37f98404cc1468f09bd781adc2602dea0df82ad264c11abc",
117-
"aarch64-unknown-linux-gnu": "6588c9eed93833d9483d01fe40ac8935f691a1af8e583d404ec7666631b52487",
118-
"x86_64-apple-darwin": "7d2cd8d289d5e3cdd0a8c06c028c7c621d3d00ce44b7e2f08c1724ae0471c626",
119-
"x86_64-pc-windows-msvc": "dba923ee5df8f99db04f599e826be92880746c02247c8d8e4d955d4bc711af11",
120-
"x86_64-unknown-linux-gnu": "5ae36825492372554c02708bdd26b8dcd57e3dbf34b3d6d599ad91d93540b2b7",
121-
},
122-
"strip_prefix": "python",
123-
},
124-
"3.8.19": {
125-
"url": "20240726/cpython-{python_version}+20240726-{platform}-{build}.tar.gz",
126-
"sha256": {
127-
"aarch64-apple-darwin": "fe4af1b6bc59478d027ede43f6249cf7b9143558e171bdf8711247337623af57",
128-
"aarch64-unknown-linux-gnu": "8dc598aca7ad43ea20119324af98862d198d8990151c734a69f0fc9d16384b46",
129-
"x86_64-apple-darwin": "4bc990b35384c83b5b0b3071e91455ec203517e569f29f691b159f1a6b2a19b2",
130-
"x86_64-pc-windows-msvc": "4e8e9ddda82062d6e111108ab72f439acac4ba41b77d694548ef5dbf6b2b3319",
131-
"x86_64-unknown-linux-gnu": "e81ea4dd16e6057c8121bdbcb7b64e2956068ca019f244c814bc3ad907cb2765",
132-
},
133-
"strip_prefix": "python",
134-
},
13550
"3.8.20": {
13651
"url": "20241002/cpython-{python_version}+20241002-{platform}-{build}.tar.gz",
13752
"sha256": {

0 commit comments

Comments
 (0)