-
Notifications
You must be signed in to change notification settings - Fork 50
278 lines (214 loc) · 7.06 KB
/
Copy pathpython.yml
File metadata and controls
278 lines (214 loc) · 7.06 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
name: Python
on: [push, pull_request, workflow_dispatch]
defaults:
run:
shell: bash
jobs:
manylinux:
name: py${{ matrix.py }} ${{ matrix.ml }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# see compat matrix: https://github.com/pypa/manylinux
- ml: manylinux1_x86_64
py: cp27-cp27m
cy: "Cython<3.0"
skip: true
- ml: manylinux2010_x86_64
py: cp37-cp37m
skip: true
- ml: manylinux2010_x86_64
py: cp38-cp38
skip: true
- ml: manylinux2014_x86_64
py: cp39-cp39
- ml: manylinux2014_x86_64
py: cp310-cp310
- ml: manylinux2014_x86_64
py: cp311-cp311
- ml: manylinux2014_x86_64
py: cp312-cp312
- ml: manylinux2014_x86_64
py: cp313-cp313
- ml: manylinux_2_28_x86_64
py: cp314-cp314
src: true
- ml: manylinux_2_28_x86_64
py: cp314-cp314t
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Automatic core dumper analysis
uses: mdavidsaver/ci-core-dumper@master
- name: Detect pre-release
run: python ./gha-set-pre.py
- name: Build
run: |
# emit script to be executed in container.
cat <<EOF > runit.sh
#!/bin/sh
set -e -x
ls /opt/python/
/opt/python/${{ matrix.py }}/bin/python --version
yum -y install gdb || dnf -y install gdb || (apt update && apt -y install gdb)
export PATH="/opt/python/${{ matrix.py }}/bin:\$PATH"
export SETUPTOOLS_DSO_PLAT_NAME="${{ matrix.ml }}"
cd /io
pip install -U pip
# pre-download for later steps
pip download $PRE -d output \
--only-binary numpy,Cython \
--only-binary epicscorelibs \
"${{ matrix.cy || 'Cython' }}" \
setuptools_dso epicscorelibs wheel numpy ply nose2
# create source tar
pip install $PRE --no-index -f ./output setuptools_dso epicscorelibs
python setup.py sdist -d ./output
ls -lh output
# build wheel from source tar
pip wheel $PRE -w ./output --no-index -f ./output pvxslibs
ls -lh output
# install wheel for testing
pip install $PRE --no-index -f ./output pvxslibs nose2
# switch away from root when running test to avoid inclusion in PYTHONPATH
cd output
python -m nose2 -v pvxslibs
EOF
# end of script. Now execute in container
chmod +x runit.sh
mkdir output
podman run --rm \
-v `pwd`:/io \
quay.io/pypa/${{ matrix.ml }} \
/io/runit.sh
- name: Result
run: ls -lhtr output
- name: Save wheels
if: ${{ ! matrix.skip }}
uses: actions/upload-artifact@v7
with:
retention-days: 1
name: whl-${{ matrix.py }}-${{ matrix.ml }}
path: output/pvxslibs*.whl
- name: Save source
if: ${{ matrix.src }}
uses: actions/upload-artifact@v7
with:
retention-days: 1
name: whl-source
path: output/pvxslibs*.gz
native:
name: py${{ matrix.py }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
py: "3.8"
arch: win_amd64
# windows + 3.9 omitted due to numpy bug "invalid preprocessor command 'warning'"
- os: windows-latest
py: "3.10"
arch: win_amd64
- os: windows-latest
py: "3.11"
arch: win_amd64
- os: windows-latest
py: "3.12"
arch: win_amd64
- os: windows-latest
py: "3.13"
arch: win_amd64
- os: windows-latest
py: "3.14"
arch: win_amd64
- os: macos-latest
py: "3.8"
arch: macosx_11_0_universal2
- os: macos-latest
py: "3.9"
arch: macosx_11_0_universal2
- os: macos-latest
py: "3.10"
arch: macosx_11_0_universal2
- os: macos-latest
py: "3.11"
arch: macosx_11_0_universal2
- os: macos-latest
py: "3.12"
arch: macosx_11_0_universal2
- os: macos-latest
py: "3.13"
arch: macosx_11_0_universal2
- os: macos-latest
py: "3.14"
arch: macosx_11_0_universal2
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.py }}
- name: Prepare
run: python -m pip install -U pip virtualenv
- name: PIP Debug
run: pip debug -v
- name: Detect pre-release
run: python ./gha-set-pre.py
- name: Build
run: |
set -x -e
python -m pip install -U pip
pip download $PRE -d output \
--only-binary numpy,Cython \
--only-binary epicscorelibs \
Cython setuptools_dso epicscorelibs wheel numpy ply nose2
export SETUPTOOLS_DSO_PLAT_NAME=${{ matrix.arch }}
pip install $PRE --no-index -f ./output setuptools_dso epicscorelibs
python setup.py sdist -d ./output
ls -lh output
# build wheel from source tar
pip wheel $PRE -w ./output --no-index -f ./output pvxslibs
ls -lh output
# install wheel for testing
pip install $PRE --no-index -f ./output pvxslibs nose2
# switch away from root when running test to avoid inclusion in PYTHONPATH
cd output
python -m nose2 -v pvxslibs
- run: ls -lhtr output
- name: Save wheels
if: ${{ ! matrix.skip }}
uses: actions/upload-artifact@v7
with:
retention-days: 1
name: whl-${{ matrix.py }}-${{ matrix.os }}
path: output/pvxslibs*.whl
combine:
runs-on: ubuntu-latest
needs: [manylinux, native]
steps:
- name: Download
uses: actions/download-artifact@v8
with:
merge-multiple: true
- run: ls -lhtr
- uses: actions/setup-python@v6
with:
python-version: 3.11
- name: Setup
run: |
pip install -U pip twine
python -m twine -h
- name: Check
run: twine check pvxslibs*.gz pvxslibs*.whl
- name: Upload wheels
if: env.TWINE_USERNAME && github.event_name=='push' && github.ref=='refs/heads/master'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload --skip-existing pvxslibs*.gz pvxslibs*.whl