BUILD: Add support for Python 3.13 and drop 3.9. #224
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04, macOS-12, windows-2019 ] | |
python-version: [ '3.10', 'pypy3.10', '3.11', '3.12', '3.13' ] | |
fail-fast: false | |
name: Python version - ${{ matrix.python-version }} - ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4.7.1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
- uses: tj-actions/changed-files@v36 | |
- uses: pre-commit/action@v3.0.0 | |
with: | |
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }} | |
- name: Install Dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements-dev.txt | |
- name: Run Pytest, report coverage | |
# Cython's linetracing is broken in 3.12 due to changes in the python c-API | |
# so we have to turn if off and not report coverage for the version until | |
# it can be used again. See: https://github.com/cython/cython/issues/5470 | |
env: | |
BUILD_WITH_COVERAGE: true | |
run: | | |
cythonize polyagamma/*.pyx -X linetrace=${{ contains(fromJSON('["pypy3.10"]'), matrix.python-version) && 'False' || 'True' }} | |
python3 -m pip install -e . | |
pytest -v --cov-branch --cov=polyagamma tests/ --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
fail_ci_if_error: false |