Skip to content

Commit f61a0e1

Browse files
committed
feat: adding pypy-eol enable group
Signed-off-by: Henry Schreiner <[email protected]>
1 parent e7dcb31 commit f61a0e1

File tree

6 files changed

+60
-19
lines changed

6 files changed

+60
-19
lines changed

bin/generate_schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
- cpython-freethreading
3232
- cpython-prerelease
3333
- pypy
34+
- pypy-eol
3435
- cpython-experimental-riscv64
3536
description: A Python version or flavor to enable.
3637
additionalProperties: false

cibuildwheel/resources/cibuildwheel.schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"cpython-freethreading",
1717
"cpython-prerelease",
1818
"pypy",
19+
"pypy-eol",
1920
"cpython-experimental-riscv64"
2021
]
2122
},

cibuildwheel/selector.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class EnableGroup(StrEnum):
3232
CPythonFreeThreading = "cpython-freethreading"
3333
CPythonPrerelease = "cpython-prerelease"
3434
PyPy = "pypy"
35+
PyPyEoL = "pypy-eol"
3536
CPythonExperimentalRiscV64 = "cpython-experimental-riscv64"
3637
GraalPy = "graalpy"
3738

@@ -87,7 +88,9 @@ def __call__(self, build_id: str) -> bool:
8788
return False
8889
if EnableGroup.CPythonPrerelease not in self.enable and fnmatch(build_id, "cp314*"):
8990
return False
90-
if EnableGroup.PyPy not in self.enable and fnmatch(build_id, "pp*"):
91+
if EnableGroup.PyPy not in self.enable and fnmatch(build_id, "pp31*"):
92+
return False
93+
if EnableGroup.PyPyEoL not in self.enable and fnmatch(build_id, "pp3?-*"):
9194
return False
9295
if EnableGroup.CPythonExperimentalRiscV64 not in self.enable and fnmatch(
9396
build_id, "*_riscv64"

docs/options.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ values are:
321321
The build identifiers for those variants have a `t` suffix in their
322322
`python_tag` (e.g. `cp313t-manylinux_x86_64`).
323323
- `pypy`: Enable PyPy.
324+
- `pypy-eol`: Enable PyPy versions that have passed end of life (if still available).
324325
- `cpython-experimental-riscv64`: Enable experimental riscv64 builds. Those builds
325326
are disabled by default as they can't be uploaded to PyPI and a PEP will most likely
326327
be required before this can happen.

unit_test/build_selector_test.py

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ def test_build():
1414
assert build_selector("cp311-manylinux_x86_64")
1515
assert build_selector("cp312-manylinux_x86_64")
1616
assert build_selector("cp313-manylinux_x86_64")
17-
assert build_selector("pp36-manylinux_x86_64")
18-
assert build_selector("pp37-manylinux_x86_64")
17+
assert build_selector("pp310-manylinux_x86_64")
18+
assert build_selector("pp311-manylinux_x86_64")
1919
assert build_selector("cp36-manylinux_i686")
2020
assert build_selector("cp37-manylinux_i686")
2121
assert build_selector("cp36-macosx_intel")
2222
assert build_selector("cp37-macosx_intel")
2323
assert build_selector("cp39-macosx_intel")
2424
assert build_selector("cp39-macosx_universal2")
2525
assert build_selector("cp39-macosx_arm64")
26-
assert not build_selector("pp36-macosx_intel")
27-
assert not build_selector("pp37-macosx_intel")
26+
assert not build_selector("pp310-macosx_intel")
27+
assert not build_selector("pp311-macosx_intel")
2828
assert build_selector("cp36-win32")
2929
assert build_selector("cp37-win32")
30-
assert not build_selector("pp36-win32")
31-
assert not build_selector("pp37-win32")
30+
assert not build_selector("pp310-win32")
31+
assert not build_selector("pp311-win32")
3232
assert build_selector("cp36-win_amd64")
3333
assert build_selector("cp37-win_amd64")
3434
assert build_selector("cp310-win_amd64")
3535
assert build_selector("cp311-win_amd64")
3636
assert build_selector("cp312-win_amd64")
3737
assert build_selector("cp313-win_amd64")
38-
assert not build_selector("pp36-win_amd64")
39-
assert not build_selector("pp37-win_amd64")
38+
assert not build_selector("pp310-win_amd64")
39+
assert not build_selector("pp311-win_amd64")
4040

4141

4242
def test_build_filter_pre():
@@ -53,24 +53,59 @@ def test_build_filter_pre():
5353
assert not build_selector("cp313t-manylinux_x86_64")
5454

5555

56-
def test_skip():
56+
def test_build_filter_pypy():
5757
build_selector = BuildSelector(
5858
build_config="*",
59-
skip_config="pp36-* cp3?-manylinux_i686 cp36-win* *-win32",
59+
skip_config="",
6060
enable=frozenset([EnableGroup.PyPy]),
6161
)
62+
assert build_selector("pp310-manylinux_x86_64")
63+
assert build_selector("pp311-manylinux_x86_64")
64+
assert not build_selector("pp38-manylinux_x86_64")
65+
assert not build_selector("pp39-manylinux_x86_64")
6266

63-
assert not build_selector("pp36-manylinux_x86_64")
64-
assert build_selector("pp37-manylinux_x86_64")
67+
68+
def test_build_filter_pypy_eol():
69+
build_selector = BuildSelector(
70+
build_config="*",
71+
skip_config="",
72+
enable=frozenset([EnableGroup.PyPyEoL]),
73+
)
74+
assert not build_selector("pp310-manylinux_x86_64")
75+
assert not build_selector("pp311-manylinux_x86_64")
76+
assert build_selector("pp38-manylinux_x86_64")
77+
assert build_selector("pp39-manylinux_x86_64")
78+
79+
80+
def test_build_filter_pypy_all():
81+
build_selector = BuildSelector(
82+
build_config="*",
83+
skip_config="",
84+
enable=frozenset([EnableGroup.PyPyEoL, EnableGroup.PyPy]),
85+
)
86+
assert build_selector("pp310-manylinux_x86_64")
87+
assert build_selector("pp311-manylinux_x86_64")
6588
assert build_selector("pp38-manylinux_x86_64")
66-
assert build_selector("pp37-manylinux_i686")
67-
assert build_selector("pp38-manylinux_i686")
89+
assert build_selector("pp39-manylinux_x86_64")
90+
91+
92+
def test_skip():
93+
build_selector = BuildSelector(
94+
build_config="*",
95+
skip_config="pp310-* cp3?-manylinux_i686 cp36-win* *-win32",
96+
enable=frozenset([EnableGroup.PyPy]),
97+
)
98+
99+
assert not build_selector("pp310-manylinux_x86_64")
100+
assert build_selector("pp311-manylinux_x86_64")
101+
assert not build_selector("pp37-manylinux_i686")
102+
assert not build_selector("pp38-manylinux_i686")
68103
assert build_selector("cp36-manylinux_x86_64")
69104
assert build_selector("cp37-manylinux_x86_64")
70105
assert not build_selector("cp36-manylinux_i686")
71106
assert not build_selector("cp37-manylinux_i686")
72-
assert not build_selector("pp36-macosx_10_6_intel")
73-
assert build_selector("pp37-macosx_10_6_intel")
107+
assert not build_selector("pp39-macosx_10_6_intel")
108+
assert build_selector("pp311-macosx_10_6_intel")
74109
assert build_selector("cp36-macosx_10_6_intel")
75110
assert build_selector("cp37-macosx_10_6_intel")
76111
assert not build_selector("cp36-win32")
@@ -117,7 +152,7 @@ def test_build_limited_python():
117152
build_config="*",
118153
skip_config="",
119154
requires_python=SpecifierSet(">=3.7"),
120-
enable=frozenset([EnableGroup.PyPy]),
155+
enable=frozenset([EnableGroup.PyPy, EnableGroup.PyPyEoL]),
121156
)
122157

123158
assert not build_selector("cp36-manylinux_x86_64")

unit_test/option_prepare_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
104104
[tool.cibuildwheel]
105105
manylinux-x86_64-image = "manylinux_2_28"
106106
musllinux-x86_64-image = "musllinux_1_2"
107-
enable = ["pypy", "graalpy", "cpython-freethreading"]
107+
enable = ["pypy", "pypy-eol", "graalpy", "cpython-freethreading"]
108108
109109
# Before Python 3.10, use manylinux2014
110110
[[tool.cibuildwheel.overrides]]

0 commit comments

Comments
 (0)