-
Notifications
You must be signed in to change notification settings - Fork 592
139 lines (118 loc) · 4.95 KB
/
wheel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Build binary wheel
on:
push:
branches:
- master
tags:
- core-*
pull_request:
branches:
- master
schedule:
- cron: "0 2 * * 1-5"
workflow_dispatch: # allows running workflow manually from the Actions tab
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build_wheels_matrix:
runs-on: ubuntu-22.04
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- run: pip install cibuildwheel==2.17.0 # sync version with pypa/cibuildwheel below
- id: set-matrix
env:
# skipping pypy for now
# cp38-win was segfaulting on CI -> skipping for now
# oldest-supported-numpy has no wheels for cp38-musllinux_aarch64 -> build numpy from source on QEMU -> CI timeouts -> skipping for now
CIBW_SKIP: >
pp*
cp38-win*
cp38-musllinux_aarch64
# the supported python versions are parsed from vaex-core setup.py python_requires
run: |
MATRIX_INCLUDE=$(
{
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | jq -nRc '{"only": inputs, "os": "ubuntu-22.04"}' \
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64 | jq -nRc '{"only": inputs, "os": "macos-13"}' \
&& cibuildwheel --print-build-identifiers --platform macos --arch arm64 | jq -nRc '{"only": inputs, "os": "macos-14"}' \
&& cibuildwheel --print-build-identifiers --platform windows --arch AMD64 | jq -nRc '{"only": inputs, "os": "windows-2022"}'
} | jq -sc
)
echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
working-directory: packages/vaex-core/
build_wheels:
needs: build_wheels_matrix
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.only }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.build_wheels_matrix.outputs.include) }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Copy dll
if: startswith(matrix.os, 'windows')
uses: ./ci/actions/windll
- name: chores
if: ${{ !startswith(matrix.os, 'windows') }}
run: |
mkdir packages/vaex-core/bin
cp bin/install_pcre.sh packages/vaex-core/bin/
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
# xcode 15.2 throws compilation errors ref https://github.com/vaexio/vaex/pull/2432
# select older xcode from the available versions on the runner ref https://github.com/actions/runner-images/blob/ff9acc6/images/macos/macos-13-Readme.md#xcode
- name: Switch to older Xcode (Mac-only)
if: startswith(matrix.os, 'macos')
run: sudo xcode-select -s "/Applications/Xcode_15.0.1.app"
- uses: pypa/cibuildwheel@v2.17.0 # sync version with pip install cibuildwheel above
with:
only: ${{ matrix.only }}
package-dir: packages/vaex-core/
output-dir: packages/vaex-core/dist/
env:
CIBW_BEFORE_BUILD: ${{ startswith(matrix.os, 'ubuntu') && 'bash bin/install_pcre.sh' || startswith(matrix.os, 'macos') && 'sudo -E bash bin/install_pcre.sh' || '' }}
CIBW_BUILD_VERBOSITY: 2
# temporary ref https://github.com/oconnor663/blake3-py/pull/45
CIBW_BEFORE_TEST: pip install --force-reinstall blake3 --find-links https://github.com/ddelange/blake3-py/releases/expanded_assets/0.4.1
# no test on musllinux due to missing pyarrow wheels ref https://github.com/apache/arrow/pull/40177
CIBW_TEST_SKIP: '*musllinux*'
CIBW_TEST_COMMAND: python -c "import vaex; print(vaex.from_arrays(x=[1,2]))"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
CIBW_ENVIRONMENT_LINUX: 'CFLAGS="-Wl,-strip-all" CXXFLAGS="-Wl,-strip-all" PATH="$HOME/.cargo/bin:$PATH"'
CIBW_ENVIRONMENT_MACOS: 'CFLAGS="-I/usr/local/include -L/usr/local/lib" CXXFLAGS="-I/usr/local/include -L/usr/local/lib" LDFLAGS="-L/usr/local/lib"'
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.only }}
path: packages/vaex-core/dist
publish:
if: startsWith(github.ref, 'refs/tags')
needs: [build_wheels]
runs-on: ubuntu-22.04
permissions:
id-token: write # pypa/gh-action-pypi-publish
steps:
- uses: actions/download-artifact@v4
with:
path: dist/
pattern: dist-*
merge-multiple: true
- run: ls -ltra dist/
# https://github.com/pypa/gh-action-pypi-publish#trusted-publishing
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.10.2
with:
skip-existing: true