Skip to content

feat: adding pypy-eol enable group #2393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- cpython-freethreading
- cpython-prerelease
- pypy
- pypy-eol
- cpython-experimental-riscv64
description: A Python version or flavor to enable.
additionalProperties: false
Expand Down
1 change: 1 addition & 0 deletions cibuildwheel/resources/cibuildwheel.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"cpython-freethreading",
"cpython-prerelease",
"pypy",
"pypy-eol",
"cpython-experimental-riscv64"
]
},
Expand Down
5 changes: 4 additions & 1 deletion cibuildwheel/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class EnableGroup(StrEnum):
CPythonFreeThreading = "cpython-freethreading"
CPythonPrerelease = "cpython-prerelease"
PyPy = "pypy"
PyPyEoL = "pypy-eol"
CPythonExperimentalRiscV64 = "cpython-experimental-riscv64"
GraalPy = "graalpy"

Expand Down Expand Up @@ -87,7 +88,9 @@ def __call__(self, build_id: str) -> bool:
return False
if EnableGroup.CPythonPrerelease not in self.enable and fnmatch(build_id, "cp314*"):
return False
if EnableGroup.PyPy not in self.enable and fnmatch(build_id, "pp*"):
if EnableGroup.PyPy not in self.enable and fnmatch(build_id, "pp31*"):
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an inline comment to clarify that 'pp31*' is intended to match active PyPy versions, separating them clearly from PyPyEoL builds.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd agree with Copilot on this one!

Suggested change
if EnableGroup.PyPy not in self.enable and fnmatch(build_id, "pp31*"):
if EnableGroup.PyPy not in self.enable and fnmatch(build_id, "pp31*"):
# PyPy 3.10 and upwards is considered non-EoL. Other versions like
# PyPy 3.9 are matched in the EoL group below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed this. I can add in a follow up, I feel like it is fairly self evident from looking at the code. PyPy and PyPyEoL are right next to each other.

return False
if EnableGroup.PyPyEoL not in self.enable and fnmatch(build_id, "pp3?-*"):
return False
if EnableGroup.CPythonExperimentalRiscV64 not in self.enable and fnmatch(
build_id, "*_riscv64"
Expand Down
1 change: 1 addition & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ values are:
The build identifiers for those variants have a `t` suffix in their
`python_tag` (e.g. `cp313t-manylinux_x86_64`).
- `pypy`: Enable PyPy.
- `pypy-eol`: Enable PyPy versions that have passed end of life (if still available).
- `cpython-experimental-riscv64`: Enable experimental riscv64 builds. Those builds
are disabled by default as they can't be uploaded to PyPI and a PEP will most likely
be required before this can happen.
Expand Down
5 changes: 4 additions & 1 deletion test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,13 @@ def _expected_wheels(
if EnableGroup.CPythonFreeThreading in enable_groups:
python_abi_tags.append("cp314-cp314t")

if EnableGroup.PyPy in enable_groups:
if EnableGroup.PyPyEoL in enable_groups:
python_abi_tags += [
"pp38-pypy38_pp73",
"pp39-pypy39_pp73",
]
if EnableGroup.PyPy in enable_groups:
python_abi_tags += [
"pp310-pypy310_pp73",
"pp311-pypy311_pp73",
]
Expand Down
69 changes: 52 additions & 17 deletions unit_test/build_selector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ def test_build():
assert build_selector("cp311-manylinux_x86_64")
assert build_selector("cp312-manylinux_x86_64")
assert build_selector("cp313-manylinux_x86_64")
assert build_selector("pp36-manylinux_x86_64")
assert build_selector("pp37-manylinux_x86_64")
assert build_selector("pp310-manylinux_x86_64")
assert build_selector("pp311-manylinux_x86_64")
assert build_selector("cp36-manylinux_i686")
assert build_selector("cp37-manylinux_i686")
assert build_selector("cp36-macosx_intel")
assert build_selector("cp37-macosx_intel")
assert build_selector("cp39-macosx_intel")
assert build_selector("cp39-macosx_universal2")
assert build_selector("cp39-macosx_arm64")
assert not build_selector("pp36-macosx_intel")
assert not build_selector("pp37-macosx_intel")
assert not build_selector("pp310-macosx_intel")
assert not build_selector("pp311-macosx_intel")
assert build_selector("cp36-win32")
assert build_selector("cp37-win32")
assert not build_selector("pp36-win32")
assert not build_selector("pp37-win32")
assert not build_selector("pp310-win32")
assert not build_selector("pp311-win32")
assert build_selector("cp36-win_amd64")
assert build_selector("cp37-win_amd64")
assert build_selector("cp310-win_amd64")
assert build_selector("cp311-win_amd64")
assert build_selector("cp312-win_amd64")
assert build_selector("cp313-win_amd64")
assert not build_selector("pp36-win_amd64")
assert not build_selector("pp37-win_amd64")
assert not build_selector("pp310-win_amd64")
assert not build_selector("pp311-win_amd64")


def test_build_filter_pre():
Expand All @@ -53,24 +53,59 @@ def test_build_filter_pre():
assert not build_selector("cp313t-manylinux_x86_64")


def test_skip():
def test_build_filter_pypy():
build_selector = BuildSelector(
build_config="*",
skip_config="pp36-* cp3?-manylinux_i686 cp36-win* *-win32",
skip_config="",
enable=frozenset([EnableGroup.PyPy]),
)
assert build_selector("pp310-manylinux_x86_64")
assert build_selector("pp311-manylinux_x86_64")
assert not build_selector("pp38-manylinux_x86_64")
assert not build_selector("pp39-manylinux_x86_64")

assert not build_selector("pp36-manylinux_x86_64")
assert build_selector("pp37-manylinux_x86_64")

def test_build_filter_pypy_eol():
build_selector = BuildSelector(
build_config="*",
skip_config="",
enable=frozenset([EnableGroup.PyPyEoL]),
)
assert not build_selector("pp310-manylinux_x86_64")
assert not build_selector("pp311-manylinux_x86_64")
assert build_selector("pp38-manylinux_x86_64")
assert build_selector("pp39-manylinux_x86_64")


def test_build_filter_pypy_all():
build_selector = BuildSelector(
build_config="*",
skip_config="",
enable=frozenset([EnableGroup.PyPyEoL, EnableGroup.PyPy]),
)
assert build_selector("pp310-manylinux_x86_64")
assert build_selector("pp311-manylinux_x86_64")
assert build_selector("pp38-manylinux_x86_64")
assert build_selector("pp37-manylinux_i686")
assert build_selector("pp38-manylinux_i686")
assert build_selector("pp39-manylinux_x86_64")


def test_skip():
build_selector = BuildSelector(
build_config="*",
skip_config="pp310-* cp3?-manylinux_i686 cp36-win* *-win32",
enable=frozenset([EnableGroup.PyPy]),
)

assert not build_selector("pp310-manylinux_x86_64")
assert build_selector("pp311-manylinux_x86_64")
assert not build_selector("pp37-manylinux_i686")
assert not build_selector("pp38-manylinux_i686")
assert build_selector("cp36-manylinux_x86_64")
assert build_selector("cp37-manylinux_x86_64")
assert not build_selector("cp36-manylinux_i686")
assert not build_selector("cp37-manylinux_i686")
assert not build_selector("pp36-macosx_10_6_intel")
assert build_selector("pp37-macosx_10_6_intel")
assert not build_selector("pp39-macosx_10_6_intel")
assert build_selector("pp311-macosx_10_6_intel")
assert build_selector("cp36-macosx_10_6_intel")
assert build_selector("cp37-macosx_10_6_intel")
assert not build_selector("cp36-win32")
Expand Down Expand Up @@ -117,7 +152,7 @@ def test_build_limited_python():
build_config="*",
skip_config="",
requires_python=SpecifierSet(">=3.7"),
enable=frozenset([EnableGroup.PyPy]),
enable=frozenset([EnableGroup.PyPy, EnableGroup.PyPyEoL]),
)

assert not build_selector("cp36-manylinux_x86_64")
Expand Down
2 changes: 1 addition & 1 deletion unit_test/option_prepare_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux_2_28"
musllinux-x86_64-image = "musllinux_1_2"
enable = ["pypy", "graalpy", "cpython-freethreading"]
enable = ["pypy", "pypy-eol", "graalpy", "cpython-freethreading"]

# Before Python 3.10, use manylinux2014
[[tool.cibuildwheel.overrides]]
Expand Down