Skip to content

PR: Setup pre-commit and format all code with Black #996

PR: Setup pre-commit and format all code with Black

PR: Setup pre-commit and format all code with Black #996

Workflow file for this run

# Run the project's test suite
name: Tests
on:
push:
branches:
- master
- main
- '*.x'
pull_request:
branches:
- master
- main
- '*.x'
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test ${{ matrix.os }} Python ${{ matrix.python-version }} conda=${{ matrix.use-conda }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
defaults:
run:
shell: ${{ matrix.special-invocation }}bash -l {0}
env:
CI: 'True'
PYTHON_VERSION: ${{ matrix.python-version }}
USE_CONDA: ${{ matrix.use-conda }}
PYQT5_VERSION: ${{ matrix.pyqt5-version || matrix.qt5-version-default }}
PYQT5_QT_VERSION: ${{ matrix.pyqt5-qt-version || matrix.pyqt5-version || matrix.qt5-version-default }}
PYQT6_VERSION: ${{ matrix.pyqt6-version || matrix.qt6-version-default }}
PYQT6_QT_VERSION: ${{ matrix.pyqt6-qt-version || matrix.pyqt6-version || matrix.qt6-version-default }}
PYSIDE2_VERSION: ${{ matrix.pyside2-version || matrix.qt5-version-default }}
PYSIDE2_QT_VERSION: ${{ matrix.pyside2-qt-version || matrix.pyside2-version || matrix.qt5-version-default }}
PYSIDE6_VERSION: ${{ matrix.pyside6-version || matrix.qt6-version-default }}
PYSIDE6_QT_VERSION: ${{ matrix.pyside6-qt-version || matrix.pyside6-version || matrix.qt6-version-default }}
QSCINTILLA_VERSION: ${{ matrix.qscintilla-version || matrix.qscintilla-version-default }}
SKIP_PIP_CHECK: ${{ matrix.skip-pip-check }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.11']
use-conda: ['Yes', 'No']
qt5-version-default: ['5.12']
qt6-version-default: ['6.3']
qscintilla-version-default: ['2.13']
include:
- os: ubuntu-latest
special-invocation: 'xvfb-run --auto-servernum ' # Needed for GUI tests to work
- python-version: '3.11'
pyqt5-version: '5.15' # Python 3.11 needs 5.15+
pyside2-version: '5.15' # Python 3.11 needs 5.15+
pyside6-version: '6.4' # Python 3.11 needs 6.4+
- use-conda: 'Yes'
skip-pyqt6: true # No PyQt6 conda packages yet
pyside6-version: '6.4' # Conda only has 6.4+ for Python <3.8
- use-conda: 'No'
pyqt5-version: '5.15' # Test with latest optional packages
- python-version: '3.7'
use-conda: 'Yes'
pyside2-version: '5.13' # Conda needs 5.13+ to work reliably
pyside2-qt-version: '5.12' # Conda only has 5.12 and 5.15, not 5.13
- python-version: '3.11'
use-conda: 'No'
skip-pyside2: true # Pyside2 wheels don't support Python 3.11+
pyside6-version: '6.5' # Test upper bound
- os: windows-latest
python-version: '3.7'
use-conda: 'Yes'
pyqt5-version: '5.9' # Test lower bound
skip-pyside6: true # Test hangs
- os: windows-latest
python-version: '3.7'
use-conda: 'No'
pyqt6-version: 6.2 # Test lower bound
pyside6-version: 6.2 # Test lower bound
- os: windows-latest
python-version: '3.11'
use-conda: 'Yes'
skip-pyside6: true # Test hangs
- os: macos-latest
python-version: '3.7'
use-conda: 'No'
pyqt6-version: 6.5 # Test upper bound
pyside2-version: 5.15 # Test upper bound
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Linux system packages
if: contains(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt update
sudo apt install libpulse-dev libegl1-mesa libopengl0 gstreamer1.0-gl
- uses: tlambert03/setup-qt-libs@v1
- name: Install Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ''
auto-activate-base: true
auto-update-conda: true
channels: conda-forge
channel-priority: strict
miniforge-variant: Mambaforge
use-mamba: true
- name: Print Conda info
shell: bash -l {0}
run: |
mamba info
mamba list
- name: Test PyQt5
if: (! matrix.skip-pyqt5)
run: ./.github/workflows/test.sh pyqt5
- name: Test PyQt6
if: always() && (! (matrix.skip-pyqt6))
run: ./.github/workflows/test.sh pyqt6
- name: Test PySide2
if: always() && (! (matrix.skip-pyside2))
run: ./.github/workflows/test.sh pyside2
- name: Test PySide6
if: always() && (! (matrix.skip-pyside6))
run: ./.github/workflows/test.sh pyside6
- name: Upload coverage data to coveralls.io
shell: bash -e {0}
env:
COVERALLS_FLAG_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }} conda=${{ matrix.use-conda }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd temp_test_dir # Switch to test working dir per non-src-layout hack
cat qtpy_basedir.txt
pipx run coveralls --service=github --rcfile="../.coveragerc" --basedir="$(cat qtpy_basedir.txt)"