From 314e4eb480f6514aeb5a0b0b04705c91db8867f8 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Thu, 15 Apr 2021 21:02:29 -0700 Subject: [PATCH 01/10] Unescaped sequence and fix typo --- pyqtgraph/graphicsItems/ROI.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py index 2dcbc759..ce6326ac 100644 --- a/pyqtgraph/graphicsItems/ROI.py +++ b/pyqtgraph/graphicsItems/ROI.py @@ -2266,7 +2266,7 @@ class LineSegmentROI(ROI): Since this pulls 1D data from a 2D coordinate system, the return value will have ndim = data.ndim-1 - See :meth:`~pytqgraph.ROI.getArrayRegion` for a description of the + See :meth:`~pyqtgraph.ROI.getArrayRegion` for a description of the arguments. """ imgPts = [self.mapToItem(img, h.pos()) for h in self.endpoints] @@ -2384,7 +2384,7 @@ class RulerROI(LineSegmentROI): class TriangleROI(ROI): - """ + r""" Equilateral triangle ROI subclass with one scale handle and one rotation handle. Arguments pos (length-2 sequence) The position of the ROI's origin. From 5c67f03b0e795905f13e2c34442cdd440ba97551 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Thu, 15 Apr 2021 21:02:49 -0700 Subject: [PATCH 02/10] skip test without generating warning --- pyqtgraph/tests/test_makeARGB.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyqtgraph/tests/test_makeARGB.py b/pyqtgraph/tests/test_makeARGB.py index 0ee40646..d4b5d889 100644 --- a/pyqtgraph/tests/test_makeARGB.py +++ b/pyqtgraph/tests/test_makeARGB.py @@ -4290,12 +4290,10 @@ def test_makeARGB_against_generated_references(): _do_something_for_every_combo(assert_correct) +@pytest.mark.skipif(getCupy() is None, reason="CuPy unavailable to test") def test_cupy_makeARGB_against_generated_references(): setConfigOption("useCupy", True) cp = getCupy() - if cp is None: - pytest.skip("CuPy unavailable to test") - def assert_cupy_correct(data, key, levels, lut, scale, use_rgba): data = cp.asarray(data) if lut is not None: From 435c54d20b98119b1e2f972d644e4c2610bb2c63 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Thu, 15 Apr 2021 21:09:11 -0700 Subject: [PATCH 03/10] Adjust pytest.ini warning suppressions Show standard library Deprecation and PendingDeprecation warnings Remove warning filters used for older Qt bindings no longer supported --- pytest.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pytest.ini b/pytest.ini index cc80f5f7..550a2faa 100644 --- a/pytest.ini +++ b/pytest.ini @@ -7,15 +7,15 @@ xvfb_args=-ac +extension GLX +render faulthandler_timeout = 30 filterwarnings = + # re-enable standard library warnings + once::DeprecationWarning + once::PendingDeprecationWarning # comfortable skipping these warnings runtime warnings # https://stackoverflow.com/questions/40845304/runtimewarning-numpy-dtype-size-changed-may-indicate-binary-incompatibility ignore:numpy.ufunc size changed, may indicate binary incompatibility.*:RuntimeWarning - # Warnings generated from PyQt5.9 + # pyside2_512 specific issue ignore:This method will be removed in future versions. Use 'tree.iter\(\)' or 'list\(tree.iter\(\)\)' instead.:PendingDeprecationWarning - ignore:.*'U' mode is deprecated.*:DeprecationWarning - # py36/pyside2_512 specific issue - ignore:split\(\) requires a non-empty pattern match\.:FutureWarning # pyqtgraph specific warning we want to ignore during testing ignore:Visible window deleted. To prevent this, store a reference to the window object. - # xvfb warnings + # xvfb warnings on non-linux systems ignore:Unknown config option:pytest.PytestConfigWarning From e735d2d9b8afb449e59558a87d8b4eebe81e54d0 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Thu, 15 Apr 2021 22:08:50 -0700 Subject: [PATCH 04/10] Block pyopenGL tests on more macOS platforms When running on macOS Big Sur, pyopenGL is unable to find the bindings Previously this was assumed that it would be fixed in later versions of Python 3.8, but that has not happened. --- examples/test_examples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/test_examples.py b/examples/test_examples.py index 4339875c..5b8aa07f 100644 --- a/examples/test_examples.py +++ b/examples/test_examples.py @@ -58,7 +58,7 @@ installedFrontends = sorted([ darwin_opengl_broken = (platform.system() == "Darwin" and tuple(map(int, platform.mac_ver()[0].split("."))) >= (10, 16) and - (sys.version_info <= (3, 8, 7) or (3, 9) <= sys.version_info < (3, 9, 1))) + sys.version_info < (3, 9, 1)) darwin_opengl_reason = ("pyopenGL cannot find openGL library on big sur: " "https://github.com/python/cpython/pull/21241") From 52de9554bbba60883f4cd15f0e366d5494899dc5 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Thu, 15 Apr 2021 22:50:16 -0700 Subject: [PATCH 05/10] Emit warning about pyside2 bug preventing loading --- pyqtgraph/debug.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/debug.py b/pyqtgraph/debug.py index 1d12e9e0..15d1fb3c 100644 --- a/pyqtgraph/debug.py +++ b/pyqtgraph/debug.py @@ -5,14 +5,21 @@ Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more information. """ + from __future__ import print_function import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading +import warnings from . import ptime from numpy import ndarray -from .Qt import QtCore, QtGui -from .util.mutex import Mutex +from .Qt import QtCore, QT_LIB from .util import cprint +if sys.version.startswith("3.8") and QT_LIB == "PySide2": + from .Qt import PySide2 + if tuple(map(int, PySide2.__version__.split("."))) < (5, 14): + warnings.warn("Due to PYSIDE-1140, ThreadChase and ThreadColor won't work") +from .util.mutex import Mutex + __ftraceDepth = 0 def ftrace(func): From 342fbb053f3fdc43b2f19bdee270a6faa58d7c43 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Thu, 15 Apr 2021 22:50:50 -0700 Subject: [PATCH 06/10] Avoid implicit int conversion for mouse buttons --- pyqtgraph/graphicsItems/ROI.py | 2 +- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py index ce6326ac..c2cb49ed 100644 --- a/pyqtgraph/graphicsItems/ROI.py +++ b/pyqtgraph/graphicsItems/ROI.py @@ -800,7 +800,7 @@ class ROI(GraphicsObject): if ev.button() == QtCore.Qt.RightButton and self.contextMenuEnabled(): self.raiseContextMenu(ev) ev.accept() - elif ev.button() & self.acceptedMouseButtons(): + elif ev.button() in self.acceptedMouseButtons(): ev.accept() self.sigClicked.emit(self, ev) else: diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index 83d095b7..6725d78b 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -1243,7 +1243,7 @@ class ViewBox(GraphicsWidget): mask[1-axis] = 0.0 ## Scale or translate based on mouse button - if ev.button() & (QtCore.Qt.LeftButton | QtCore.Qt.MiddleButton): + if ev.button() in [QtCore.Qt.LeftButton, QtCore.Qt.MiddleButton]: if self.state['mouseMode'] == ViewBox.RectMode and axis is None: if ev.isFinish(): ## This is the final move in the drag; change the view scale now #print "finish" From a231c9ffb0c79a6759a0a306e9bbb2c3e0e9dae3 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Thu, 15 Apr 2021 22:50:59 -0700 Subject: [PATCH 07/10] Update tox.ini config --- tox.ini | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/tox.ini b/tox.ini index c05fe689..6c0d03d4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,43 +1,37 @@ [tox] envlist = - ; qt latest - py{37,38}-{pyqt5,pyside2}_latest + ; qt 5.15.x + py{37,38,39}-{pyqt5,pyside2}_515 - ; qt 5.12.x (LTS) - py{36,37}-{pyqt5,pyside2}_512 + ; qt 5.12.x + py{37}-{pyqt5,pyside2}_512 + ; py38-pyside2_512 doesn't work due to PYSIDE-1140 + py38-pyqt5_512 - ; qt 5.9.7 (LTS) - py36-{pyqt5,pyside2}_59_conda + ; qt 6 + py{37,38,39}-{pyqt6,pyside6} [base] deps = pytest + pytest-xdist numpy scipy pyopengl - flake8 - coverage + h5py [testenv] -passenv = DISPLAY XAUTHORITY +passenv = DISPLAY XAUTHORITY, PYTHON_VERSION setenv = PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command deps= {[base]deps} - pytest-cov - h5py - pyside2_512: pyside2>=5.12,<5.13 - pyqt5_512: pyqt5>=5.12,<5.13 - pyside2_latest: pyside2 - pyqt5_latest: pyqt5 - -conda_deps= - pyside2_59_conda: pyside2=5.9 - pyqt5_59_conda: pyqt=5.9 - -conda_channels= - conda-forge - free + pyside2_512: pyside2==5.12.6 + pyqt5_512: pyqt5==5.12.3 + pyside2_515: pyside2 + pyqt5_515: pyqt5 + pyqt6: pyqt6 + pyside6: pyside6 commands= python -c "import pyqtgraph as pg; pg.systemInfo()" - pytest {posargs:} + pytest -n auto {posargs:} From 7740de4a26794f005e1b04f2da474c736376c3be Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Thu, 15 Apr 2021 23:05:38 -0700 Subject: [PATCH 08/10] Update README table show not-supported configs --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 904b48a7..7488887e 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,14 @@ The following table represents the python environments we test in our CI system. | Qt-Bindings | Python 3.7 | Python 3.8 | Python 3.9 | | :------------- | :----------------: | :----------------: | :----------------: | | PySide2-5.12 | :white_check_mark: | :x: | :x: | -| PyQt5-5.12 | :white_check_mark: | :x: | :x: | -| PySide2-5.15 | :x: | :white_check_mark: | :x: | -| PyQt5-5.15 | :x: | :white_check_mark: | :x: | -| PySide6-6.0 | :x: | :x: | :white_check_mark: | -| PyQt6-6.0 | :x: | :x: | :white_check_mark: | +| PyQt5-5.12 | :white_check_mark: | | :x: | +| PySide2-5.15 | | :white_check_mark: | | +| PyQt5-5.15 | | :white_check_mark: | | +| PySide6-6.0 | | | :white_check_mark: | +| PyQt6-6.0 | | | :white_check_mark: | + +* :x: - Not compatible +* :white_check_mark: - Tested Support ------- From 41eadd678baf04c1eefdb327665dd96d998d8913 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Fri, 16 Apr 2021 22:32:14 -0700 Subject: [PATCH 09/10] Remove build docs CI job Now that readthedocs supports building docs on pull requests, we no longer need to build the docs ourselves as part of the CI pipeline. --- .github/workflows/main.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa49b710..5ca11fdc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -120,29 +120,9 @@ jobs: env: SCREENSHOT_DIR: ./screenshots - build-docs: - name: build docs - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - name: Install Dependencies - run: | - cd doc - python -m pip install -r requirements.txt - - name: Build Documentation - run: | - cd doc - make html SPHINXOPTS='-W --keep-going -v' - build-wheel: name: build wheel runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - name: Setup Python 3.9 From 1326ebe2f47cafef5ec6450791a1a7eea9dfe2fa Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Fri, 16 Apr 2021 22:33:59 -0700 Subject: [PATCH 10/10] Update numpy version used in CI from 1.19 to 1.20 --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5ca11fdc..ab4a2060 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,19 +24,19 @@ jobs: - python-version: "3.8" qt-lib: "pyqt" qt-version: "PyQt5~=5.15.0" - numpy-version: "~=1.19.0" + numpy-version: "~=1.20.0" - python-version: "3.8" qt-lib: "pyside" qt-version: "PySide2~=5.15.0" - numpy-version: "~=1.19.0" + numpy-version: "~=1.20.0" - python-version: "3.9" qt-lib: "pyqt" qt-version: "PyQt6" - numpy-version: "~=1.19.0" + numpy-version: "~=1.20.0" - python-version: "3.9" qt-lib: "pyside" qt-version: "PySide6" - numpy-version: "~=1.19.0" + numpy-version: "~=1.20.0" steps: - name: Checkout uses: actions/checkout@v2