Skip to content

Commit

Permalink
maint: update CI wheel building script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oscarbenjamin committed Mar 14, 2022
1 parent b3eb354 commit c849db5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/buildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.10.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
uses: pypa/cibuildwheel@v2.3.1
env:
CIBW_BUILD: cp37-* cp38-*
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-*
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
CIBW_BEFORE_ALL_LINUX: bin/cibw_before_build_linux.sh
CIBW_BEFORE_ALL_MACOS: bin/cibw_before_build_macosx.sh
# There are problems with both older and newer cython versions...
CIBW_BEFORE_BUILD: pip install numpy cython==0.27.3
CIBW_BEFORE_BUILD: pip install numpy cython
CIBW_ENVIRONMENT: >
C_INCLUDE_PATH=$(pwd)/.local/include/
LIBRARY_PATH=$(pwd)/.local/lib/
LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH
CIBW_TEST_COMMAND: "python -c \'import flint; assert str(flint.fmpq(3, 2)**2) == \"9/4\"\'"

- uses: actions/upload-artifact@v2
with:
path: wheelhouse/*.whl
6 changes: 3 additions & 3 deletions bin/build_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ PREFIX=$(pwd)/.local
mkdir -p $PREFIX

GMPVER=6.2.1
YASMVER=1.3.1
YASMVER=1.3.0
MPIRVER=3.0.0
MPFRVER=4.1.0
FLINTVER=2.7.1
ARBVER=2.19.0
FLINTVER=2.8.4
ARBVER=2.22.0
4 changes: 2 additions & 2 deletions bin/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ source bin/build_variables.sh
python3 -m venv $PREFIX/venv
source $PREFIX/venv/bin/activate
pip install -U pip wheel delocate
pip install numpy cython==0.27.3
# N.B. bugs in both older and newer Cython versions...
pip install numpy cython
# Working as of cython==0.29.28

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

Expand Down

0 comments on commit c849db5

Please sign in to comment.