Skip to content

Commit c849db5

Browse files
committed
maint: update CI wheel building script
Previously it wasn't possible to build python_flint with the most recent versions of Cython but that was fixed in b3eb354. That makes it possible to update all build dependencies and to create wheels for newer Python versions. This commit updates the build scripts that build wheels for OSX and Linux in GitHub Actions. The result of these changes is that the latest versions of all build and runtime dependencies are currently being used and x86_64 bit wheels are being built for OSX and Linux for all supported CPython versions. - Unpin the version of Cython used to build python_flint so that the newest version will always be used. At the time of writing that means using Cython 0.29.28 but newer versions will automatically be used when released. - Build 64 bit CPython wheels for OSX and Linux for all currently supported Python versions (3.7, 3.8, 3.9 and 3.10). - Fix the YASM version from 1.3.1 to 1.3.0. There does not seem to be a 1.3.1 version of YASM any more and 1.3.0 appears to be the newest version. It is unclear what happened to 1.3.1 which was previously used successfully. - Use the cibuildwheel GitHub Action for wheel building and bump version of cibuildwheel to 2.3.1 to get support for Python 3.10. - Bump versions of flint and arb to the latest releases (flint 2.8.4 and arb 2.22.0). - Check that all other dependencies are at their latest released versions (GMP 6.2.1 and MPIR 3.0.0 and MPFR 4.1.0). - Wheels are still not built for Windows - this is the biggest omission. There are conda-forge recipes for building python-flint and it should be possible to adapt those. - Newer OSX runs on Apple's M1 hardware so the OSX wheels built here will not work there. It is not yet possible to run M1 hardware in GitHub Actions so it is not immediately clear how to build those wheels. - It is also possible to build 32 bit Linux wheels but these are less likely to be used. Building them significantly increases the build time because numpy does not provide 32 bit wheels and numpy is currently a build-time dependency. Linux wheels also consume a lot of disk space which is limited for artifacts in GitHub Actions. - I have not checked whether it is possible to build wheels for pypy which is another likely platform that could be supported. - The build-time dependency on numpy can probably be eliminated. A couple of small things are being used from numpy.distutils which is itself probably going to be deprecated in future.
1 parent b3eb354 commit c849db5

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.github/workflows/buildwheel.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ jobs:
1515
- uses: actions/checkout@v2
1616
- uses: actions/setup-python@v2
1717

18-
- name: Install cibuildwheel
19-
run: python -m pip install cibuildwheel==1.10.0
2018
- name: Build wheels
21-
run: python -m cibuildwheel --output-dir wheelhouse
19+
uses: pypa/cibuildwheel@v2.3.1
2220
env:
23-
CIBW_BUILD: cp37-* cp38-*
21+
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-*
22+
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
2423
CIBW_BEFORE_ALL_LINUX: bin/cibw_before_build_linux.sh
2524
CIBW_BEFORE_ALL_MACOS: bin/cibw_before_build_macosx.sh
26-
# There are problems with both older and newer cython versions...
27-
CIBW_BEFORE_BUILD: pip install numpy cython==0.27.3
25+
CIBW_BEFORE_BUILD: pip install numpy cython
2826
CIBW_ENVIRONMENT: >
2927
C_INCLUDE_PATH=$(pwd)/.local/include/
3028
LIBRARY_PATH=$(pwd)/.local/lib/
3129
LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH
30+
CIBW_TEST_COMMAND: "python -c \'import flint; assert str(flint.fmpq(3, 2)**2) == \"9/4\"\'"
31+
3232
- uses: actions/upload-artifact@v2
3333
with:
3434
path: wheelhouse/*.whl

bin/build_variables.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ PREFIX=$(pwd)/.local
1414
mkdir -p $PREFIX
1515

1616
GMPVER=6.2.1
17-
YASMVER=1.3.1
17+
YASMVER=1.3.0
1818
MPIRVER=3.0.0
1919
MPFRVER=4.1.0
20-
FLINTVER=2.7.1
21-
ARBVER=2.19.0
20+
FLINTVER=2.8.4
21+
ARBVER=2.22.0

bin/build_wheel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ source bin/build_variables.sh
1212
python3 -m venv $PREFIX/venv
1313
source $PREFIX/venv/bin/activate
1414
pip install -U pip wheel delocate
15-
pip install numpy cython==0.27.3
16-
# N.B. bugs in both older and newer Cython versions...
15+
pip install numpy cython
16+
# Working as of cython==0.29.28
1717

1818
C_INCLUDE_PATH=.local/include/ LIBRARY_PATH=.local/lib/ pip wheel .
1919

0 commit comments

Comments
 (0)