Skip to content

Commit 4ceb5d9

Browse files
authored
REF: Refactor cibuildwheel logic into pyproject.toml (pandas-dev#48945)
1 parent 9fb69e6 commit 4ceb5d9

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

.github/workflows/wheels.yml

+2-12
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
# TODO: support PyPy?
5555
python: [["cp38", "3.8"], ["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11-dev"]]# "pp38", "pp39"]
5656
env:
57-
IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }}
5857
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
5958
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
6059
steps:
@@ -72,15 +71,6 @@ jobs:
7271
uses: pypa/[email protected]
7372
env:
7473
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
75-
CIBW_ENVIRONMENT: IS_32_BIT='${{ env.IS_32_BIT }}'
76-
# We can't test directly with cibuildwheel, since we need to have to wheel location
77-
# to mount into the docker image
78-
CIBW_TEST_COMMAND_LINUX: "python {project}/ci/test_wheels.py"
79-
CIBW_TEST_COMMAND_MACOS: "python {project}/ci/test_wheels.py"
80-
CIBW_TEST_REQUIRES: hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
81-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "python ci/fix_wheels.py {wheel} {dest_dir}"
82-
CIBW_ARCHS_MACOS: x86_64 universal2
83-
CIBW_BUILD_VERBOSITY: 3
8474

8575
# Used to test the built wheels
8676
- uses: actions/setup-python@v3
@@ -118,7 +108,7 @@ jobs:
118108

119109
- name: Upload wheels
120110
if: success()
121-
shell: bash
111+
shell: bash -el {0}
122112
env:
123113
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
124114
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
@@ -195,7 +185,7 @@ jobs:
195185
196186
- name: Upload sdist
197187
if: success()
198-
shell: bash
188+
shell: bash -el {0}
199189
env:
200190
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
201191
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}

pyproject.toml

+24
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,30 @@ requires = [
1111
# https://github.com/python-versioneer/python-versioneer/issues/193
1212
# build-backend = "setuptools.build_meta"
1313

14+
[tool.cibuildwheel]
15+
skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*"
16+
build-verbosity = "3"
17+
test-requires = "hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17"
18+
test-command = "python {project}/ci/test_wheels.py"
19+
20+
[tool.cibuildwheel.macos]
21+
archs = "x86_64 universal2"
22+
test-skip = "*_arm64 *_universal2:arm64"
23+
24+
[tool.cibuildwheel.windows]
25+
repair-wheel-command = "python ci/fix_wheels.py {wheel} {dest_dir}"
26+
27+
[[tool.cibuildwheel.overrides]]
28+
select = "*-win*"
29+
# We test separately for Windows, since we use
30+
# the base windows docker image to check if any dlls are
31+
# missing from the wheel
32+
test-command = ""
33+
34+
[[tool.cibuildwheel.overrides]]
35+
select = "*-win32"
36+
environment = { IS_32_BIT="true" }
37+
1438
[tool.black]
1539
target-version = ['py38', 'py39']
1640
exclude = '''

0 commit comments

Comments
 (0)