Skip to content

maint: update CI wheel building script #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions .github/workflows/buildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,54 @@ jobs:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-20.04, windows-2019, macOS-10.15]
os: [ubuntu-20.04, macOS-10.15]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- 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_MANYLINUX_X86_64_IMAGE: manylinux2014
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; print(str(flint.fmpz(2)))'

- uses: actions/upload-artifact@v2
with:
path: wheelhouse/*.whl

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, macOS-10.15]
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v3
with:
name: artifact
path: wheelhouse
- run: python -m venv venv
- run: venv/bin/pip install -U pip
- run: venv/bin/pip install --find-links wheelhouse python_flint
- run: venv/bin/python test/test.py
2 changes: 2 additions & 0 deletions bin/build_dependencies_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ if [ $USE_GMP = "gmp" ]; then
curl -O https://gmplib.org/download/gmp/gmp-$GMPVER.tar.xz
tar xf gmp-$GMPVER.tar.xz
cd gmp-$GMPVER
# Show the output of configfsf.guess
./configfsf.guess
./configure --prefix=$PREFIX\
--enable-fat\
--enable-shared=yes\
Expand Down
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
4 changes: 2 additions & 2 deletions bin/cibw_before_build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

yum install -y xz
bin/build_dependencies_unix.sh\
--gmp gmp\
--host x86_64-unknown-linux-gnu
--gmp mpir\
--host x86_64-pc-linux-gnu