From d84665491a4a2954010138bcfb580908b878d173 Mon Sep 17 00:00:00 2001 From: mayeut Date: Mon, 24 May 2021 09:44:50 +0200 Subject: [PATCH] Add i686 support for PyPy --- README.md | 4 ++-- bin/update_docker.py | 3 +++ cibuildwheel/__main__.py | 1 + cibuildwheel/linux.py | 1 + cibuildwheel/resources/build-platforms.toml | 1 + cibuildwheel/resources/pinned_docker_images.cfg | 5 +++++ docs/options.md | 3 +++ test/test_manylinuxXXXX_only.py | 1 + test/utils.py | 2 +- 9 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 57d1c355..3e767f8e 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ What does it do? | CPython 3.7 | ✅ | | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | CPython 3.8 | ✅ | | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| PyPy 3.7 v7.3 | ✅ | | ✅ | | ✅ | | ✅ | | | +| PyPy 3.7 v7.3 | ✅ | | ✅ | | ✅ | ✅ | ✅ | | | - Builds manylinux, macOS 10.9+, and Windows wheels for CPython and PyPy - Works on GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, and GitLab CI @@ -110,7 +110,7 @@ Options | | [`CIBW_BEFORE_ALL`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-all) | Execute a shell command on the build system before any wheels are built. | | | [`CIBW_BEFORE_BUILD`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-build) | Execute a shell command preparing each wheel's build | | | [`CIBW_REPAIR_WHEEL_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#repair-wheel-command) | Execute a shell command to repair each (non-pure Python) built wheel | -| | [`CIBW_MANYLINUX_X86_64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_I686_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_PYPY_X86_64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_AARCH64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_PPC64LE_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_S390X_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_PYPY_AARCH64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) | Specify alternative manylinux docker images | +| | [`CIBW_MANYLINUX_X86_64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_I686_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_PYPY_X86_64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_AARCH64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_PPC64LE_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_S390X_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_PYPY_AARCH64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image)
[`CIBW_MANYLINUX_PYPY_I686_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) | Specify alternative manylinux docker images | | | [`CIBW_DEPENDENCY_VERSIONS`](https://cibuildwheel.readthedocs.io/en/stable/options/#dependency-versions) | Specify how cibuildwheel controls the versions of the tools it uses | | **Testing** | [`CIBW_TEST_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#test-command) | Execute a shell command to test each built wheel | | | [`CIBW_BEFORE_TEST`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-test) | Execute a shell command before testing each wheel | diff --git a/bin/update_docker.py b/bin/update_docker.py index cae73468..2e97a8e6 100755 --- a/bin/update_docker.py +++ b/bin/update_docker.py @@ -25,6 +25,7 @@ images = [ Image("manylinux2010", "x86_64", "quay.io/pypa/manylinux2010_x86_64", None), Image("manylinux2010", "i686", "quay.io/pypa/manylinux2010_i686", None), Image("manylinux2010", "pypy_x86_64", "quay.io/pypa/manylinux2010_x86_64", None), + Image("manylinux2010", "pypy_i686", "quay.io/pypa/manylinux2010_i686", None), # 2014 images Image("manylinux2014", "x86_64", "quay.io/pypa/manylinux2014_x86_64", None), Image("manylinux2014", "i686", "quay.io/pypa/manylinux2014_i686", None), @@ -32,6 +33,7 @@ images = [ Image("manylinux2014", "ppc64le", "quay.io/pypa/manylinux2014_ppc64le", None), Image("manylinux2014", "s390x", "quay.io/pypa/manylinux2014_s390x", None), Image("manylinux2014", "pypy_x86_64", "quay.io/pypa/manylinux2014_x86_64", None), + Image("manylinux2014", "pypy_i686", "quay.io/pypa/manylinux2014_i686", None), Image("manylinux2014", "pypy_aarch64", "quay.io/pypa/manylinux2014_aarch64", None), # 2_24 images Image("manylinux_2_24", "x86_64", "quay.io/pypa/manylinux_2_24_x86_64", None), @@ -40,6 +42,7 @@ images = [ Image("manylinux_2_24", "ppc64le", "quay.io/pypa/manylinux_2_24_ppc64le", None), Image("manylinux_2_24", "s390x", "quay.io/pypa/manylinux_2_24_s390x", None), Image("manylinux_2_24", "pypy_x86_64", "quay.io/pypa/manylinux_2_24_x86_64", None), + Image("manylinux_2_24", "pypy_i686", "quay.io/pypa/manylinux_2_24_i686", None), Image("manylinux_2_24", "pypy_aarch64", "quay.io/pypa/manylinux_2_24_aarch64", None), ] diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index 192fbb19..e9326939 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -293,6 +293,7 @@ def main() -> None: "ppc64le", "s390x", "pypy_aarch64", + "pypy_i686", ]: pinned_images = all_pinned_docker_images[build_platform] diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 3b5bfcda..faeff20b 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -70,6 +70,7 @@ def build(options: BuildOptions) -> None: ("cp", "manylinux_s390x", options.manylinux_images["s390x"]), ("pp", "manylinux_x86_64", options.manylinux_images["pypy_x86_64"]), ("pp", "manylinux_aarch64", options.manylinux_images["pypy_aarch64"]), + ("pp", "manylinux_i686", options.manylinux_images["pypy_i686"]), ] cwd = Path.cwd() diff --git a/cibuildwheel/resources/build-platforms.toml b/cibuildwheel/resources/build-platforms.toml index 6bb90c3e..65012101 100644 --- a/cibuildwheel/resources/build-platforms.toml +++ b/cibuildwheel/resources/build-platforms.toml @@ -22,6 +22,7 @@ python_configurations = [ { identifier = "cp38-manylinux_s390x", version = "3.8", path_str = "/opt/python/cp38-cp38" }, { identifier = "cp39-manylinux_s390x", version = "3.9", path_str = "/opt/python/cp39-cp39" }, { identifier = "pp37-manylinux_aarch64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" }, + { identifier = "pp37-manylinux_i686", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" }, ] [macos] diff --git a/cibuildwheel/resources/pinned_docker_images.cfg b/cibuildwheel/resources/pinned_docker_images.cfg index be36bc3a..40b302be 100644 --- a/cibuildwheel/resources/pinned_docker_images.cfg +++ b/cibuildwheel/resources/pinned_docker_images.cfg @@ -15,6 +15,11 @@ manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2021-05-24-84874a2 manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2021-05-24-84874a2 manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2021-05-24-84874a2 +[pypy_i686] +manylinux2010 = quay.io/pypa/manylinux2010_i686:2021-05-24-84874a2 +manylinux2014 = quay.io/pypa/manylinux2014_i686:2021-05-24-84874a2 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2021-05-24-84874a2 + [aarch64] manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2021-05-24-84874a2 manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2021-05-24-84874a2 diff --git a/docs/options.md b/docs/options.md index 3a197924..4332e683 100644 --- a/docs/options.md +++ b/docs/options.md @@ -479,6 +479,7 @@ The available options are: - `CIBW_MANYLINUX_PPC64LE_IMAGE` - `CIBW_MANYLINUX_S390X_IMAGE` - `CIBW_MANYLINUX_PYPY_AARCH64_IMAGE` +- `CIBW_MANYLINUX_PYPY_I686_IMAGE` Set an alternative Docker image to be used for building [manylinux](https://github.com/pypa/manylinux) wheels. cibuildwheel will then pull these instead of the default images, [`quay.io/pypa/manylinux2010_x86_64`](https://quay.io/pypa/manylinux2010_x86_64), [`quay.io/pypa/manylinux2010_i686`](https://quay.io/pypa/manylinux2010_i686), [`quay.io/pypa/manylinux2010_x86_64`](https://quay.io/pypa/manylinux2010_x86_64), [`quay.io/pypa/manylinux2014_aarch64`](https://quay.io/pypa/manylinux2014_aarch64), [`quay.io/pypa/manylinux2014_ppc64le`](https://quay.io/pypa/manylinux2014_ppc64le), and [`quay.io/pypa/manylinux2014_s390x`](https://quay.io/pypa/manylinux2010_s390x). @@ -503,12 +504,14 @@ CIBW_SKIP: pp* CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_MANYLINUX_I686_IMAGE: manylinux2014 CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux2014 +CIBW_MANYLINUX_PYPY_I686_IMAGE: manylinux2014 # build using the latest manylinux2010 release, instead of the cibuildwheel # pinned version CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest CIBW_MANYLINUX_PYPY_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest +CIBW_MANYLINUX_PYPY_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest # build using a different image from the docker registry CIBW_MANYLINUX_X86_64_IMAGE: dockcross/manylinux-x64 diff --git a/test/test_manylinuxXXXX_only.py b/test/test_manylinuxXXXX_only.py index 5efd0177..eb4599aa 100644 --- a/test/test_manylinuxXXXX_only.py +++ b/test/test_manylinuxXXXX_only.py @@ -65,6 +65,7 @@ def test(manylinux_image, tmp_path): "CIBW_MANYLINUX_PPC64LE_IMAGE": manylinux_image, "CIBW_MANYLINUX_S390X_IMAGE": manylinux_image, "CIBW_MANYLINUX_PYPY_AARCH64_IMAGE": manylinux_image, + "CIBW_MANYLINUX_PYPY_I686_IMAGE": manylinux_image, } if manylinux_image in {"manylinux1"}: # We don't have a manylinux1 image for PyPy diff --git a/test/utils.py b/test/utils.py index 96630e5d..844047bd 100644 --- a/test/utils.py +++ b/test/utils.py @@ -140,7 +140,7 @@ def expected_wheels( if platform == "linux": architectures = [machine_arch] - if machine_arch == "x86_64" and python_abi_tag.startswith("cp"): + if machine_arch == "x86_64": architectures.append("i686") platform_tags = [