Skip to content

Commit 0626040

Browse files
authored
Merge pull request #463 from blurstudio-forks/mikeh/py_fixes
Fix py3.7 tests, add testing for Cy2026 and py3.12 and py3.14
2 parents 39cdebf + dd4ad43 commit 0626040

6 files changed

Lines changed: 55 additions & 25 deletions

File tree

.github/actions/setup-tox/action.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,31 @@ runs:
4141
with:
4242
python-version: '3.11'
4343

44+
- name: Setup Python 3.12
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: '3.12'
48+
49+
- name: Setup Python 3.13
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: '3.13'
53+
54+
- name: Setup Python 3.14
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: '3.14'
58+
4459
- name: Setup Python 3.10
4560
uses: actions/setup-python@v5
4661
with:
4762
python-version: '3.10'
4863

4964
- name: Install dependencies
5065
shell: bash
66+
# NOTE: The virtualenv and tox requirements support finding python 3.7,
67+
# if we drop support for python 3.7 the reqs can be simplified and updated
5168
run: |
5269
python --version
5370
python -m pip install --upgrade pip
54-
python -m pip install tox
71+
python -m pip install "tox<=4.23.2" "virtualenv<=20.26.6"

.github/workflows/run-tox.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ jobs:
104104
# Cy2024, Cy2025
105105
'test-py311-PySide6.5',
106106
'test-py311-PyQt6.5',
107+
# Cy2026
108+
'test-py313-PySide6.8',
109+
'test-py313-PyQt6.8',
110+
# Test newer versions of python/Qt than VFX Reference Platform has chosen
111+
'test-py312-PySide6.8',
112+
'test-py312-PyQt6.8',
113+
'test-py314-PySide6.9',
114+
'test-py314-PyQt6.9',
107115
]
108116

109117
env:

.hound.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![PyPI version](https://badge.fury.io/py/Qt.py.svg)](https://pypi.python.org/pypi/Qt.py)
66
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/qt.py/badges/version.svg)](https://anaconda.org/conda-forge/qt.py)
77
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Qt-py/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8-
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
98

109
Qt.py enables you to write software that runs on any of the 4 supported bindings - PySide6, PyQt6, PySide2, PyQt5.
1110

tests.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import re
77
import sys
8-
import imp
8+
import importlib.util
99
import shutil
1010
import tempfile
1111
import textwrap
@@ -452,11 +452,15 @@ def test_environment():
452452

453453
if sys.version_info >= (3, 11):
454454
# NOTE: Qt6 is only available for python 3.11 and above
455-
imp.find_module("PySide6")
456-
imp.find_module("PyQt6")
455+
if importlib.util.find_spec("PySide6") is None:
456+
raise ImportError("No module named 'PySide6'")
457+
if importlib.util.find_spec("PyQt6") is None:
458+
raise ImportError("No module named 'PyQt6'")
457459
else:
458-
imp.find_module("PySide2")
459-
imp.find_module("PyQt5")
460+
if importlib.util.find_spec("PySide2") is None:
461+
raise ImportError("No module named 'PySide2'")
462+
if importlib.util.find_spec("PyQt5") is None:
463+
raise ImportError("No module named 'PyQt5'")
460464

461465

462466
def test_load_ui_returntype():
@@ -1194,7 +1198,10 @@ def test_cli():
11941198
)
11951199

11961200
out, err = popen.communicate()
1197-
assert out.startswith(b"usage: Qt.py"), "\n%s" % out.decode()
1201+
# Py 3.14 seems to add color codes by default, strip them out for the test
1202+
# Source - https://stackoverflow.com/a/14693789
1203+
out = re.sub(rb"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])", b"", out)
1204+
assert b"usage: Qt.py" in out, "\n%s" % out.decode()
11981205

11991206

12001207
def test_membership():

tox.ini

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ envlist =
2323
# Combinations of python and Qt versions that should work
2424
; membership-py37-PySide{5.12,5.15}
2525
; membership-py{38,39,310}-PySide{5.15}
26-
; membership-py{39,310,311,312}-PySide{6.5,6.6}
27-
; membership-py{39,310,311,312}-{PySide,PyQt}{6.7,6.8,6.9}
26+
; membership-py{39,310,311,312,313,314}-PySide{6.5,6.6}
27+
; membership-py{39,310,311,312,313,314}-{PySide,PyQt}{6.7,6.8,6.9,6.10}
2828
# Generate common members from the previous tests generated files
2929
membership-end
3030

@@ -44,7 +44,10 @@ envlist =
4444
# Cy2024, Cy2025
4545
test-py311-{PySide,PyQt}6.5-{impl,caveats,examples}
4646
# Cy2026
47-
; test-py313-{PySide,PyQt}6.8
47+
test-py313-{PySide,PyQt}6.8
48+
# Test newer versions of python/Qt than VFX Reference Platform has chosen
49+
test-py{312}-{PySide,PyQt}{6.8}-{impl,caveats,examples}
50+
test-py{314}-{PySide,PyQt}{6.9}-{impl,caveats,examples}
4851

4952
# Standardize formatting and check for code quality issues
5053
check
@@ -76,14 +79,14 @@ setenv =
7679
commands =
7780
python membership.py --clean
7881

79-
[testenv:membership-py{37,38,39,310,311,312,313}-{PySide,PyQt}{5.12,5.13,5.15,6.5,6.6,6.7,6.8,6.9}]
82+
[testenv:membership-py{37,38,39,310,311,312,313,314}-{PySide,PyQt}{5.12,5.13,5.15,6.5,6.6,6.7,6.8,6.9,6.10}]
8083
depends = membership-begin
8184
setenv =
8285
{[testenv]setenv}
8386
PySide{5.12,5.13,5.15}: BINDING=PySide2
84-
PySide{6.5,6.6,6.7,6.8,6.9}: BINDING=PySide6
87+
PySide{6.5,6.6,6.7,6.8,6.9,6.10}: BINDING=PySide6
8588
PyQt{5.12,5.13,5.15}: BINDING=PyQt5
86-
PyQt{6.5,6.6,6.7,6.8,6.9}: BINDING=PyQt6
89+
PyQt{6.5,6.6,6.7,6.8,6.9,6.10}: BINDING=PyQt6
8790
deps =
8891
PyQt5.12: PyQt5==5.12.*
8992
PyQt5.13: PyQt5==5.13.*
@@ -101,14 +104,13 @@ deps =
101104
PySide6.6: PySide6==6.6.*
102105
PySide6.7: PySide6==6.7.*
103106
PySide6.8: PySide6==6.8.*
104-
PySide6.9: PySide6==6.9.*
105107
commands =
106108
# Build the membership for the requested Qt binding
107109
python membership.py --binding {env:BINDING}
108110

109111
[testenv:membership-end]
110112
# Combine the .json files generated by previous tests into the common member files.
111-
depends = membership-py{37,38,39,310,311,312,313}-{PySide,PyQt}{5.12,5.13,5.15,6.5,6.6,6.7,6.8,6.9}
113+
depends = membership-py{37,38,39,310,311,312,313,314}-{PySide,PyQt}{5.12,5.13,5.15,6.5,6.6,6.7,6.8,6.9,6.10}
112114
commands =
113115
python membership.py --generate-common-members
114116

@@ -121,7 +123,7 @@ commands =
121123
# doesn't get changed while another process is trying to read it.
122124
python -u build_caveats.py
123125

124-
[testenv:test-py{37,38,39,310,311,312,313}-{PySide,PyQt}{5.12,5.13,5.15,6.5,6.6,6.7,6.8,6.9}-{impl,caveats,examples}]
126+
[testenv:test-py{37,38,39,310,311,312,313,314}-{PySide,PyQt}{5.12,5.13,5.15,6.5,6.6,6.7,6.8,6.9,6.10}-{impl,caveats,examples}]
125127
# Run nose tests for each requirement
126128
# We need Qt.py to be installed for nose tests
127129
skip_install = False
@@ -136,9 +138,9 @@ setenv =
136138
{[testenv]setenv}
137139
QT_VERBOSE=1
138140
PySide{5.12,5.13,5.15}: QT_PREFERRED_BINDING=PySide2
139-
PySide{6.5,6.6,6.7,6.8,6.9}: QT_PREFERRED_BINDING=PySide6
141+
PySide{6.5,6.6,6.7,6.8,6.9,6.10}: QT_PREFERRED_BINDING=PySide6
140142
PyQt{5.12,5.13,5.15}: QT_PREFERRED_BINDING=PyQt5
141-
PyQt{6.5,6.6,6.7,6.8,6.9}: QT_PREFERRED_BINDING=PyQt6
143+
PyQt{6.5,6.6,6.7,6.8,6.9,6.10}: QT_PREFERRED_BINDING=PyQt6
142144
# These are required for py37 to prevent errors caused by newer versions
143145
py37: VIRTUALENV_PIP==24.0
144146
py37: VIRTUALENV_SETUPTOOLS==44.1.1
@@ -163,8 +165,9 @@ deps =
163165
{PySide,PyQt}6.7: PySide6==6.7.*
164166
{PySide,PyQt}6.8: PyQt6==6.8.*
165167
{PySide,PyQt}6.8: PySide6==6.8.*
166-
{PySide,PyQt}6.9: PyQt6==6.9.*
167-
{PySide,PyQt}6.9: PySide6==6.9.*
168+
# Note: PyQt6==6.10.* doesn't support QAxContainer and PySide6 didn't compile 6.9
169+
{PySide,PyQt}{6.9,6.10}: PyQt6==6.9.*
170+
{PySide,PyQt}{6.9,6.10}: PySide6==6.10.*
168171

169172
nose2
170173
nosepipe

0 commit comments

Comments
 (0)