-
Notifications
You must be signed in to change notification settings - Fork 16
225 lines (198 loc) · 7 KB
/
buildwheels.yml
File metadata and controls
225 lines (198 loc) · 7 KB
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
218
219
220
221
222
223
224
225
name: build_wheels+tests
defaults:
run:
shell: bash
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'
release:
types: [published]
jobs:
debug_build_ok:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
- run: DEBUG=1 VERBOSE=1 pip install --verbose -e .[tests]
- run: pytest -v -s -We -p no:unraisableexception tests
zenodo_json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: notiz-dev/github-action-json-property@release
with:
path: '.zenodo.json'
prop_path: 'creators'
build_wheels:
needs: [debug_build_ok, zenodo_json]
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-14, macos-15, macos-15-intel, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# download C and Fortran compiler on windows
- if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-ninja
m4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build and test wheels
env:
# skip 32-bit, musllinux, and free-threaded builds
CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* cp3??t-*"
CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel
CIBW_ENVIRONMENT_WINDOWS: CMAKE_ARGS="-DCMAKE_MAKE_PROGRAM=D:/a/_temp/msys64/mingw64/bin/ninja.exe" CMAKE_PROGRAM_PATH="D:/a/_temp/msys64/usr/bin" CMAKE_GENERATOR="Ninja" TEMP="D:/a/_temp/"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel}
CIBW_BEFORE_BUILD_MACOS: brew reinstall gcc; pip install --only-binary=llvmlite llvmlite
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion` SYSTEM_VERSION_COMPAT=0
CIBW_TEST_REQUIRES: pytest pytest-order
CIBW_TEST_COMMAND: pytest -v -s -We -p no:unraisableexception {package}/tests
run: python -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v4
with:
name: dist-${{matrix.os}}-${{matrix.manylinux}}
path: dist
run_example_notebooks:
needs: [build_wheels]
runs-on: ${{ matrix.os }}
name: Run example notebooks on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-14, macos-15, macos-15-intel, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v5.0.0
with:
python-version: "3.12"
- uses: actions/download-artifact@v4
with:
name: dist-${{matrix.os}}-${{matrix.manylinux}}
path: dist
# install fortran compiler needed by dustpy
- if: startsWith(matrix.os, 'macos-')
run: |
brew reinstall gcc
pip install --only-binary=llvmlite numba llvmlite!=0.46.0b1
# TODO #440
- if: startsWith(matrix.os, 'windows-')
run: echo 'PYTEST_SKIP_ARGS=-k "not camp"' >> $GITHUB_ENV
- run: |
temp=`find dist/ -name "*cp312*.whl"`
python -m pip install $temp[examples]
ex -sc 'g/^PyPartMC/d' -cx .binder/requirements.txt
python -m pip install --force-reinstall --no-deps $PIP_INSTALL_OPTS -r .binder/requirements.txt
python -m pip install $PIP_INSTALL_OPTS -r gitmodules/devops_tests/requirements.txt
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python -m pytest --durations=10 ${{ env.PYTEST_SKIP_ARGS }} -v -s -We -p no:unraisableexception gitmodules/devops_tests/test_run_notebooks.py
check_annotated_todos:
runs-on: ubuntu-latest
name: Check if todos are annotated
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- run: |
python -m pip install pytest
python -m pip install $PIP_INSTALL_OPTS -r gitmodules/devops_tests/requirements.txt
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python -m pytest --durations=10 -v -s -We -p no:unraisableexception gitmodules/devops_tests/test_todos_annotated.py
dist_check:
runs-on: ${{ matrix.os }}
needs: [build_wheels]
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
steps:
- uses: actions/setup-python@v5.0.0
with:
python-version: "3.11"
- run: pip install twine auditwheel
- uses: actions/download-artifact@v4
with:
name: dist-${{matrix.os}}-${{matrix.manylinux}}
path: dist
- run: twine check --strict dist/*
- run: for i in dist/*-manylinux*.whl; do auditwheel show $i; done;
make_sdist:
name: Make source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: Build source distribution
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
check_sdist:
name: Check if source wheels are compilable
runs-on: ubuntu-latest
needs: [make_sdist]
steps:
- uses: actions/download-artifact@v5
with:
pattern: cibw-sdist
merge-multiple: true
path: dist
- run: ls -R
- run: pip install --no-binary PyPartMC dist/pypartmc-*.tar.gz
dist_upload:
runs-on: ubuntu-latest
needs: [build_wheels, check_sdist]
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v5
with:
pattern: dist-*
merge-multiple: true
path: dist
- uses: actions/download-artifact@v5
with:
pattern: cibw-*
merge-multiple: true
path: dist
- run: |
echo "github.event_name:" ${{ github.event_name }}
echo "github.event.action:" ${{ github.event.action }}
echo "github.event.prerelease:" ${{ github.event.prerelease }}
echo "env.GITHUB_REF:" ${{ env.GITHUB_REF }}
echo "env.GITHUB_REF:" ${{ env.GITHUB_REF_NAME }}
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1.13
with:
repository_url: https://test.pypi.org/legacy/
attestations: false
verbose: true
- if: github.event_name == 'release' && github.event.prerelease == false
uses: pypa/gh-action-pypi-publish@release/v1.13
with:
attestations: false