-
Notifications
You must be signed in to change notification settings - Fork 14
237 lines (196 loc) · 6.98 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: CI (wheels and sdist)
on:
push:
branches: ['rc*']
pull_request:
branches: ['rc*']
release:
types: [published]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install system dependencies
run: sudo apt-get install --yes libopenblas-dev libfftw3-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest cython setuptools
python -m pip install -r requirements-dev.txt
- name: build sdist
run: python setup.py develop
- name: Test with pytest
run: pytest --cov=./ --cov-report=xml
- name: Upload coverage
uses: codecov/[email protected]
source-distribution:
needs: [build-test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install system dependencies
run: sudo apt-get install --yes libopenblas-dev libfftw3-dev
- name: build sdist
run: |
python -m pip install --upgrade pip
python -m pip install pytest cython setuptools
python -m pip install -r requirements-dev.txt
python setup.py sdist
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: "dist/*.tar.gz"
if-no-files-found: error
# - name: Publish to PyPI
# if: startsWith(github.ref, 'refs/tags/')
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# pip install twine
# twine upload --skip-existing dist/*.tar.gz
wheel-package:
needs: [build-test]
runs-on: ${{ matrix.os }}
env:
# MACOSX_DEPLOYMENT_TARGET: "11.1"
CIBW_BUILD_VERBOSITY: "1"
CIBW_BEFORE_ALL_MACOS: "brew install fftw openblas"
CIBW_BEFORE_ALL_LINUX: "yum -y install openblas-devel fftw-devel"
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
CIBW_SKIP: "${{ matrix.cibw.skip || 'cp36* cp37* cp38*' }}"
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_MANYLINUX_I686_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_MANYLINUX_AARCH64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_ENVIRONMENT_WINDOWS: "LIB='C:\\Miniconda\\Library\\lib' INCLUDE='C:\\Miniconda\\Library\\include;C:\\Miniconda\\Library\\include\\openblas'"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair
-v
--add-path=C:/Miniconda/Library/bin
--wheel-dir={dest_dir}
{wheel}
# CIBW_BEFORE_TEST_LINUX: |
# yum -y install libjpeg-devel zlib1g-devel
# python -m pip install "pillow==8.4"
# python -m pip install -r requirements.txt
# CIBW_BEFORE_TEST: |
# python -m pip install -U pip
# python -m pip install -r requirements.txt
# CIBW_TEST_REQUIRES: "pytest"
# CIBW_TEST_COMMAND: |
# python -c "import mrsimulator"
# python -c "from mrsimulator import Site, Coupling, SpinSystem, Simulator"
# python -c "from mrsimulator.method.lib import Method1D, Method2D"
strategy:
fail-fast: false
matrix:
include:
- os: macos-12
name: mac 64-bit x86_64
cibw:
build: "cp3*"
- os: macos-14
name: mac 64-bit arm64
cibw:
arch: arm64
build: "cp3*"
- os: ubuntu-latest
name: linux 64-bit x86_64
cibw:
build: "cp3*manylinux_x86_64"
manylinux_image: manylinux2014
# - os: ubuntu-latest
# name: linux 32-bit i686
# cibw:
# build: "cp3*manylinux_i686"
# manylinux_image: manylinux2010
# - os: ubuntu-latest
# name: manylinux_aarch64
# cibw:
# build: "cp3*"
# manylinux_image: manylinux2014
# arch: aarch64
# - os: windows-latest
# name: win32
# architecture: x86
# cibw:
# build: "cp3*win32"
# - os: windows-2016
# name: win32-pypy
# architecture: x86
# cibw:
# build: "pp*win32"
- os: windows-latest
name: windows 64-bit AMD64
cibw:
build: "cp3*win_amd64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: ${{ matrix.architecture }}
# - name: customize mac-arm-64
# if: contains(matrix.os, 'macos') && matrix.cibw.arch
# run: |
# sudo xcode-select -switch /Applications/Xcode_13.1.app
# echo 'SDKROOT=/Applications/Xcode_13.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' >> "$GITHUB_ENV"
# echo 'MACOSX_DEPLOYMENT_TARGET=11.1' >> "$GITHUB_ENV"
- name: Set up QEMU
if: startsWith(matrix.os, 'ubuntu') && matrix.cibw.arch
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: customize aarch64
if: contains(matrix.cibw.arch, 'aarch64')
# install fftw-devel and openblas-devel from epel-7
run: |
echo '${{ matrix.cibw.arch }}'
echo 'CIBW_BEFORE_ALL_LINUX=yum -y install epel-release && yum -y install openblas-devel fftw-devel' >> "$GITHUB_ENV"
- name: Install mac-os Dependencies
if: startsWith(matrix.os, 'mac')
run: |
python -m pip install delocate
- name: Install linux Dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
python -m pip install auditwheel
- name: Install windows Dependencies
if: startsWith(matrix.os, 'windows')
run: |
python -m pip install delvewheel
C:\Miniconda\Scripts\conda install -c conda-forge openblas fftw
- name: Install Python Dependencies
run: |
python -m pip install --upgrade setuptools pip wheel cython
python -m pip install cibuildwheel
- name: show environment
run: |
pip freeze
- name: list target wheels
run: |
python -m cibuildwheel . --print-build-identifiers
- name: Build wheels
run: |
python -m cibuildwheel .
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.name }}
path: "wheelhouse/*"
if-no-files-found: error