Skip to content

Commit d47b080

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/distinct-pyodide-build
2 parents 1061775 + 93314a8 commit d47b080

34 files changed

+605
-161
lines changed

.github/workflows/test.yml

+1-11
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ${{ matrix.os }}
3737
strategy:
3838
matrix:
39-
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
39+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-15]
4040
python_version: ['3.13']
4141
include:
4242
- os: ubuntu-latest
@@ -63,11 +63,6 @@ jobs:
6363
- name: Set up QEMU
6464
if: runner.os == 'Linux'
6565
uses: docker/setup-qemu-action@v3
66-
with:
67-
# This should be temporary
68-
# xref https://github.com/docker/setup-qemu-action/issues/188
69-
# xref https://github.com/tonistiigi/binfmt/issues/215
70-
image: tonistiigi/binfmt:qemu-v8.1.5
7166

7267
- name: Install dependencies
7368
run: |
@@ -169,11 +164,6 @@ jobs:
169164

170165
- name: Set up QEMU
171166
uses: docker/setup-qemu-action@v3
172-
with:
173-
# This should be temporary
174-
# xref https://github.com/docker/setup-qemu-action/issues/188
175-
# xref https://github.com/tonistiigi/binfmt/issues/215
176-
image: tonistiigi/binfmt:qemu-v8.1.5
177167

178168
- name: Run the emulation tests
179169
run: uv run pytest --run-emulation ${{ matrix.arch }} test/test_emulation.py

.github/workflows/update-dependencies.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
# we use this step to grab a Github App auth token, so that PRs generated by this workflow
2525
# run the GHA tests.
26-
- uses: actions/create-github-app-token@v1
26+
- uses: actions/create-github-app-token@v2
2727
id: generate-token
2828
if: github.ref == 'refs/heads/main' && github.repository == 'pypa/cibuildwheel'
2929
with:

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: trailing-whitespace
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.11.2
17+
rev: v0.11.4
1818
hooks:
1919
- id: ruff
2020
args: ["--fix", "--show-fixes"]
@@ -81,7 +81,7 @@ repos:
8181

8282

8383
- repo: https://github.com/python-jsonschema/check-jsonschema
84-
rev: 0.31.3
84+
rev: 0.32.1
8585
hooks:
8686
- id: check-dependabot
8787
- id: check-github-actions

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ Options
139139
| | [`CIBW_ENVIRONMENT_PASS_LINUX`](https://cibuildwheel.pypa.io/en/stable/options/#environment-pass) | Set environment variables on the host to pass-through to the container during the build. |
140140
| | [`CIBW_BEFORE_ALL`](https://cibuildwheel.pypa.io/en/stable/options/#before-all) | Execute a shell command on the build system before any wheels are built. |
141141
| | [`CIBW_BEFORE_BUILD`](https://cibuildwheel.pypa.io/en/stable/options/#before-build) | Execute a shell command preparing each wheel's build |
142+
| | [`CIBW_XBUILD_TOOLS`](https://cibuildwheel.pypa.io/en/stable/options/#xbuild-tools) | Binaries on the path that should be included in an isolated cross-build environment. |
142143
| | [`CIBW_REPAIR_WHEEL_COMMAND`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command) | Execute a shell command to repair each built wheel |
143144
| | [`CIBW_MANYLINUX_*_IMAGE`<br/>`CIBW_MUSLLINUX_*_IMAGE`](https://cibuildwheel.pypa.io/en/stable/options/#linux-image) | Specify alternative manylinux / musllinux Docker images |
144145
| | [`CIBW_CONTAINER_ENGINE`](https://cibuildwheel.pypa.io/en/stable/options/#container-engine) | Specify which container engine to use when building Linux wheels |

azure-pipelines.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pr:
77
jobs:
88
- job: linux_311
99
timeoutInMinutes: 120
10-
pool: {vmImage: 'Ubuntu-20.04'}
10+
pool: {vmImage: 'Ubuntu-22.04'}
1111
steps:
1212
- task: UsePythonVersion@0
1313
inputs:
@@ -27,7 +27,7 @@ jobs:
2727
- bash: |
2828
python -m pip install dependency-groups
2929
python -m dependency_groups test | xargs python -m pip install -e.
30-
python ./bin/run_tests.py --num-processes 2
30+
python ./bin/run_tests.py
3131
3232
- job: windows_311
3333
pool: {vmImage: 'windows-2019'}

bin/generate_schema.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,15 @@
181181
musllinux-x86_64-image:
182182
type: string
183183
description: Specify alternative manylinux / musllinux container images
184+
xbuild-tools:
185+
description: Binaries on the path that should be included in an isolated cross-build environment
186+
type: string_array
184187
pyodide-version:
185188
type: string
186189
description: Specify the version of Pyodide to use
187190
repair-wheel-command:
188-
type: string_array
189191
description: Execute a shell command to repair each built wheel.
192+
type: string_array
190193
skip:
191194
description: Choose the Python versions to skip.
192195
type: string_array
@@ -276,6 +279,7 @@
276279
properties:
277280
before-all: {"$ref": "#/$defs/inherit"}
278281
before-build: {"$ref": "#/$defs/inherit"}
282+
xbuild-tools: {"$ref": "#/$defs/inherit"}
279283
before-test: {"$ref": "#/$defs/inherit"}
280284
config-settings: {"$ref": "#/$defs/inherit"}
281285
container-engine: {"$ref": "#/$defs/inherit"}

bin/run_tests.py

+36-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
from pathlib import Path
99

1010
if __name__ == "__main__":
11-
default_cpu_count = os.cpu_count() or 2
11+
if sys.version_info < (3, 13):
12+
default_cpu_count = os.cpu_count() or 2
13+
else:
14+
default_cpu_count = os.process_cpu_count() or 2
15+
1216
parser = argparse.ArgumentParser()
1317
parser.add_argument(
1418
"--run-podman", action="store_true", default=False, help="run podman tests (linux only)"
@@ -34,15 +38,39 @@
3438
if args.run_podman:
3539
unit_test_args += ["--run-podman"]
3640

41+
print(
42+
"\n\n================================== UNIT TESTS ==================================",
43+
flush=True,
44+
)
3745
subprocess.run(unit_test_args, check=True)
3846

39-
# integration tests
47+
# Run the serial integration tests without multiple processes
48+
serial_integration_test_args = [
49+
sys.executable,
50+
"-m",
51+
"pytest",
52+
"-m",
53+
"serial",
54+
"-x",
55+
"--durations",
56+
"0",
57+
"--timeout=2400",
58+
"test",
59+
"-vv",
60+
]
61+
print(
62+
"\n\n=========================== SERIAL INTEGRATION TESTS ===========================",
63+
flush=True,
64+
)
65+
subprocess.run(serial_integration_test_args, check=True)
66+
67+
# Non-serial integration tests
4068
integration_test_args = [
4169
sys.executable,
4270
"-m",
4371
"pytest",
44-
"--dist",
45-
"loadgroup",
72+
"-m",
73+
"not serial",
4674
f"--numprocesses={args.num_processes}",
4775
"-x",
4876
"--durations",
@@ -55,4 +83,8 @@
5583
if sys.platform.startswith("linux") and args.run_podman:
5684
integration_test_args += ["--run-podman"]
5785

86+
print(
87+
"\n\n========================= NON-SERIAL INTEGRATION TESTS =========================",
88+
flush=True,
89+
)
5890
subprocess.run(integration_test_args, check=True)

cibuildwheel/frontend.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@ def options_summary(self) -> str | dict[str, str]:
3737

3838

3939
def _get_verbosity_flags(level: int, frontend: BuildFrontendName) -> list[str]:
40-
if frontend == "pip":
41-
if level > 0:
42-
return ["-" + level * "v"]
43-
if level < 0:
40+
if level < 0:
41+
if frontend == "pip":
4442
return ["-" + -level * "q"]
45-
elif not 0 <= level < 2:
43+
4644
msg = f"build_verbosity {level} is not supported for {frontend} frontend. Ignoring."
4745
log.warning(msg)
46+
47+
if level > 0:
48+
if frontend == "pip":
49+
return ["-" + level * "v"]
50+
if level > 1:
51+
return ["-" + (level - 1) * "v"]
52+
4853
return []
4954

5055

cibuildwheel/options.py

+14
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class BuildOptions:
9494
environment: ParsedEnvironment
9595
before_all: str
9696
before_build: str | None
97+
xbuild_tools: list[str] | None
9798
repair_command: str
9899
manylinux_images: dict[str, str] | None
99100
musllinux_images: dict[str, str] | None
@@ -719,6 +720,18 @@ def _compute_build_options(self, identifier: str | None) -> BuildOptions:
719720

720721
test_command = self.reader.get("test-command", option_format=ListFormat(sep=" && "))
721722
before_test = self.reader.get("before-test", option_format=ListFormat(sep=" && "))
723+
xbuild_tools: list[str] | None = shlex.split(
724+
self.reader.get(
725+
"xbuild-tools", option_format=ListFormat(sep=" ", quote=shlex.quote)
726+
)
727+
)
728+
# ["\u0000"] is a sentinel value used as a default, because TOML
729+
# doesn't have an explicit NULL value. If xbuild-tools is set to the
730+
# sentinel, it indicates that the user hasn't defined xbuild-tools
731+
# *at all* (not even an `xbuild-tools = []` definition).
732+
if xbuild_tools == ["\u0000"]:
733+
xbuild_tools = None
734+
722735
test_sources = shlex.split(
723736
self.reader.get(
724737
"test-sources", option_format=ListFormat(sep=" ", quote=shlex.quote)
@@ -838,6 +851,7 @@ def _compute_build_options(self, identifier: str | None) -> BuildOptions:
838851
before_build=before_build,
839852
before_all=before_all,
840853
build_verbosity=build_verbosity,
854+
xbuild_tools=xbuild_tools,
841855
repair_command=repair_command,
842856
environment=environment,
843857
dependency_constraints=dependency_constraints,

0 commit comments

Comments
 (0)