Add Python 3.13 support. Deprecate 3.8 support. #553
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continous integration | |
on: | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '*.rst' | |
push: | |
branches: | |
- develop | |
- main | |
tags: | |
- "*" | |
jobs: | |
package-checks: | |
strategy: | |
matrix: | |
tox_env: | |
- twine_check | |
- docs | |
- lint | |
- pedantic_compile | |
- html5validator | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install tox | |
run: pip install --upgrade tox | |
- name: Run tox -e ${{ matrix.tox_env }} | |
run: tox -e ${{ matrix.tox_env }} | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
os: ["ubuntu-latest"] | |
include: | |
# MacOS ARM m1 | |
- os: "macos-latest" | |
python-version: "3.9" | |
- os: "macos-latest" | |
python-version: "3.13" | |
# MacOS x86-64 | |
- os: "macos-13" | |
python-version: "3.9" | |
- os: "macos-13" | |
python-version: "3.13" | |
- os: "windows-latest" | |
python-version: "3.9" | |
- os: "windows-latest" | |
python-version: "3.13" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install tox | |
run: pip install tox | |
- name: Run tests | |
run: tox | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v1 | |
test-arch: | |
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: uraimo/run-on-arch-action@v2.7.1 | |
name: Build & run test | |
with: | |
arch: none | |
distro: none | |
base_image: quay.io/pypa/manylinux2014_aarch64 | |
run: | | |
/opt/python/cp311-cp311/bin/pip install tox | |
/opt/python/cp311-cp311/bin/tox | |
deploy: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
runs-on: ${{ matrix.os }} | |
needs: [package-checks, test, test-arch] | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-13 | |
- macos-latest | |
- windows-latest | |
cibw_archs_linux: ["x86_64"] | |
build_sdist: [true] | |
include: | |
- os: "ubuntu-latest" | |
cibw_archs_linux: "aarch64" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
- name: Install cibuildwheel twine wheel | |
run: python -m pip install cibuildwheel twine wheel | |
- name: Set up QEMU | |
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'aarch64'}} | |
uses: docker/setup-qemu-action@v1.0.1 | |
with: | |
platforms: arm64 | |
- name: Build wheels | |
run: cibuildwheel --output-dir dist | |
env: | |
CIBW_SKIP: "*-win32 *-manylinux_i686 pp3*" # Skip 32 bit, pypy | |
CIBW_ENVIRONMENT_LINUX: >- | |
CFLAGS="-g0 -DNDEBUG" | |
CIBW_ENVIRONMENT_MACOS: >- | |
CFLAGS="-g0 -DNDEBUG" | |
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }} | |
# Fully test the build wheels again. | |
CIBW_TEST_REQUIRES: "pytest" | |
# Simple test that requires the project to be build correctly | |
CIBW_TEST_COMMAND: >- | |
pytest {project}/tests/ | |
- name: Build sdist | |
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}} | |
run: | | |
pip install build | |
python -m build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "dist-${{ runner.os }}-${{ runner.arch }}-${{ matrix.cibw_archs_linux }}" | |
path: "dist/" | |
- name: Publish package to TestPyPI | |
# pypa/gh-action-pypi-publish@master does not work on OSX | |
# Alpha, Beta and dev releases contain a - in the tag. | |
if: contains(github.ref, '-') && startsWith(github.ref, 'refs/tags') | |
run: twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
- name: Publish package to PyPI | |
if: "!contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')" | |
run: twine upload --skip-existing dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |