diff --git a/bin/generate_schema.py b/bin/generate_schema.py index 8ca6a1a7..728a5a56 100755 --- a/bin/generate_schema.py +++ b/bin/generate_schema.py @@ -31,6 +31,7 @@ $defs: - cpython-freethreading - cpython-prerelease - pypy + - cpython-experimental-riscv64 description: A Python version or flavor to enable. additionalProperties: false description: cibuildwheel's settings. @@ -157,6 +158,9 @@ properties: manylinux-pypy_x86_64-image: type: string description: Specify alternative manylinux / musllinux container images + manylinux-riscv64-image: + type: string + description: Specify alternative manylinux / musllinux container images manylinux-s390x-image: type: string description: Specify alternative manylinux / musllinux container images @@ -175,6 +179,9 @@ properties: musllinux-ppc64le-image: type: string description: Specify alternative manylinux / musllinux container images + musllinux-riscv64-image: + type: string + description: Specify alternative manylinux / musllinux container images musllinux-s390x-image: type: string description: Specify alternative manylinux / musllinux container images diff --git a/bin/update_docker.py b/bin/update_docker.py index 3f23d75d..efb90154 100755 --- a/bin/update_docker.py +++ b/bin/update_docker.py @@ -116,5 +116,8 @@ for image in images: suffix = f"_{platform.removeprefix('pypy_')}" config[platform][image.manylinux_version] = f"{image.image_name}{suffix}:{tag_name}" +if not config.has_section("riscv64"): + config["riscv64"] = {} + with open(RESOURCES / "pinned_docker_images.cfg", "w") as f: config.write(f) diff --git a/cibuildwheel/architecture.py b/cibuildwheel/architecture.py index de17c75d..0ac2f1a1 100644 --- a/cibuildwheel/architecture.py +++ b/cibuildwheel/architecture.py @@ -51,6 +51,7 @@ class Architecture(StrEnum): ppc64le = auto() s390x = auto() armv7l = auto() + riscv64 = auto() # mac archs universal2 = auto() @@ -167,6 +168,7 @@ class Architecture(StrEnum): Architecture.ppc64le, Architecture.s390x, Architecture.armv7l, + Architecture.riscv64, }, "macos": {Architecture.x86_64, Architecture.arm64, Architecture.universal2}, "windows": {Architecture.x86, Architecture.AMD64, Architecture.ARM64}, diff --git a/cibuildwheel/logger.py b/cibuildwheel/logger.py index 391786a0..321352e8 100644 --- a/cibuildwheel/logger.py +++ b/cibuildwheel/logger.py @@ -22,12 +22,14 @@ PLATFORM_IDENTIFIER_DESCRIPTIONS: Final[dict[str, str]] = { "manylinux_ppc64le": "manylinux ppc64le", "manylinux_s390x": "manylinux s390x", "manylinux_armv7l": "manylinux armv7l", + "manylinux_riscv64": "manylinux riscv64", "musllinux_x86_64": "musllinux x86_64", "musllinux_i686": "musllinux i686", "musllinux_aarch64": "musllinux aarch64", "musllinux_ppc64le": "musllinux ppc64le", "musllinux_s390x": "musllinux s390x", "musllinux_armv7l": "musllinux armv7l", + "musllinux_riscv64": "musllinux riscv64", "win32": "Windows 32bit", "win_amd64": "Windows 64bit", "win_arm64": "Windows on ARM 64bit", diff --git a/cibuildwheel/oci_container.py b/cibuildwheel/oci_container.py index 3a4a4995..fa3d7704 100644 --- a/cibuildwheel/oci_container.py +++ b/cibuildwheel/oci_container.py @@ -33,6 +33,7 @@ class OCIPlatform(Enum): ARMV7 = "linux/arm/v7" ARM64 = "linux/arm64" PPC64LE = "linux/ppc64le" + RISCV64 = "linux/riscv64" S390X = "linux/s390x" diff --git a/cibuildwheel/options.py b/cibuildwheel/options.py index b0177e0c..283f48f7 100644 --- a/cibuildwheel/options.py +++ b/cibuildwheel/options.py @@ -35,6 +35,7 @@ MANYLINUX_ARCHS: Final[tuple[str, ...]] = ( "ppc64le", "s390x", "armv7l", + "riscv64", "pypy_aarch64", "pypy_i686", ) @@ -46,6 +47,7 @@ MUSLLINUX_ARCHS: Final[tuple[str, ...]] = ( "ppc64le", "s390x", "armv7l", + "riscv64", ) diff --git a/cibuildwheel/platforms/linux.py b/cibuildwheel/platforms/linux.py index 4932298a..e39a24e0 100644 --- a/cibuildwheel/platforms/linux.py +++ b/cibuildwheel/platforms/linux.py @@ -28,6 +28,7 @@ ARCHITECTURE_OCI_PLATFORM_MAP = { Architecture.ppc64le: OCIPlatform.PPC64LE, Architecture.s390x: OCIPlatform.S390X, Architecture.armv7l: OCIPlatform.ARMV7, + Architecture.riscv64: OCIPlatform.RISCV64, } diff --git a/cibuildwheel/resources/build-platforms.toml b/cibuildwheel/resources/build-platforms.toml index d8bf3833..d2ad15e0 100644 --- a/cibuildwheel/resources/build-platforms.toml +++ b/cibuildwheel/resources/build-platforms.toml @@ -46,6 +46,13 @@ python_configurations = [ { identifier = "cp312-manylinux_armv7l", version = "3.12", path_str = "/opt/python/cp312-cp312" }, { identifier = "cp313-manylinux_armv7l", version = "3.13", path_str = "/opt/python/cp313-cp313" }, { identifier = "cp313t-manylinux_armv7l", version = "3.13", path_str = "/opt/python/cp313-cp313t" }, + { identifier = "cp38-manylinux_riscv64", version = "3.8", path_str = "/opt/python/cp38-cp38" }, + { identifier = "cp39-manylinux_riscv64", version = "3.9", path_str = "/opt/python/cp39-cp39" }, + { identifier = "cp310-manylinux_riscv64", version = "3.10", path_str = "/opt/python/cp310-cp310" }, + { identifier = "cp311-manylinux_riscv64", version = "3.11", path_str = "/opt/python/cp311-cp311" }, + { identifier = "cp312-manylinux_riscv64", version = "3.12", path_str = "/opt/python/cp312-cp312" }, + { identifier = "cp313-manylinux_riscv64", version = "3.13", path_str = "/opt/python/cp313-cp313" }, + { identifier = "cp313t-manylinux_riscv64", version = "3.13", path_str = "/opt/python/cp313-cp313t" }, { identifier = "pp38-manylinux_aarch64", version = "3.8", path_str = "/opt/python/pp38-pypy38_pp73" }, { identifier = "pp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" }, { identifier = "pp310-manylinux_aarch64", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" }, @@ -96,6 +103,13 @@ python_configurations = [ { identifier = "cp312-musllinux_armv7l", version = "3.12", path_str = "/opt/python/cp312-cp312" }, { identifier = "cp313-musllinux_armv7l", version = "3.13", path_str = "/opt/python/cp313-cp313" }, { identifier = "cp313t-musllinux_armv7l", version = "3.13", path_str = "/opt/python/cp313-cp313t" }, + { identifier = "cp38-musllinux_riscv64", version = "3.8", path_str = "/opt/python/cp38-cp38" }, + { identifier = "cp39-musllinux_ricv64", version = "3.9", path_str = "/opt/python/cp39-cp39" }, + { identifier = "cp310-musllinux_riscv64", version = "3.10", path_str = "/opt/python/cp310-cp310" }, + { identifier = "cp311-musllinux_riscv64", version = "3.11", path_str = "/opt/python/cp311-cp311" }, + { identifier = "cp312-musllinux_riscv64", version = "3.12", path_str = "/opt/python/cp312-cp312" }, + { identifier = "cp313-musllinux_riscv64", version = "3.13", path_str = "/opt/python/cp313-cp313" }, + { identifier = "cp313t-musllinux_riscv64", version = "3.13", path_str = "/opt/python/cp313-cp313t" }, ] [macos] diff --git a/cibuildwheel/resources/cibuildwheel.schema.json b/cibuildwheel/resources/cibuildwheel.schema.json index 10e07cc1..46ad0020 100644 --- a/cibuildwheel/resources/cibuildwheel.schema.json +++ b/cibuildwheel/resources/cibuildwheel.schema.json @@ -15,7 +15,8 @@ "enum": [ "cpython-freethreading", "cpython-prerelease", - "pypy" + "pypy", + "cpython-experimental-riscv64" ] }, "description": "A Python version or flavor to enable." @@ -357,6 +358,11 @@ "description": "Specify alternative manylinux / musllinux container images", "title": "CIBW_MANYLINUX_PYPY_X86_64_IMAGE" }, + "manylinux-riscv64-image": { + "type": "string", + "description": "Specify alternative manylinux / musllinux container images", + "title": "CIBW_MANYLINUX_RISCV64_IMAGE" + }, "manylinux-s390x-image": { "type": "string", "description": "Specify alternative manylinux / musllinux container images", @@ -387,6 +393,11 @@ "description": "Specify alternative manylinux / musllinux container images", "title": "CIBW_MUSLLINUX_PPC64LE_IMAGE" }, + "musllinux-riscv64-image": { + "type": "string", + "description": "Specify alternative manylinux / musllinux container images", + "title": "CIBW_MUSLLINUX_RISCV64_IMAGE" + }, "musllinux-s390x-image": { "type": "string", "description": "Specify alternative manylinux / musllinux container images", @@ -566,6 +577,9 @@ "before-build": { "$ref": "#/$defs/inherit" }, + "xbuild-tools": { + "$ref": "#/$defs/inherit" + }, "before-test": { "$ref": "#/$defs/inherit" }, @@ -581,9 +595,6 @@ "environment-pass": { "$ref": "#/$defs/inherit" }, - "xbuild-tools": { - "$ref": "#/$defs/inherit" - }, "repair-wheel-command": { "$ref": "#/$defs/inherit" }, @@ -652,6 +663,9 @@ "manylinux-pypy_x86_64-image": { "$ref": "#/properties/manylinux-pypy_x86_64-image" }, + "manylinux-riscv64-image": { + "$ref": "#/properties/manylinux-riscv64-image" + }, "manylinux-s390x-image": { "$ref": "#/properties/manylinux-s390x-image" }, @@ -670,12 +684,18 @@ "musllinux-ppc64le-image": { "$ref": "#/properties/musllinux-ppc64le-image" }, + "musllinux-riscv64-image": { + "$ref": "#/properties/musllinux-riscv64-image" + }, "musllinux-s390x-image": { "$ref": "#/properties/musllinux-s390x-image" }, "musllinux-x86_64-image": { "$ref": "#/properties/musllinux-x86_64-image" }, + "xbuild-tools": { + "$ref": "#/properties/xbuild-tools" + }, "repair-wheel-command": { "$ref": "#/properties/repair-wheel-command" }, @@ -752,6 +772,9 @@ "manylinux-pypy_x86_64-image": { "$ref": "#/properties/manylinux-pypy_x86_64-image" }, + "manylinux-riscv64-image": { + "$ref": "#/properties/manylinux-riscv64-image" + }, "manylinux-s390x-image": { "$ref": "#/properties/manylinux-s390x-image" }, @@ -770,12 +793,18 @@ "musllinux-ppc64le-image": { "$ref": "#/properties/musllinux-ppc64le-image" }, + "musllinux-riscv64-image": { + "$ref": "#/properties/musllinux-riscv64-image" + }, "musllinux-s390x-image": { "$ref": "#/properties/musllinux-s390x-image" }, "musllinux-x86_64-image": { "$ref": "#/properties/musllinux-x86_64-image" }, + "xbuild-tools": { + "$ref": "#/properties/xbuild-tools" + }, "repair-wheel-command": { "description": "Execute a shell command to repair each built wheel.", "oneOf": [ @@ -840,6 +869,9 @@ "environment": { "$ref": "#/properties/environment" }, + "xbuild-tools": { + "$ref": "#/properties/xbuild-tools" + }, "repair-wheel-command": { "$ref": "#/properties/repair-wheel-command" }, @@ -891,6 +923,9 @@ "environment": { "$ref": "#/properties/environment" }, + "xbuild-tools": { + "$ref": "#/properties/xbuild-tools" + }, "repair-wheel-command": { "description": "Execute a shell command to repair each built wheel.", "oneOf": [ @@ -955,6 +990,9 @@ "environment": { "$ref": "#/properties/environment" }, + "xbuild-tools": { + "$ref": "#/properties/xbuild-tools" + }, "repair-wheel-command": { "$ref": "#/properties/repair-wheel-command" }, @@ -1006,22 +1044,28 @@ "environment": { "$ref": "#/properties/environment" }, - "repair-wheel-command": { - "$ref": "#/properties/repair-wheel-command" - }, "xbuild-tools": { "$ref": "#/properties/xbuild-tools" }, + "repair-wheel-command": { + "$ref": "#/properties/repair-wheel-command" + }, "test-command": { "$ref": "#/properties/test-command" }, "test-extras": { "$ref": "#/properties/test-extras" }, + "test-sources": { + "$ref": "#/properties/test-sources" + }, + "test-groups": { + "$ref": "#/properties/test-groups" + }, "test-requires": { "$ref": "#/properties/test-requires" } - } + } } } } diff --git a/cibuildwheel/resources/defaults.toml b/cibuildwheel/resources/defaults.toml index 8ca42455..4d03394f 100644 --- a/cibuildwheel/resources/defaults.toml +++ b/cibuildwheel/resources/defaults.toml @@ -33,6 +33,7 @@ manylinux-aarch64-image = "manylinux_2_28" manylinux-ppc64le-image = "manylinux_2_28" manylinux-s390x-image = "manylinux_2_28" manylinux-armv7l-image = "manylinux_2_31" +manylinux-riscv64-image = "ghcr.io/pypa/cibuildwheel/no_default_image:please_use_override" manylinux-pypy_x86_64-image = "manylinux_2_28" manylinux-pypy_i686-image = "manylinux2014" manylinux-pypy_aarch64-image = "manylinux_2_28" @@ -43,6 +44,7 @@ musllinux-aarch64-image = "musllinux_1_2" musllinux-ppc64le-image = "musllinux_1_2" musllinux-s390x-image = "musllinux_1_2" musllinux-armv7l-image = "musllinux_1_2" +musllinux-riscv64-image = "ghcr.io/pypa/cibuildwheel/no_default_image:please_use_override" [tool.cibuildwheel.linux] diff --git a/cibuildwheel/resources/pinned_docker_images.cfg b/cibuildwheel/resources/pinned_docker_images.cfg index 528a4eeb..7a9962a3 100644 --- a/cibuildwheel/resources/pinned_docker_images.cfg +++ b/cibuildwheel/resources/pinned_docker_images.cfg @@ -43,3 +43,5 @@ manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64:2025.04.19-1 manylinux_2_31 = quay.io/pypa/manylinux_2_31_armv7l:2025.04.19-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_armv7l:2025.04.19-1 +[riscv64] + diff --git a/cibuildwheel/selector.py b/cibuildwheel/selector.py index 0e9736f5..98c7a660 100644 --- a/cibuildwheel/selector.py +++ b/cibuildwheel/selector.py @@ -32,6 +32,7 @@ class EnableGroup(StrEnum): CPythonFreeThreading = "cpython-freethreading" CPythonPrerelease = "cpython-prerelease" PyPy = "pypy" + CPythonExperimentalRiscV64 = "cpython-experimental-riscv64" @classmethod def all_groups(cls) -> frozenset["EnableGroup"]: @@ -70,6 +71,10 @@ class BuildSelector: return False if EnableGroup.PyPy not in self.enable and fnmatch(build_id, "pp*"): return False + if EnableGroup.CPythonExperimentalRiscV64 not in self.enable and fnmatch( + build_id, "*_riscv64" + ): + return False should_build = selector_matches(self.build_config, build_id) should_skip = selector_matches(self.skip_config, build_id) diff --git a/docs/options.md b/docs/options.md index de4317b4..9d906b0c 100644 --- a/docs/options.md +++ b/docs/options.md @@ -50,23 +50,24 @@ When setting the options, you can use shell-style globbing syntax, as per [fnmat
-| | macOS | Windows | Linux Intel | Linux Other | iOS | -|---------------|------------------------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| -| Python 3.8 | cp38-macosx_x86_64