Skip to content

Fix GitHub Actions workflow and correct API examples for Python 2.7 + 3.11 compatibility #75

Fix GitHub Actions workflow and correct API examples for Python 2.7 + 3.11 compatibility

Fix GitHub Actions workflow and correct API examples for Python 2.7 + 3.11 compatibility #75

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with multiple Python versions
# Maintains compatibility with Python 2.7 while testing modern Python versions
name: Python Testing
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
test-python2:
runs-on: ubuntu-latest
container: python:2.7-slim
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
apt-get update && apt-get install -y gcc
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Run tests
run: |
mamba
- name: Check Python version
run: python --version
test-python3:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Run tests
run: |
mamba
- name: Check Python version
run: python --version
test-legacy-python3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.5
uses: actions/setup-python@v4
with:
python-version: "3.5"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Run tests
run: |
mamba
- name: Check Python version
run: python --version