Skip to content

Declare build deps in pyproject.toml #406

Declare build deps in pyproject.toml

Declare build deps in pyproject.toml #406

Workflow file for this run

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-12]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- 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' }}
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_BEFORE_ALL_LINUX: bin/cibw_before_all_linux.sh
CIBW_BEFORE_ALL_MACOS: bin/cibw_before_all_macosx_x86_64.sh
CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh
CIBW_BEFORE_BUILD_WINDOWS: msys2 -c bin/cibw_before_build_windows.sh
CIBW_BEFORE_BUILD: pip install numpy setuptools cython delvewheel
CIBW_ENVIRONMENT: >
C_INCLUDE_PATH=$(pwd)/.local/include/
LIBRARY_PATH=$(pwd)/.local/lib/
LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH
PYTHON_FLINT_MINGW64=true
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}
CIBW_TEST_COMMAND: python -c "import flint; print(str(flint.fmpz(2)))"
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- run: pip install --upgrade pip
- run: pip install cython setuptools
- run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
test_rst:
needs: build_wheels
name: Test rst docs
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- uses: actions/download-artifact@v3
with:
name: artifact
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-12]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v3
with:
name: artifact
path: wheelhouse
- run: pip install --no-index --find-links wheelhouse python_flint
- run: python -m flint.test --verbose
test_pip_vcs_sdist:
name: pip install ${{ matrix.target }} on ${{ matrix.python-version }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12']
# '.' means install from git checkout
# 'python-flint' means install from PyPI sdist
target: ['.', 'python-flint']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: bin/pip_install_ubuntu.sh ${{ matrix.target }}
- run: python -m flint.test --verbose