Skip to content

BUILD: Remove cython as hard build dependency. #189

BUILD: Remove cython as hard build dependency.

BUILD: Remove cython as hard build dependency. #189

Workflow file for this run

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-11, windows-2019 ]
python-version: [ '3.9', 'pypy3.9', '3.10', '3.11', '3.12' ]
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('["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