Skip to content

Adding python 3.12 support #144

Adding python 3.12 support

Adding python 3.12 support #144

# Reference: napari/napari github workflows
name: test PR
on:
pull_request:
branches:
- main
jobs:
test:
name: ${{ matrix.platform }} ${{ matrix.python }} ${{ matrix.toxenv || matrix.backend }}
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
python: ["3.9", "3.12"]
backend: [pyqt5]
include:
- python: 3.11
platform: windows-latest
backend: pyqt5
- python: 3.11
platform: macos-latest
backend: pyside2
- python: 3.11
platform: ubuntu-latest
backend: pyqt6
- python: 3.11 # only this run execute coverage
platform: ubuntu-latest
backend: pyside6
coverage: true
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
# see https://github.com/actions/runner-images/issues/709#issuecomment-612569242
- name: Workaround to free up space on github runner
if: runner.os == 'Linux'
run: sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- uses: tlambert03/setup-qt-libs@v1
# strategy borrowed from vispy for installing opengl libs on windows
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
if (Test-Path -Path "C:\Windows\system32\opengl32.dll" -PathType Leaf) {Exit 0} else {Exit 1}
# tox and tox-gh-actions will take care of the "actual" installation
# of python dependendencies into a virtualenv. see tox.ini for more
- name: Install dependencies
run: |
pip install --upgrade pip
pip install setuptools tox tox-gh-actions
pip install ".[api]"
# here we pass off control of environment creation and running of tests to tox
# tox-gh-actions, installed above, helps to convert environment variables into
# tox "factors" ... limiting the scope of what gets tested on each platform
# for instance, on ubuntu-latest with python 3.8, it would be equivalent to this command:
# `tox -e py38-linux-pyqt,py38-linux-pyside`
# see tox.ini for more
- name: Test with tox
uses: GabrielBB/xvfb-action@v1
with:
run: python -m tox
env:
PLATFORM: ${{ matrix.platform }}
BACKEND: ${{ matrix.backend }}
TOXENV: ${{ matrix.toxenv }}
- name: Coverage
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v3