Skip to content

Convert Python bindings back to Rust #217

Convert Python bindings back to Rust

Convert Python bindings back to Rust #217

name: Python Test Suite
on:
push:
paths:
- .github/workflows/test_suite_python.yml
- bindings/python/conftest.py
- bindings/python/pychecks/**
- bindings/python/pyproject.toml
- bindings/python/src/**
- bindings/python/tests/**
pull_request:
paths:
- .github/workflows/test_suite_python.yml
- bindings/python/conftest.py
- bindings/python/pychecks/**
- bindings/python/pyproject.toml
- bindings/python/src/**
- bindings/python/tests/**
jobs:
test:
name: Python test
defaults:
run:
working-directory: bindings/python
shell: bash
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3" # Latest version
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Setup Python ${{matrix.python-version}}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
cache: 'pip'
- name: Setup virtual environment
run: |
python -m venv .venv
source .venv/bin/activate
- name: Build Rust
uses: PyO3/maturin-action@v1
with:
command: develop
sccache: 'true'
manylinux: auto
- name: Install dependencies
run: python -m pip install .[test]
- name: Run tests
run: |
python -m pytest --hypothesis-profile default -n=auto tests/