forked from tskit-dev/msprime
-
Notifications
You must be signed in to change notification settings - Fork 0
254 lines (244 loc) · 7.93 KB
/
wheels.yml
File metadata and controls
254 lines (244 loc) · 7.93 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
name: Binary wheels
on:
push:
branches:
- main
- test
tags:
- '*'
release:
types: [published]
jobs:
OSX:
name: Build ${{ matrix.os }} - ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15-intel, macos-14, macos-15, macos-26]
python: ["3.10", 3.11, 3.12, 3.13, 3.14]
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
submodules: true
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6.1.0
with:
python-version: ${{ matrix.python }}
- name: Install deps
run: |
brew install gsl
pip install --upgrade pip build
- name: Build Wheel (arm64)
if: matrix.os != 'macos-15-intel'
run: |
export PLAT="arm64"
export _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"
export CFLAGS+=" -arch arm64"
export CXXFLAGS+=" -arch arm64"
export ARCHFLAGS=$OLDARCHFLAGS
export ARCHFLAGS+=" -arch arm64"
export CPPFLAGS+=" -arch arm64"
export LDFLAGS+=" -arch arm64"
python -m build --wheel
- name: Build Wheel (x86_64)
if: matrix.os == 'macos-15-intel'
run: |
export PLAT="x86_64"
export _PYTHON_HOST_PLATFORM="macosx-11.0-x86_64"
export CFLAGS+=" -arch x86_64"
export CXXFLAGS+=" -arch x86_64"
export ARCHFLAGS=$OLDARCHFLAGS
export ARCHFLAGS+=" -arch x86_64"
export CPPFLAGS+=" -arch x86_64"
export LDFLAGS+=" -arch x86_64"
python -m build --wheel
- name: Delocate to bundle dynamic libs
run: |
pip install delocate
delocate-wheel -v dist/*.whl
- name: Upload Wheels
uses: actions/upload-artifact@v6.0.0
with:
name: osx-wheel-${{ matrix.os }}-${{ matrix.python }}
path: dist
Windows:
name: Build Windows - ${{ matrix.python }}
runs-on: windows-latest
strategy:
matrix:
python: ["3.10", 3.11, 3.12, 3.13, 3.14]
arch: [x64]
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
submodules: true
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6.1.0
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch }}
- name: Install GSL via vcpkg
run: |
vcpkg install gsl:${{ matrix.arch }}-windows
shell: cmd
- name: Install deps
run: |
pip install --upgrade pip build delvewheel
- name: Fix windows symlinks
run: |
if (Test-Path "lwt_interface") { Remove-Item -Recurse -Force "lwt_interface" }
Copy-Item -Recurse "git-submodules/tskit/python/lwt_interface" "./lwt_interface"
shell: powershell
- name: Build Wheel
run: |
# The symlink fix above confuses setuptools_scm
$tag = git describe --tags --exact-match HEAD 2>$null
if ($tag) {
$env:SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MSPRIME = $tag
}
python -m build --wheel
- name: Bundle dynamic libs
run: |
$vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT
if (-not $vcpkgRoot) { $vcpkgRoot = "C:\vcpkg" }
$gslBinPath = Join-Path $vcpkgRoot "installed\x64-windows\bin"
$env:PATH = "$gslBinPath;$env:PATH"
delvewheel repair dist/*.whl -w dist/ --add-path "$gslBinPath"
shell: powershell
- name: Upload Wheels
uses: actions/upload-artifact@v6.0.0
with:
name: win-wheel-${{ matrix.python }}
path: dist
manylinux:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
submodules: true
- name: Set up Python 3.10
uses: actions/setup-python@v6.1.0
with:
python-version: "3.10"
- name: Build sdist
shell: bash
run: |
pip install --upgrade pip build
python -m build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v6.0.0
with:
name: sdist
path: dist
- name: Build wheels in docker
shell: bash
run: |
docker run --rm -v `pwd`:/project -w /project quay.io/pypa/manylinux2014_x86_64 bash .github/workflows/docker/buildwheel.sh
- name: Upload Wheels
uses: actions/upload-artifact@v6.0.0
with:
name: linux-wheels
path: dist/wheelhouse
OSX-test:
name: Test ${{ matrix.os }} - ${{ matrix.python }}
needs: ['OSX']
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15-intel, macos-14, macos-15, macos-26]
python: ["3.10", 3.11, 3.12, 3.13, 3.14]
steps:
- name: Download wheels
uses: actions/download-artifact@v7.0.0
with:
name: osx-wheel-${{ matrix.os }}-${{ matrix.python }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6.1.0
with:
python-version: ${{ matrix.python }}
- name: Install wheel and test
run: |
python -VV
# Install the local wheel
pip install numpy newick>=1.3.0 tskit>=0.5.2 demes>=0.2
pip install msprime --no-index --only-binary msprime -f .
python -c "import msprime"
msp simulate 10 tmp.trees
tskit info tmp.trees
tskit provenances tmp.trees
manylinux-test:
runs-on: ubuntu-24.04
needs: ['manylinux']
strategy:
matrix:
python: ["3.10", 3.11, 3.12, 3.13, 3.14]
steps:
- name: Download wheels
uses: actions/download-artifact@v7.0.0
with:
name: linux-wheels
- name: Set up Python
uses: actions/setup-python@v6.1.0
with:
python-version: ${{ matrix.python }}
- name: Install wheel and test
run: |
python -VV
# Install the local wheel
pip install numpy newick demes
pip install --no-dependencies msprime --no-index --only-binary msprime -f .
pip install tskit
python -c "import msprime"
msp simulate 10 tmp.trees
tskit info tmp.trees
tskit provenances tmp.trees
Windows-test:
runs-on: windows-latest
needs: ['Windows']
strategy:
matrix:
python: ["3.10", 3.11, 3.12, 3.13, 3.14]
steps:
- name: Download wheels
uses: actions/download-artifact@v7.0.0
with:
name: win-wheel-${{ matrix.python }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6.1.0
with:
python-version: ${{ matrix.python }}
- name: Install wheel and test
run: |
python -VV
pip install numpy newick>=1.3.0 tskit>=0.5.2 demes>=0.2
pip install msprime --no-index --only-binary msprime -f .
python -c "import msprime"
msp simulate 10 tmp.trees
tskit info tmp.trees
tskit provenances tmp.trees
PyPI_Upload:
runs-on: ubuntu-24.04
environment: release
needs: ['OSX-test', 'manylinux-test', 'Windows-test']
permissions:
id-token: write
steps:
- name: Download all
uses: actions/download-artifact@v7.0.0
- name: Move to dist
run: |
mkdir dist
cp */*.{whl,gz} dist/.
# Windows wheels have different naming pattern
if [ -d "win-wheel"* ]; then cp win-wheel*/*.whl dist/. || true; fi
- name: Publish distribution to Test PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PRODUCTION PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@v1.13.0