forked from PyTables/PyTables
-
Notifications
You must be signed in to change notification settings - Fork 0
217 lines (189 loc) · 7.18 KB
/
wheels.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: Wheels
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
# Publish when a (published) GitHub Release is created.
on:
push:
branches:
- master
- 'releases/**'
- 'ci/**'
tags:
- v*
pull_request:
branches:
- master
- 'releases/**'
- 'ci/**'
release:
types:
- published
# TODO:
# The scheduled version of this job should really download and install NumPy
# from scientific-python-nightly-wheels
schedule:
- cron: '12 13 * * 0'
permissions:
contents: read
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
name: Install Python
with:
python-version: 3.x
- name: Install APT packages
if: contains(${{ matrix.os }}, 'ubuntu')
run: |
sudo apt update
# Keep in sync with "Prerequisites" in User's Guide.
sudo apt install libbz2-dev libhdf5-serial-dev
sudo apt install latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-plain-generic
- name: Install dependencies
run: |
# Keep in sync with ``build-system.requires`` in ``pyproject.toml``.
python -m pip install --require-hashes -r ./.github/workflows/requirements/build-requirements.txt
python -m pip install --require-hashes -r requirements.txt
# Keep in sync with ``project.optional-dependencies.doc`` in ``pyproject.toml``.
python -m pip install --require-hashes -r ./.github/workflows/requirements/optional-requirements.txt
- name: Build dist (sdist and docs)
run: make PYTHON=python dist
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
path: dist/*
name: dist
build_wheels:
name: Build ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.build }} wheels
runs-on: ${{ matrix.os }}
env:
# Keep in sync with "Prerequisites" in User's Guide.
HDF5_VERSION: 1.14.3 # H5Dchunk_iter needs at least 1.14.1
MACOSX_DEPLOYMENT_TARGET: "10.9"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x86_64
build: 'cp*'
- os: macos-13
arch: x86_64
build: 'cp*'
- os: macos-14
arch: arm64
build: 'cp*'
- os: windows-latest
arch: AMD64
build: 'cp*'
# The aarch64 wheels are very slow so split into separate jobs
- os: ubuntu-latest
arch: aarch64
build: 'cp311-*'
- os: ubuntu-latest
arch: aarch64
build: 'cp312-*'
- os: ubuntu-latest
arch: aarch64
build: 'cp313-*'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
name: Install Python on Unix
with:
python-version: '3.12'
if: runner.os != 'Windows'
- name: Install Python and dependencies on Windows
uses: mamba-org/setup-micromamba@617811f69075e3fd3ae68ca64220ad065877f246 # v2.0.0
with:
environment-name: build
create-args: >
python=3.12 blosc c-blosc2 bzip2 hdf5 lz4 snappy zstd zlib pkgconfig
init-shell: bash powershell
if: runner.os == 'Windows'
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
if: runner.os == 'Linux' && matrix.arch != 'x64_64'
name: Set up QEMU on Linux
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
id: deps-cache
with:
path: hdf5_build
# Instead of a hashFiles('**/wheels.yml') appended here, just use a counter.
# It allows us to modify this file without having to constantly rebuild HDF5
# (which takes almost an hour on Linux emulated aarch64).
key: ${{ runner.os }}-${{ matrix.arch }}-deps-cache-${{ hashFiles('**/get_hdf5.sh') }}-${{ env.HDF5_VERSION }}-1
if: runner.os != 'Windows'
- name: Build dependencies
env:
CFLAGS: -g0
HDF5_DIR: ${{ github.workspace }}/hdf5_build
HDF5_VERSION: 1.14.3
MACOSX_DEPLOYMENT_TARGET: "10.9"
if: runner.os != 'Windows' && steps.deps-cache.outputs.cache-hit != 'true'
run: |
mkdir hdf5_build
if [[ "${{ runner.os }}" = 'Linux' ]]; then
docker run --rm -e HDF5_DIR=/io/hdf5_build -e CFLAGS="$CFLAGS" -e HDF5_VERSION="$HDF5_VERSION" -v `pwd`:/io:rw quay.io/pypa/manylinux2014_${{ matrix.arch }} /io/ci/github/get_hdf5.sh
else
HDF5_DIR=`pwd`/hdf5_build ci/github/get_hdf5.sh
fi
- name: Install cibuildwheel
run: |
python -m pip install --require-hashes -r ./.github/workflows/requirements/wheels-requirements.txt
- name: Build ${{ matrix.build }} wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: '${{ matrix.build }}'
CIBW_ARCHS: '${{ matrix.arch }}'
- name: Copy requirements.txt
run: |
cp requirements.txt ./wheelhouse/
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
path: |
./wheelhouse/*.whl
./wheelhouse/*.txt
name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ strategy.job-index }}
twine_check:
needs: [ build_sdist, build_wheels ]
name: Twine check
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
submodules: true
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: '*'
merge-multiple: true
path: wheelhouse
- name: List downloaded artifacts
run: ls -alR ./wheelhouse/
- name: Install Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.x'
- name: Install twine
run: |
python -m pip install --require-hashes -r ./.github/workflows/requirements/wheels-requirements.txt
- name: Check sdist and wheels
run: |
python -m twine check *.whl tables-*.tar.gz
working-directory: wheelhouse
- name: Upload wheel
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # 0.6.1
if: github.repository == 'PyTables/PyTables' && github.event_name == 'schedule'
with:
artifacts_path: wheelhouse
anaconda_nightly_upload_token: ${{secrets.ANACONDA_ORG_UPLOAD_TOKEN}}