BUILD: Add support for Python 3.13 and drop 3.9. #219
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: 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/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
- uses: tj-actions/changed-files@v36 | |
- uses: pre-commit/[email protected] | |
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('["3.12", "pypy3.9"]'), 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@v3 | |
with: | |
files: ./coverage.xml | |
fail_ci_if_error: false |