Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.6, test on 3.11 #419

Merged
merged 1 commit into from Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/main.yml
Expand Up @@ -10,12 +10,10 @@ jobs:
fail-fast: false

matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
qt-lib: [pyqt5, pyqt6, pyside2, pyside6]
os: [ubuntu-20.04, windows-latest, macos-latest]
include:
- python-version: "3.6"
tox-env: "py36"
- python-version: "3.7"
tox-env: "py37"
- python-version: "3.8"
Expand All @@ -24,14 +22,22 @@ jobs:
tox-env: "py39"
- python-version: "3.10"
tox-env: "py310"
- python-version: "3.11-dev"
tox-env: "py311"
# https://bugreports.qt.io/browse/PYSIDE-1797
exclude:
- qt-lib: pyside6
os: macos-latest
python-version: "3.6"
python-version: "3.7"
- qt-lib: pyside6
os: macos-latest
os: ubuntu-20.04
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff here is a bit confusing.

  • Dropped the Python 3.6 macOS exclude (not testing there anymore)
  • Kept the existing Python 3.7 macOS exclude
  • Added a new Python 3.7 Linux exclude: issue comment
  • Added a new Python 3.11 PySide6 exclude (pip refuses to install the wheel)
  • ditto for PySide2 on Python 3.11 on Windows

python-version: "3.7"
# Not installable so far
- qt-lib: pyside6
python-version: "3.11-dev"
- qt-lib: pyside2
os: windows-latest
python-version: "3.11-dev"

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
@@ -1,6 +1,7 @@
UNRELEASED
----------

- ``pytest-qt`` now requires Python 3.7+.
- Improved PEP-8 aliases definition so they have a smaller call stack depth by one and better parameter suggestions in IDEs. (`#383`_). Thanks `@luziferius`_ for the PR.

.. _#383: https://github.com/pytest-dev/pytest-qt/pull/383
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.rst
Expand Up @@ -74,7 +74,7 @@ Features
Requirements
============

Since version 4.0.0, ``pytest-qt`` requires Python 3.6+.
``pytest-qt`` requires Python 3.7+.

Works with either PySide6_, PySide2_, PyQt6_ or PyQt5_, picking whichever
is available on the system, giving preference to the first one installed in
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -23,15 +23,14 @@
url="http://github.com/pytest-dev/pytest-qt",
use_scm_version={"write_to": "src/pytestqt/_version.py"},
setup_requires=["setuptools_scm"],
python_requires=">=3.6",
python_requires=">=3.7",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand Down
18 changes: 15 additions & 3 deletions tests/test_modeltest.py
@@ -1,3 +1,5 @@
import sys

import pytest

from pytestqt.qt_compat import qt_api
Expand Down Expand Up @@ -94,12 +96,22 @@ def data(
check_model(BrokenTypeModel(), should_pass=False)


xfail_py311_pyside2 = pytest.mark.xfail(
sys.version_info[:2] == (3, 11) and qt_api.pytest_qt_api == "pyside2",
reason="Fails to OR mask flags",
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is a PySide2 or Python 3.11 bug:

>>> int(QtCore.Qt.AlignmentFlag.AlignHorizontal_Mask | QtCore.Qt.AlignmentFlag.AlignVertical_Mask)
TypeError: 'PySide2.QtCore.Qt.AlignmentFlag' object cannot be interpreted as an integer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: <class 'int'> returned a result with an exception set

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This XPASSes for me on openSUSE Python 3.11.3 and PySide2 5.15.10

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnavigator Thanks, #497 should help.



@pytest.mark.parametrize(
"role_value, should_pass",
[
(qt_api.QtCore.Qt.AlignmentFlag.AlignLeft, True),
(qt_api.QtCore.Qt.AlignmentFlag.AlignRight, True),
(0xFFFFFF, False),
pytest.param(
qt_api.QtCore.Qt.AlignmentFlag.AlignLeft, True, marks=xfail_py311_pyside2
),
pytest.param(
qt_api.QtCore.Qt.AlignmentFlag.AlignRight, True, marks=xfail_py311_pyside2
),
pytest.param(0xFFFFFF, False, marks=xfail_py311_pyside2),
("foo", False),
(object(), False),
],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37,38,39,310}-{pyqt5,pyside2,pyside6,pyqt6}, linting
envlist = py{37,38,39,310}-{pyqt5,pyside2,pyside6,pyqt6}, linting

[testenv]
deps=
Expand Down