Skip to content

Commit 969c331

Browse files
authored
Merge pull request matplotlib#31951 from meeseeksmachine/auto-backport-of-pr-30252-on-v3.11.x
Backport PR matplotlib#30252 on branch v3.11.x (Move cibuildwheel configuration to pyproject.toml)
2 parents cb535dd + 30fb47d commit 969c331

3 files changed

Lines changed: 40 additions & 29 deletions

File tree

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- any-glob-to-any-file:
55
- '.github/workflows/cibuildwheel.yml'
66
- '.github/workflows/wasm.yml'
7+
- 'pyproject.toml'
78
"CI: Run cygwin":
89
- changed-files:
910
- any-glob-to-any-file: ['.github/workflows/cygwin.yml']

.github/workflows/cibuildwheel.yml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -97,31 +97,6 @@ jobs:
9797
permissions:
9898
contents: read
9999
runs-on: ${{ matrix.os }}
100-
env:
101-
CIBW_BEFORE_BUILD: >-
102-
rm -rf {package}/build
103-
CIBW_BEFORE_BUILD_WINDOWS: >-
104-
pip install delvewheel &&
105-
rm -rf {package}/build
106-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
107-
delvewheel repair -w {dest_dir} {wheel}
108-
CIBW_AFTER_BUILD: >-
109-
twine check {wheel} &&
110-
python {package}/ci/check_wheel_licenses.py {wheel}
111-
# On Windows, we explicitly request MSVC compilers (as GitHub Action runners have
112-
# MinGW on PATH that would be picked otherwise), switch to a static build for
113-
# runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`,
114-
# and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while
115-
# keeping shared state with the rest of the Python process/extensions.
116-
CIBW_CONFIG_SETTINGS_WINDOWS: >-
117-
setup-args="--vsenv"
118-
setup-args="-Db_vscrt=mt"
119-
setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']"
120-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
121-
CIBW_SKIP: "*-musllinux_aarch64"
122-
CIBW_TEST_COMMAND: >-
123-
python {package}/ci/check_version_number.py
124-
MACOSX_DEPLOYMENT_TARGET: "10.12"
125100
strategy:
126101
matrix:
127102
include:
@@ -155,17 +130,14 @@ jobs:
155130
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
156131
env:
157132
CIBW_BUILD: "cp314-* cp314t-*"
158-
CIBW_ENABLE: "cpython-freethreading cpython-prerelease"
159133
CIBW_ARCHS: ${{ matrix.cibw_archs }}
160-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
161134

162135
- name: Build wheels for CPython 3.13
163136
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
164137
with:
165138
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
166139
env:
167-
CIBW_BUILD: "cp313-* cp313t-*"
168-
CIBW_ENABLE: cpython-freethreading
140+
CIBW_BUILD: "cp313-*"
169141
CIBW_ARCHS: ${{ matrix.cibw_archs }}
170142

171143
- name: Build wheels for CPython 3.12

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,21 @@ addopts = [
401401
"--import-mode=importlib",
402402
]
403403

404+
[tool.cibuildwheel]
405+
enable = ["cpython-freethreading"]
406+
skip = "*-musllinux_aarch64"
407+
manylinux-x86_64-image = "manylinux2014"
408+
409+
before-build = "rm -rf {package}/build"
410+
test-command = [
411+
# "python {package}/ci/check_wheel_licenses.py {wheel}",
412+
"python {package}/ci/check_version_number.py",
413+
]
414+
test-environment = "PIP_PREFER_BINARY=true"
415+
416+
[tool.cibuildwheel.macos.environment]
417+
MACOSX_DEPLOYMENT_TARGET = "10.12"
418+
404419
[tool.cibuildwheel.pyodide]
405420
test-requires = "pytest"
406421
test-command = [
@@ -423,3 +438,26 @@ test-command = [
423438
CFLAGS = "-fexceptions"
424439
CXXFLAGS = "-fexceptions"
425440
LDFLAGS = "-fexceptions"
441+
442+
[tool.cibuildwheel.windows]
443+
before-build = [
444+
"pip install delvewheel",
445+
"rm -rf {package}/build",
446+
]
447+
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"
448+
449+
[tool.cibuildwheel.windows.config-settings]
450+
# On Windows, we explicitly request MSVC compilers (as GitHub Action runners have
451+
# MinGW on PATH that would be picked otherwise), switch to a static build for
452+
# runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`,
453+
# and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while
454+
# keeping shared state with the rest of the Python process/extensions.
455+
setup-args = [
456+
"--vsenv",
457+
"-Db_vscrt=mt",
458+
"-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']",
459+
]
460+
461+
[[tool.cibuildwheel.overrides]]
462+
select = "cp314*"
463+
manylinux-x86_64-image = "manylinux_2_28"

0 commit comments

Comments
 (0)