Skip to content

Commit 5203f2a

Browse files
committed
Merge remote-tracking branch 'origin/main' into android
2 parents 16d2a45 + a76b6fc commit 5203f2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+492
-394
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ windows:
2929
variables:
3030
PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code
3131
before_script:
32-
- choco install python -y --version 3.12.4
32+
- choco install python -y --allow-downgrade --version 3.12.4
3333
rules:
3434
- if: '$CI_COMMIT_BRANCH == "main"'
3535
variables:

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ repos:
1414
- id: trailing-whitespace
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.11.11
17+
rev: v0.11.12
1818
hooks:
1919
- id: ruff
2020
args: ["--fix", "--show-fixes"]
2121
- id: ruff-format
2222

2323
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v1.15.0
24+
rev: v1.16.0
2525
hooks:
2626
- id: mypy
2727
name: mypy 3.11 on cibuildwheel/
@@ -88,7 +88,8 @@ repos:
8888
- id: check-github-actions
8989
- id: check-github-workflows
9090
- id: check-gitlab-ci
91-
- id: check-readthedocs
91+
# Disabled due to schema issue for now:
92+
# - id: check-readthedocs
9293
- id: check-travis
9394
- id: check-jsonschema
9495
name: Check projects

.readthedocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
version: 2
44

55
build:
6-
os: ubuntu-22.04
7-
tools:
8-
python: "3.12"
6+
os: ubuntu-24.04
97
commands:
8+
- asdf install python 3.14-dev
9+
- asdf global python 3.14-dev
1010
- asdf plugin add uv
1111
- asdf install uv latest
1212
- asdf global uv latest

README.md

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
- uses: actions/setup-python@v5
9898

9999
- name: Install cibuildwheel
100-
run: python -m pip install cibuildwheel==3.0.0b4
100+
run: python -m pip install cibuildwheel==3.0.0b5
101101

102102
- name: Build wheels
103103
run: python -m cibuildwheel --output-dir wheelhouse
@@ -179,8 +179,8 @@ Here are some repos that use cibuildwheel.
179179
|-----------------------------------|----|----|:------|
180180
| [scikit-learn][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The machine learning library. A complex but clean config using many of cibuildwheel's features to build a large project with Cython and C++ extensions. |
181181
| [pytorch-fairseq][] | ![github icon][] | ![apple icon][] ![linux icon][] | Facebook AI Research Sequence-to-Sequence Toolkit written in Python. |
182-
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The fundamental package for scientific computing with Python. |
183182
| [duckdb][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | DuckDB is an analytical in-process SQL database management system |
183+
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The fundamental package for scientific computing with Python. |
184184
| [Tornado][] | ![github icon][] | ![linux icon][] ![apple icon][] ![windows icon][] | Tornado is a Python web framework and asynchronous networking library. Uses stable ABI for a small C extension. |
185185
| [NCNN][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | ncnn is a high-performance neural network inference framework optimized for the mobile platform |
186186
| [Matplotlib][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The venerable Matplotlib, a Python library with C++ portions |
@@ -190,8 +190,8 @@ Here are some repos that use cibuildwheel.
190190

191191
[scikit-learn]: https://github.com/scikit-learn/scikit-learn
192192
[pytorch-fairseq]: https://github.com/facebookresearch/fairseq
193-
[NumPy]: https://github.com/numpy/numpy
194193
[duckdb]: https://github.com/duckdb/duckdb
194+
[NumPy]: https://github.com/numpy/numpy
195195
[Tornado]: https://github.com/tornadoweb/tornado
196196
[NCNN]: https://github.com/Tencent/ncnn
197197
[Matplotlib]: https://github.com/matplotlib/matplotlib
@@ -240,12 +240,24 @@ note to self, when doing final release, change to docs URLs in this section to t
240240
If you've used previous versions of the beta:
241241
- ⚠️ Previous betas of v3.0 changed the working directory for tests. This has been rolled back to the v2.x behaviour, so you might need to change configs if you adapted to the beta 1 or 2 behaviour. See [issue #2406](https://github.com/pypa/cibuildwheel/issues/2406) for more information.
242242
- ⚠️ GraalPy shipped with the identifier `gp242-*` in previous betas, this has been changed to `gp311_242-*` to be consistent with other interpreters, and to fix a bug with GraalPy and project requires-python detection. If you were using GraalPy, you might need to update your config to use the new identifier.
243+
- ⚠️ `test-sources` now uses `project` directory instead of the `package` directory (matching the docs).
244+
245+
#### v3.0.0b5
246+
247+
_3 June 2025_
248+
249+
- ✨ Support multiple commands on iOS, joined by `&&`, like the other platforms. (#2432)
250+
- ✨ Add `pyodide-prerelease` enable option, with an early build of 0.28 (Python 3.13). (#2431)
251+
- 🛠 test-sources now uses the `project` directory instead of the `package` directory (matching the docs). (#2437)
252+
- 🛠 Fixed a bug with GraalPy if vsdevcmd prints an error. Cirrus CI works again. (#2414)
253+
- 🛠 Use the standard Schema line for the integrated JSONSchema. (#2433)
254+
- 📚 Use Python 3.14 color output in docs CLI output. (#2407)
243255

244256
#### v3.0.0b4
245257

246258
_29 May 2025_
247259

248-
- 🛠 Dependency updates, including Python 3.14.0b2 (#2371)
260+
- 🛠 Dependency updates, including Python 3.14.0b2. (#2371)
249261
- 🛠 Remove the addition of `PYTHONSAFEPATH` to `test-environment`. (#2429)
250262
- 📚 README table now matches docs and auto-updates. (#2427, #2428)
251263

@@ -263,34 +275,7 @@ _25 May 2025_
263275
- ✨ Adds the [`CIBW_TEST_ENVIRONMENT`](https://cibuildwheel.pypa.io/en/latest/options/#test-environment) option, which allows you to set environment variables for the test command. cibuildwheel now sets `PYTHONSAFEPATH=1` in test environments by default, to avoid picking up package imports from the local directory - we want to test the installed wheel, not the source tree! You can change that, or any other environment variable in the test environment using this option. (#2388)
264276
- ✨ Improves support for Pyodide builds and adds the [`CIBW_PYODIDE_VERSION`](https://cibuildwheel.pypa.io/en/latest/options/#pyodide-version) option, which allows you to specify the version of Pyodide to use for builds. (#2002)
265277

266-
#### v3.0.0b1
267-
268-
_19 May 2025_
269-
270-
- 🌟 Adds the ability to [build wheels for iOS](https://cibuildwheel.pypa.io/en/latest/platforms/#ios)! Set the [`platform` option](https://cibuildwheel.pypa.io/en/latest/options/#platform) to `ios` on a Mac with the iOS toolchain to try it out!
271-
- 🌟 Adds support for the GraalPy interpreter! Enable for your project using the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable). (#1538)
272-
- ✨ Adds CPython 3.14 support, under the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable) `cpython-prerelease`. This version of cibuildwheel uses 3.14.0b1.
273-
274-
_While CPython is in beta, the ABI can change, so your wheels might not be compatible with the final release. For this reason, we don't recommend distributing wheels until RC1, at which point 3.14 will be available in cibuildwheel without the flag._ (#2390)
275-
- ✨ Adds the [test-sources option](https://cibuildwheel.pypa.io/en/latest/options/#test-sources), and changes the working directory for tests.
276-
277-
- If this option is set, cibuildwheel will copy the files and folders specified in `test-sources` into a temporary directory, and run the tests from there. This is required for iOS builds, but also useful for other platforms, as it allows you to test the installed wheel without any chance of accidentally importing from the source tree.
278-
- ~If this option is not set, cibuildwheel will run the tests in the source tree. This is a change from the previous behavior, where cibuildwheel would run the tests from a temporary directory. We're still investigating what's best here, so if you encounter any issues with this, please let us know in [issue #2406](https://github.com/pypa/cibuildwheel/issues/2406).~
279-
- If this option is not set, behaviour matches v2.x - cibuildwheel will run the tests from a temporary directory, and you can use the `{project}` placeholder in the `test-command` to refer to the project directory.
280-
281-
- ✨ Added´ `dependency-versions` inline syntax (#2123)
282-
- 🛠 The default [manylinux image](https://cibuildwheel.pypa.io/en/latest/options/#linux-image) has changed from `manylinux2014` to `manylinux_2_28` (#2330)
283-
- 🛠 Invokes `build` rather than `pip wheel` to build wheels by default. You can control this via the [`build-frontend`](https://cibuildwheel.pypa.io/en/latest/options/#build-frontend) option. You might notice that you can see your build log output now! (#2321)
284-
- 🛠 Removed the `CIBW_PRERELEASE_PYTHONS` and `CIBW_FREE_THREADED_SUPPORT` options - these have been folded into the [`enable`](https://cibuildwheel.pypa.io/en/latest/options/#enable) option instead. (#2095)
285-
- 🛠 EOL images `manylinux1`, `manylinux2010`, `manylinux_2_24` and `musllinux_1_1` can no longer be specified by their shortname. The full OCI name can still be used for these images, if you wish (#2316)
286-
- 🛠 Build environments no longer have setuptools and wheel preinstalled. (#2329)
287-
- ⚠️ Dropped support for building Python 3.6 and 3.7 wheels. If you need to build wheels for these versions, use cibuildwheel v2.23.3 or earlier. (#2282)
288-
- ⚠️ The minimum Python version required to run cibuildwheel is now Python 3.11. You can still build wheels for Python 3.8 and newer. (#1912)
289-
- ⚠️ PyPy wheels no longer built by default, due to a change to our options system. To continue building PyPy wheels, you'll now need to set the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable) to `pypy` or `pypy-eol`. (#2095)
290-
- ⚠️ Dropped official support for Appveyor. If it was working for you before, it will probably continue to do so, but we can't be sure, because our CI doesn't run there anymore. (#2386)
291-
- 📚 A reorganisation of the docs, and numerous updates (#2280)
292-
293-
<!-- [[[end]]] (checksum: b231dd6d65d5003b403f91d925140069) -->
278+
<!-- [[[end]]] (checksum: c95d170eee4d70055d927723c033426a) -->
294279

295280
---
296281

bin/generate_schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@
3333
description: How to inherit the parent's value.
3434
enable:
3535
enum:
36+
- cpython-experimental-riscv64
3637
- cpython-freethreading
3738
- cpython-prerelease
39+
- graalpy
40+
- pyodide-prerelease
3841
- pypy
3942
- pypy-eol
40-
- cpython-experimental-riscv64
4143
description: A Python version or flavor to enable.
4244
additionalProperties: false
4345
description: cibuildwheel's settings.

bin/projects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def fetch_icon(icon_name: str) -> None:
135135

136136
document = xml.dom.minidom.parseString(original_svg_data)
137137
svgElement = document.documentElement
138+
assert svgElement is not None
138139
assert svgElement.nodeName == "svg"
139140
svgElement.setAttribute("width", "16px")
140141
svgElement.setAttribute("fill", "#606060")

cibuildwheel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.0.0b4"
1+
__version__ = "3.0.0b5"

cibuildwheel/platforms/ios.py

Lines changed: 49 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from ..options import Options
2525
from ..selector import BuildSelector
2626
from ..util import resources
27-
from ..util.cmd import call, shell
27+
from ..util.cmd import call, shell, split_command
2828
from ..util.file import (
2929
CIBW_CACHE_PATH,
3030
copy_test_sources,
@@ -564,7 +564,7 @@ def build(options: Options, tmp_path: Path) -> None:
564564
if build_options.test_sources:
565565
copy_test_sources(
566566
build_options.test_sources,
567-
build_options.package_dir,
567+
Path.cwd(),
568568
testbed_app_path,
569569
)
570570
else:
@@ -617,62 +617,58 @@ def build(options: Options, tmp_path: Path) -> None:
617617
)
618618
raise errors.FatalError(msg)
619619

620-
test_command_parts = shlex.split(build_options.test_command)
621-
if test_command_parts[0:2] != ["python", "-m"]:
622-
first_part = test_command_parts[0]
623-
if first_part == "pytest":
624-
# pytest works exactly the same as a module, so we
625-
# can just run it as a module.
626-
log.warning(
627-
unwrap_preserving_paragraphs(f"""
628-
iOS tests configured with a test command which doesn't start
629-
with 'python -m'. iOS tests must execute python modules - other
630-
entrypoints are not supported.
631-
632-
cibuildwheel will try to execute it as if it started with
633-
'python -m'. If this works, all you need to do is add that to
634-
your test command.
635-
636-
Test command: {build_options.test_command!r}
637-
""")
638-
)
639-
else:
640-
msg = unwrap_preserving_paragraphs(
641-
f"""
642-
iOS tests configured with a test command which doesn't start
643-
with 'python -m'. iOS tests must execute python modules - other
644-
entrypoints are not supported.
645-
646-
Test command: {build_options.test_command!r}
647-
"""
648-
)
649-
raise errors.FatalError(msg)
650-
else:
651-
# the testbed run command actually doesn't want the
652-
# python -m prefix - it's implicit, so we remove it
653-
# here.
654-
test_command_parts = test_command_parts[2:]
655-
620+
test_command_list = shlex.split(build_options.test_command)
656621
try:
657-
call(
658-
"python",
659-
testbed_path,
660-
"run",
661-
*(["--verbose"] if build_options.build_verbosity > 0 else []),
662-
"--",
663-
*test_command_parts,
664-
env=test_env,
665-
)
666-
failed = False
622+
for test_command_parts in split_command(test_command_list):
623+
match test_command_parts:
624+
case ["python", "-m", *rest]:
625+
final_command = rest
626+
case ["pytest", *rest]:
627+
# pytest works exactly the same as a module, so we
628+
# can just run it as a module.
629+
msg = unwrap_preserving_paragraphs(f"""
630+
iOS tests configured with a test command which doesn't start
631+
with 'python -m'. iOS tests must execute python modules - other
632+
entrypoints are not supported.
633+
634+
cibuildwheel will try to execute it as if it started with
635+
'python -m'. If this works, all you need to do is add that to
636+
your test command.
637+
638+
Test command: {build_options.test_command!r}
639+
""")
640+
log.warning(msg)
641+
final_command = ["pytest", *rest]
642+
case _:
643+
msg = unwrap_preserving_paragraphs(
644+
f"""
645+
iOS tests configured with a test command which doesn't start
646+
with 'python -m'. iOS tests must execute python modules - other
647+
entrypoints are not supported.
648+
649+
Test command: {build_options.test_command!r}
650+
"""
651+
)
652+
raise errors.FatalError(msg)
653+
654+
call(
655+
"python",
656+
testbed_path,
657+
"run",
658+
*(["--verbose"] if build_options.build_verbosity > 0 else []),
659+
"--",
660+
*final_command,
661+
env=test_env,
662+
)
667663
except subprocess.CalledProcessError:
668-
failed = True
669-
670-
log.step_end(success=not failed)
671-
672-
if failed:
664+
# catches the first test command failure in the loop,
665+
# implementing short-circuiting
666+
log.step_end(success=False)
673667
log.error(f"Test suite failed on {config.identifier}")
674668
sys.exit(1)
675669

670+
log.step_end()
671+
676672
# We're all done here; move it to output (overwrite existing)
677673
if compatible_wheel is None:
678674
output_wheel = build_options.output_dir.joinpath(built_wheel.name)

cibuildwheel/platforms/linux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def build_in_container(
403403
if build_options.test_sources:
404404
copy_test_sources(
405405
build_options.test_sources,
406-
build_options.package_dir,
406+
Path.cwd(),
407407
test_cwd,
408408
copy_into=container.copy_into,
409409
)

cibuildwheel/platforms/macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def build(options: Options, tmp_path: Path) -> None:
712712
test_cwd.mkdir()
713713
copy_test_sources(
714714
build_options.test_sources,
715-
build_options.package_dir,
715+
Path.cwd(),
716716
test_cwd,
717717
)
718718
else:

0 commit comments

Comments
 (0)