Skip to content

build(deps): bump the minor-patch-dependencies group with 2 updates #1626

build(deps): bump the minor-patch-dependencies group with 2 updates

build(deps): bump the minor-patch-dependencies group with 2 updates #1626

Workflow file for this run

name: Build
on: [push, pull_request]
env:
# These four values need to be kept in sync. Each pyodide version pins an
# emscripten version and a CPython version.
PYODIDE_VERSION: '0.29.3'
PYODIDE_EMSCRIPTEN_VERSION: '4.0.9'
PYODIDE_PYTHON_VERSION: '3.13'
PYODIDE_CIBW_BUILD: 'cp313-*'
jobs:
build_wheels:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- name: Build manylinux x86-64 wheels
os: ubuntu-22.04
kind: native
artifact_name: wheels-ubuntu-22.04
cibw_platform: auto
cibw_build: "*"
- name: Build manylinux arm64 wheels
os: ubuntu-22.04-arm
kind: native
artifact_name: wheels-ubuntu-22.04-arm
cibw_platform: auto
cibw_build: "*"
- name: Build Windows x86-64 wheels
os: windows-2022
kind: native
artifact_name: wheels-windows-2022
cibw_platform: auto
cibw_build: "*"
- name: Build Windows arm64 wheels
os: windows-11-arm
kind: native
artifact_name: wheels-windows-11-arm
cibw_platform: auto
cibw_build: "*"
- name: Build macOS x86-64 wheels
os: macos-15-intel
kind: native
artifact_name: wheels-macos-15-intel
cibw_platform: auto
cibw_build: "*"
- name: Build macOS arm64 wheels
os: macos-14
kind: native
artifact_name: wheels-macos-14
cibw_platform: auto
cibw_build: "*"
- name: Build Pyodide wheels
os: ubuntu-22.04
kind: pyodide
artifact_name: wheels-pyodide
cibw_platform: pyodide
steps:
- uses: actions/checkout@v6.0.2
- if: ${{ matrix.kind == 'native' }}
uses: actions/setup-python@v6
with:
python-version: '3.13'
# -------------- Windows stuff ---------------- #
- if: ${{ matrix.os == 'windows-2022' }}
uses: msys2/setup-msys2@v2.31.0
with:
msystem: ucrt64
update: true
- if: ${{ matrix.os == 'windows-11-arm' }}
uses: msys2/setup-msys2@v2.31.0
with:
msystem: clangarm64
update: true
# Install pkgconfig on Windows from choco rather than from msys and
# avoid using the Strawberry one.
- if: ${{ startsWith( matrix.os , 'windows' ) }}
run: choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
# We have to set this here rather than in the cibuildwheel config
# This is probably something to do with \ vs / in paths...
- if: ${{ startsWith( matrix.os , 'windows' ) }}
run: |
$pkgConfigPath = "${{ github.workspace }}/.local/lib/pkgconfig"
$pkgConfigPath = $pkgConfigPath.Replace('\', '/')
echo "PKG_CONFIG_PATH=$pkgConfigPath" >> $env:GITHUB_ENV
# ------------- pyodide ------------- #
- if: ${{ matrix.kind == 'pyodide' }}
name: Set up Emscripten toolchain
uses: pyodide/setup-emsdk@ca2dd8aef8c2a0e11743c5c36f0b430ddb694b5c # v15
with:
version: ${{ env.PYODIDE_EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache
- if: ${{ matrix.kind == 'pyodide' }}
name: Check out Emscripten patches for Pyodide
uses: actions/checkout@v6.0.2
with:
repository: pyodide/pyodide
ref: ${{ env.PYODIDE_VERSION }}
path: pyodide-patches
sparse-checkout: |
emsdk/patches/
# ------------- actual build ------------- #
- name: Build wheels
uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0
env:
CIBW_PLATFORM: ${{ matrix.cibw_platform }}
CIBW_BUILD: ${{ matrix.kind == 'pyodide' && env.PYODIDE_CIBW_BUILD || matrix.cibw_build }}
CIBW_PYODIDE_VERSION: ${{ env.PYODIDE_VERSION }}
# override setting in pyproject.toml to use msys2 instead of msys64 bash
CIBW_BEFORE_ALL_WINDOWS: ${{ matrix.os == 'windows-11-arm' && 'msys2 -c bin/cibw_before_all_windows_arm64.sh' || 'msys2 -c bin/cibw_before_all_windows_amd64.sh' }}
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact_name }}
path: wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYODIDE_PYTHON_VERSION }}
- run: bin/install_latest_flint_ubuntu.sh
- run: pip install build
- run: python -m build --sdist
- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
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-22.04,
ubuntu-24.04,
ubuntu-24.04-arm,
windows-2022,
windows-2025,
windows-11-arm,
macos-15-intel,
macos-14,
macos-15,
]
# This list to be kept in sync with python-requires in pyproject.toml.
python-version: ['3.11', '3.12', '3.13', '3.13t', '3.14', '3.14t', 'pypy3.11']
exclude:
- os: windows-11-arm
python-version: pypy3.11
steps:
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: actions/download-artifact@v8
with:
path: wheelhouse
merge-multiple: true
- run: pip install --no-index --find-links wheelhouse python_flint
# Check if the GIL is disabled in the free-threading build after import.
- run: |
python --version --version
which python
python -c "import sysconfig; print(sysconfig.get_config_var('Py_GIL_DISABLED'))"
python -c "import sys; print(getattr(sys, '_is_gil_enabled', lambda: True)())"
python -c "import sys; import flint; print(getattr(sys, '_is_gil_enabled', lambda: True)())"
- run: python -m flint.test --verbose
test_pyodide:
needs: build_wheels
name: Test Pyodide wheel
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYODIDE_PYTHON_VERSION }}
- uses: actions/setup-node@v6
with:
node-version: '22'
- run: pip install pyodide-build
- run: pyodide xbuildenv install "${{ env.PYODIDE_VERSION }}"
- uses: actions/download-artifact@v8
with:
name: wheels-pyodide
path: wheelhouse
- run: |
pyodide venv .venv-pyodide
source .venv-pyodide/bin/activate
pip install wheelhouse/*.whl
pip install pytest hypothesis
python -m pytest -svra -p no:cacheprovider --pyargs flint
# On new enough Ubuntu we can build against the system deb.
test_pip_flint_deb:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev
- run: pip install .
- run: python -m flint.test --verbose
test_docs:
name: Test docs (build and doctest)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: bin/install_latest_flint_ubuntu.sh
- run: pip install --upgrade pip
- run: pip install -r requirements-dev.txt
- run: spin run -- pytest --doctest-glob='*.rst' doc/source
- run: spin docs
# Test build with minimum Cython and meson-python versions.
test_old_build_requires:
name: 'Test old Cython/meson-python'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev
# The versions of cython and meson-python here should be kept in sync
# with those in pyproject.toml so that we test the stated minimum
# versions.
#
# We don't need to specify ninja as a requirement in pyproject.toml
# because without --no-build-isolation meson-python handles it
# automatically in get_requirements_for_build_wheel().
- run: 'pip install "cython==3.0.11" "meson-python==0.18" "ninja<1.11"'
- run: pip install --no-build-isolation .
- run: python -m flint.test --verbose
# For older Ubuntu we have to build Flint >= 3.0.0
test_flint_releases:
name: Test flint ${{ matrix.flint-tag }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# Supported Flint versions:
flint-tag: ['v3.0.1', 'v3.1.3-p1', 'v3.2.2', 'v3.3.1']
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: bin/install_flint_ubuntu.sh ${{ matrix.flint-tag }}
- run: pip install .
- run: python -m flint.test --verbose
# Test against flint main
test_flint_main:
name: Test flint main Linux x86-64
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: bin/install_flint_ubuntu.sh main
# Need to disable flint version check to build against main
- run: pip install --config-settings=setup-args="-Dflint_version_check=false" .
- run: python -m flint.test --verbose
# Test against flint main
test_flint_main_arm:
name: Test flint main Linux ARM
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: bin/install_flint_ubuntu.sh main
# Need to disable flint version check to build against main
- run: pip install --config-settings=setup-args="-Dflint_version_check=false" .
- run: python -m flint.test --verbose
# Test that we can make a coverage build and report coverage
test_coverage_build_setuptools:
name: Test coverage setuptools build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev
- run: pip install -r requirements-dev.txt
- run: bin/coverage_setuptools.sh
# Test that we can make a coverage build and report coverage
test_coverage_build_meson:
name: Test coverage meson build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.12' # does not work with 3.13
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev
- run: pip install -r requirements-dev.txt
- run: bin/coverage.sh
# Run SymPy test suite against python-flint master
test_sympy:
name: Test SymPy ${{ matrix.sympy-version }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
sympy-version: ['1.13.1', '1.14.0']
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev
- run: pip install .
- run: pip install pytest pytest-xdist hypothesis
- run: pip install sympy==${{ matrix.sympy-version }}
- run: python -c 'import sympy; sympy.test(parallel=True)'
# Run SymPy master branch agains python-flint main
test_sympy_master:
name: Test SymPy master
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev
- run: pip install .
- run: pip install pytest pytest-xdist hypothesis
- run: pip install git+https://github.com/sympy/sympy.git@master
- run: python -c 'import sympy; sympy.test(parallel=True)'
# Push nightly wheels to Anaconda scientific-python nightly channel
# https://scientific-python.org/specs/spec-0004/
# https://anaconda.org/scientific-python-nightly-wheels/python-flint
# https://github.com/scientific-python/upload-nightly-action/issues/111
nightly-wheels-upload:
name: Upload Anaconda Scientific Python nightly wheels
needs: [build_wheels]
# Run on push/merge to main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
# Downloads all artifacts
- name: Download release artifacts
uses: actions/download-artifact@v8
with:
path: wheelhouse
merge-multiple: true
- name: Copy the wheels into dist
run: mkdir dist && cp wheelhouse/*.whl dist
- name: Upload wheels
uses: scientific-python/upload-nightly-action@5748273c71e2d8d3a61f3a11a16421c8954f9ecf # 0.6.3
with:
artifacts_path: dist
# This token is generated from anaconda.org
# https://github.com/scientific-python/upload-nightly-action/issues/111
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
# Deploy wheels and sdist to PyPI
pypi_release:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
# Run only when a tag is pushed to the flintlib/python-flint repo
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.repository_owner == 'flintlib'"
environment:
name: pypi
url: https://pypi.org/p/python-flint
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
# Downloads all artifacts
- name: Download release artifacts
uses: actions/download-artifact@v8
with:
path: wheelhouse
merge-multiple: true
- name: Copy the PyPI files into dist
# pyodide wheels cannot be uploaded to PyPI
run: |
mkdir dist
rm wheelhouse/*pyodide*.whl
cp wheelhouse/*.whl wheelhouse/*.tar.gz dist
- name: Publish package on PyPI
# It is recommended to pin a commit hash here for security but it
# should be kept up to date. Possibly all actions and dependencies used
# by the build script should be pinned...
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
# Make a GitHub release
github-publish:
name: Publish GitHub release
needs: pypi_release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6.0.2
- name: Download sdist
uses: actions/download-artifact@v8
with:
name: sdist
path: dist
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: >
gh release create ${{ github.ref_name }} dist/*
--title "python-flint ${{ github.ref_name }}"
--notes "https://github.com/flintlib/python-flint?tab=readme-ov-file#changelog"