Skip to content

Use meson-python instead of setuptools for wheels #531

Use meson-python instead of setuptools for wheels

Use meson-python instead of setuptools for wheels #531

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-13]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
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' }}
# 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/[email protected]
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]
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
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', '3.13-dev']
# '.' means install from python-flint git checkout
# 'python-flint' means install from PyPI sdist
target: ['.', 'python-flint']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: bin/pip_install_ubuntu.sh ${{ matrix.target }}
- run: python -m flint.test --verbose
test_flint_versions:
name: Test flint ${{ matrix.flinttag }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# Supported versions and latest git
flinttag: ['v3.0.0', 'v3.0.1', 'v3.1.0', 'main']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- run: bin/pip_install_ubuntu.sh . ${{ matrix.flinttag }}
- run: python -m flint.test --verbose