Skip to content

Commit 74c7e93

Browse files
MHendrickserikstantoncarlson
authored andcommitted
Re-work testing to support {PySide,PyQt}-{5.15,6}
1 parent dc5d36e commit 74c7e93

File tree

2 files changed

+76
-19
lines changed

2 files changed

+76
-19
lines changed

.github/workflows/static-analysis-and-test.yml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,38 +49,74 @@ jobs:
4949

5050
strategy:
5151
matrix:
52-
os: ['ubuntu-latest', 'windows-latest']
53-
python: ['3.8', '3.9', '3.10', '3.11']
54-
# Works around the depreciation of python 3.7 for ubuntu
55-
# https://github.com/actions/setup-python/issues/544
56-
include:
57-
- os: 'ubuntu-22.04'
58-
python: '3.7'
52+
os: ['ubuntu-22.04', 'windows-latest']
53+
test_env: [
54+
'py39-PyQt5',
55+
'py39-PySide5',
56+
'py310-PyQt5',
57+
'py310-PySide5',
58+
'py311-PyQt5',
59+
'py311-PyQt6.7',
60+
'py311-PyQt6.9',
61+
'py311-PySide6.7',
62+
'py311-PySide6.9',
63+
]
5964

6065
runs-on: ${{ matrix.os }}
6166

6267
steps:
6368
- name: Checkout code
6469
uses: actions/checkout@v4
6570

66-
- name: Setup Python
71+
# Pulled from https://github.com/mottosso/Qt.py/blob/master/.github/actions/setup-tox/action.yml
72+
- name: Install EGL mesa
73+
if: runner.os == 'Linux'
74+
shell: bash
75+
run: |
76+
sudo apt-get update -y -qq
77+
sudo apt-get install -y -qq libegl1-mesa libegl1-mesa-dev libgl1-mesa-glx libgl1-mesa-dev
78+
79+
- name: Install GUI libs
80+
if: runner.os == 'Linux'
81+
shell: bash
82+
run: |
83+
sudo apt-get install -y -qq libxcb-xinerama0
84+
sudo apt-get install -y -qq libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xfixes0 libxcb-cursor0
85+
86+
# Note: The last python to get setup becomes the default for future python calls
87+
- name: Setup Python 3.9
88+
uses: actions/setup-python@v5
89+
with:
90+
python-version: '3.9'
91+
92+
- name: Setup Python 3.11
93+
uses: actions/setup-python@v5
94+
with:
95+
python-version: '3.11'
96+
97+
- name: Setup Python 3.10
6798
uses: actions/setup-python@v5
6899
with:
69-
python-version: ${{ matrix.python }}
100+
python-version: '3.10'
70101

71102
- name: Install dependencies
103+
shell: bash
72104
run: |
105+
python --version
73106
python -m pip install --upgrade pip
74107
python -m pip install tox
75108
76109
- name: Run Tox
110+
# Note: `--skip-missing-interpreters` prevents false success if python
111+
# version is not installed when testing.
77112
run: |
78-
tox -e begin,py
113+
which tox
114+
tox --skip-missing-interpreters false -e begin,${{ matrix.test_env }}
79115
80116
- name: Upload coverage
81117
uses: actions/upload-artifact@v4
82118
with:
83-
name: coverage-${{ matrix.os }}-${{ matrix.python }}
119+
name: coverage-${{ matrix.os }}-${{ matrix.test_env }}
84120
path: .coverage/*
85121
include-hidden-files: true
86122
retention-days: 1

tox.ini

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
[tox]
2-
envlist = begin,py{37,38,39,310,311},end,black,flake8,qt-enum
2+
envlist =
3+
begin
4+
py{39,310}-{PySide,PyQt}5
5+
py311-PySide{6.7,6.9}
6+
py311-{PyQt}{5,6.7,6.9}
7+
end
8+
black
9+
flake8
10+
qt-enum
311
skip_missing_interpreters = True
412

513
[testenv]
614
changedir = {toxinidir}
715
skip_install = True
816
package = editable
9-
deps =
10-
-rrequirements.txt
11-
covdefaults
12-
coverage
13-
pytest
1417
commands =
1518
coverage run -m pytest {tty:--color=yes} {posargs:tests/}
1619

@@ -41,15 +44,33 @@ deps =
4144
commands =
4245
coverage erase
4346

44-
[testenv:py{37,38,39,310,311}]
47+
[testenv:py{39,310,311}-{PySide,PyQt}{5,6.7,6.9}]
4548
depends = begin
4649
skip_install = False
50+
setenv =
51+
# These are required for py37 to prevent errors caused by newer versions
52+
py37: VIRTUALENV_PIP==24.0
53+
py37: VIRTUALENV_SETUPTOOLS==44.1.1
54+
py37: VIRTUALENV_WHEEL==0.42.0
55+
deps =
56+
-rrequirements.txt
57+
covdefaults
58+
coverage
59+
pytest
60+
# Note: PyQt 6.5 and 6.6 have breaking issues on both windows and linux
61+
PyQt5: PyQt5==5.15.*
62+
PyQt6.7: PyQt6==6.7.*
63+
PyQt6.9: PyQt6==6.9.*
64+
65+
PySide5: PySide2==5.15.*
66+
PySide6.7: PySide6==6.7.*
67+
PySide6.9: PySide6==6.9.*
4768

4869
[testenv:end]
4970
basepython = python3
5071
depends =
5172
begin
52-
py{37,38,39,310,311}
73+
py{39,310,311}-{PySide,PyQt}{5,6.7,6.9}
5374
parallel_show_output = True
5475
deps =
5576
coverage

0 commit comments

Comments
 (0)