-
Notifications
You must be signed in to change notification settings - Fork 27
157 lines (134 loc) · 4.86 KB
/
buildwheel.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
name: Build
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
# path-type inherit is used so that when cibuildwheel calls msys2 to
# run bin/cibw_before_build_windows.sh the virtual environment
# created by cibuildwheel will be available within msys2. The
# msys2/setup-msys2 README warns that using inherit here can be
# problematic in some situations. Maybe there is a better way to do
# this.
path-type: inherit
if: ${{ matrix.os == 'windows-2019' }}
# Install pkgconfig on Windows from choco rather than from msys and
# avoid using the Strawberry one.
- run: choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
if: ${{ matrix.os == 'windows-2019' }}
# We have to set this here rather than in the cibuildwheel config
# This is probably something to do with \ vs / in paths...
- run: echo "PKG_CONFIG_PATH=${{ github.workspace }}/.local/lib/pkgconfig" >> $env:GITHUB_ENV
if: ${{ matrix.os == 'windows-2019' }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.18.1
env:
# override setting in pyproject.toml to use msys2 instead of msys64 bash
CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh
CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel && msys2 -c bin/cibw_before_build_windows.sh
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: sudo apt-get update
- run: sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build
- run: curl -O -L https://www.flintlib.org/flint-3.1.0.tar.gz
- run: tar -xzf flint-3.1.0.tar.gz
- run: cd flint-3.1.0 && ./configure --disable-static && make -j4 && sudo make install
- run: pip install build
- run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
test_rst:
needs: build_wheels
name: Test rst docs
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-20.04
path: wheelhouse
- run: pip install --upgrade pip
- run: pip install pytest
- run: pip install --no-index --find-links wheelhouse python_flint
- run: pytest --doctest-glob='*.rst' doc/source
test_wheels:
needs: build_wheels
name: Test ${{ matrix.python-version }} wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-13, macos-14]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse
- run: pip install --no-index --find-links wheelhouse python_flint
- run: python -m flint.test --verbose
# On new enough Ubuntu we can build against the system deb.
test_pip_flint_deb:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev
- run: pip install .
- run: python -m flint.test --verbose
# For older Ubuntu we have to build Flint >= 3.0.0
test_flint_versions:
name: Test flint ${{ matrix.flint-tag }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# Supported versions and latest git
flint-tag: ['v3.0.0', 'v3.0.1', 'v3.1.0', 'v3.1.1', 'v3.1.2', 'main']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: bin/install_flint_ubuntu.sh ${{ matrix.flint-tag }}
- run: pip install .
- run: python -m flint.test --verbose