Merge pull request #1716 from j9ac9k/cleanup-pytest-opts
Update pytest and tox configs, fix misc warnings
This commit is contained in:
commit
2b2b8d34c2
28
.github/workflows/main.yml
vendored
28
.github/workflows/main.yml
vendored
|
@ -24,19 +24,19 @@ jobs:
|
||||||
- python-version: "3.8"
|
- python-version: "3.8"
|
||||||
qt-lib: "pyqt"
|
qt-lib: "pyqt"
|
||||||
qt-version: "PyQt5~=5.15.0"
|
qt-version: "PyQt5~=5.15.0"
|
||||||
numpy-version: "~=1.19.0"
|
numpy-version: "~=1.20.0"
|
||||||
- python-version: "3.8"
|
- python-version: "3.8"
|
||||||
qt-lib: "pyside"
|
qt-lib: "pyside"
|
||||||
qt-version: "PySide2~=5.15.0"
|
qt-version: "PySide2~=5.15.0"
|
||||||
numpy-version: "~=1.19.0"
|
numpy-version: "~=1.20.0"
|
||||||
- python-version: "3.9"
|
- python-version: "3.9"
|
||||||
qt-lib: "pyqt"
|
qt-lib: "pyqt"
|
||||||
qt-version: "PyQt6"
|
qt-version: "PyQt6"
|
||||||
numpy-version: "~=1.19.0"
|
numpy-version: "~=1.20.0"
|
||||||
- python-version: "3.9"
|
- python-version: "3.9"
|
||||||
qt-lib: "pyside"
|
qt-lib: "pyside"
|
||||||
qt-version: "PySide6"
|
qt-version: "PySide6"
|
||||||
numpy-version: "~=1.19.0"
|
numpy-version: "~=1.20.0"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -120,29 +120,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
SCREENSHOT_DIR: ./screenshots
|
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:
|
build-wheel:
|
||||||
name: build wheel
|
name: build wheel
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Setup Python 3.9
|
- name: Setup Python 3.9
|
||||||
|
|
13
README.md
13
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 |
|
| Qt-Bindings | Python 3.7 | Python 3.8 | Python 3.9 |
|
||||||
| :------------- | :----------------: | :----------------: | :----------------: |
|
| :------------- | :----------------: | :----------------: | :----------------: |
|
||||||
| PySide2-5.12 | :white_check_mark: | :x: | :x: |
|
| PySide2-5.12 | :white_check_mark: | :x: | :x: |
|
||||||
| PyQt5-5.12 | :white_check_mark: | :x: | :x: |
|
| PyQt5-5.12 | :white_check_mark: | | :x: |
|
||||||
| PySide2-5.15 | :x: | :white_check_mark: | :x: |
|
| PySide2-5.15 | | :white_check_mark: | |
|
||||||
| PyQt5-5.15 | :x: | :white_check_mark: | :x: |
|
| PyQt5-5.15 | | :white_check_mark: | |
|
||||||
| PySide6-6.0 | :x: | :x: | :white_check_mark: |
|
| PySide6-6.0 | | | :white_check_mark: |
|
||||||
| PyQt6-6.0 | :x: | :x: | :white_check_mark: |
|
| PyQt6-6.0 | | | :white_check_mark: |
|
||||||
|
|
||||||
|
* :x: - Not compatible
|
||||||
|
* :white_check_mark: - Tested
|
||||||
|
|
||||||
Support
|
Support
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -58,7 +58,7 @@ installedFrontends = sorted([
|
||||||
|
|
||||||
darwin_opengl_broken = (platform.system() == "Darwin" and
|
darwin_opengl_broken = (platform.system() == "Darwin" and
|
||||||
tuple(map(int, platform.mac_ver()[0].split("."))) >= (10, 16) 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: "
|
darwin_opengl_reason = ("pyopenGL cannot find openGL library on big sur: "
|
||||||
"https://github.com/python/cpython/pull/21241")
|
"https://github.com/python/cpython/pull/21241")
|
||||||
|
|
|
@ -5,14 +5,21 @@ Copyright 2010 Luke Campagnola
|
||||||
Distributed under MIT/X11 license. See license.txt for more information.
|
Distributed under MIT/X11 license. See license.txt for more information.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading
|
import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading
|
||||||
|
import warnings
|
||||||
from . import ptime
|
from . import ptime
|
||||||
from numpy import ndarray
|
from numpy import ndarray
|
||||||
from .Qt import QtCore, QtGui
|
from .Qt import QtCore, QT_LIB
|
||||||
from .util.mutex import Mutex
|
|
||||||
from .util import cprint
|
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
|
__ftraceDepth = 0
|
||||||
def ftrace(func):
|
def ftrace(func):
|
||||||
|
|
|
@ -800,7 +800,7 @@ class ROI(GraphicsObject):
|
||||||
if ev.button() == QtCore.Qt.RightButton and self.contextMenuEnabled():
|
if ev.button() == QtCore.Qt.RightButton and self.contextMenuEnabled():
|
||||||
self.raiseContextMenu(ev)
|
self.raiseContextMenu(ev)
|
||||||
ev.accept()
|
ev.accept()
|
||||||
elif ev.button() & self.acceptedMouseButtons():
|
elif ev.button() in self.acceptedMouseButtons():
|
||||||
ev.accept()
|
ev.accept()
|
||||||
self.sigClicked.emit(self, ev)
|
self.sigClicked.emit(self, ev)
|
||||||
else:
|
else:
|
||||||
|
@ -2266,7 +2266,7 @@ class LineSegmentROI(ROI):
|
||||||
Since this pulls 1D data from a 2D coordinate system, the return value
|
Since this pulls 1D data from a 2D coordinate system, the return value
|
||||||
will have ndim = data.ndim-1
|
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.
|
arguments.
|
||||||
"""
|
"""
|
||||||
imgPts = [self.mapToItem(img, h.pos()) for h in self.endpoints]
|
imgPts = [self.mapToItem(img, h.pos()) for h in self.endpoints]
|
||||||
|
@ -2384,7 +2384,7 @@ class RulerROI(LineSegmentROI):
|
||||||
|
|
||||||
|
|
||||||
class TriangleROI(ROI):
|
class TriangleROI(ROI):
|
||||||
"""
|
r"""
|
||||||
Equilateral triangle ROI subclass with one scale handle and one rotation handle.
|
Equilateral triangle ROI subclass with one scale handle and one rotation handle.
|
||||||
Arguments
|
Arguments
|
||||||
pos (length-2 sequence) The position of the ROI's origin.
|
pos (length-2 sequence) The position of the ROI's origin.
|
||||||
|
|
|
@ -1243,7 +1243,7 @@ class ViewBox(GraphicsWidget):
|
||||||
mask[1-axis] = 0.0
|
mask[1-axis] = 0.0
|
||||||
|
|
||||||
## Scale or translate based on mouse button
|
## 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 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
|
if ev.isFinish(): ## This is the final move in the drag; change the view scale now
|
||||||
#print "finish"
|
#print "finish"
|
||||||
|
|
|
@ -4290,12 +4290,10 @@ def test_makeARGB_against_generated_references():
|
||||||
_do_something_for_every_combo(assert_correct)
|
_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():
|
def test_cupy_makeARGB_against_generated_references():
|
||||||
setConfigOption("useCupy", True)
|
setConfigOption("useCupy", True)
|
||||||
cp = getCupy()
|
cp = getCupy()
|
||||||
if cp is None:
|
|
||||||
pytest.skip("CuPy unavailable to test")
|
|
||||||
|
|
||||||
def assert_cupy_correct(data, key, levels, lut, scale, use_rgba):
|
def assert_cupy_correct(data, key, levels, lut, scale, use_rgba):
|
||||||
data = cp.asarray(data)
|
data = cp.asarray(data)
|
||||||
if lut is not None:
|
if lut is not None:
|
||||||
|
|
10
pytest.ini
10
pytest.ini
|
@ -7,15 +7,15 @@ xvfb_args=-ac +extension GLX +render
|
||||||
faulthandler_timeout = 30
|
faulthandler_timeout = 30
|
||||||
|
|
||||||
filterwarnings =
|
filterwarnings =
|
||||||
|
# re-enable standard library warnings
|
||||||
|
once::DeprecationWarning
|
||||||
|
once::PendingDeprecationWarning
|
||||||
# comfortable skipping these warnings runtime warnings
|
# comfortable skipping these warnings runtime warnings
|
||||||
# https://stackoverflow.com/questions/40845304/runtimewarning-numpy-dtype-size-changed-may-indicate-binary-incompatibility
|
# https://stackoverflow.com/questions/40845304/runtimewarning-numpy-dtype-size-changed-may-indicate-binary-incompatibility
|
||||||
ignore:numpy.ufunc size changed, may indicate binary incompatibility.*:RuntimeWarning
|
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: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
|
# pyqtgraph specific warning we want to ignore during testing
|
||||||
ignore:Visible window deleted. To prevent this, store a reference to the window object.
|
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
|
ignore:Unknown config option:pytest.PytestConfigWarning
|
||||||
|
|
42
tox.ini
42
tox.ini
|
@ -1,43 +1,37 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist =
|
envlist =
|
||||||
; qt latest
|
; qt 5.15.x
|
||||||
py{37,38}-{pyqt5,pyside2}_latest
|
py{37,38,39}-{pyqt5,pyside2}_515
|
||||||
|
|
||||||
; qt 5.12.x (LTS)
|
; qt 5.12.x
|
||||||
py{36,37}-{pyqt5,pyside2}_512
|
py{37}-{pyqt5,pyside2}_512
|
||||||
|
; py38-pyside2_512 doesn't work due to PYSIDE-1140
|
||||||
|
py38-pyqt5_512
|
||||||
|
|
||||||
; qt 5.9.7 (LTS)
|
; qt 6
|
||||||
py36-{pyqt5,pyside2}_59_conda
|
py{37,38,39}-{pyqt6,pyside6}
|
||||||
|
|
||||||
[base]
|
[base]
|
||||||
deps =
|
deps =
|
||||||
pytest
|
pytest
|
||||||
|
pytest-xdist
|
||||||
numpy
|
numpy
|
||||||
scipy
|
scipy
|
||||||
pyopengl
|
pyopengl
|
||||||
flake8
|
h5py
|
||||||
coverage
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
passenv = DISPLAY XAUTHORITY
|
passenv = DISPLAY XAUTHORITY, PYTHON_VERSION
|
||||||
setenv = PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
|
setenv = PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
|
||||||
deps=
|
deps=
|
||||||
{[base]deps}
|
{[base]deps}
|
||||||
pytest-cov
|
pyside2_512: pyside2==5.12.6
|
||||||
h5py
|
pyqt5_512: pyqt5==5.12.3
|
||||||
pyside2_512: pyside2>=5.12,<5.13
|
pyside2_515: pyside2
|
||||||
pyqt5_512: pyqt5>=5.12,<5.13
|
pyqt5_515: pyqt5
|
||||||
pyside2_latest: pyside2
|
pyqt6: pyqt6
|
||||||
pyqt5_latest: pyqt5
|
pyside6: pyside6
|
||||||
|
|
||||||
conda_deps=
|
|
||||||
pyside2_59_conda: pyside2=5.9
|
|
||||||
pyqt5_59_conda: pyqt=5.9
|
|
||||||
|
|
||||||
conda_channels=
|
|
||||||
conda-forge
|
|
||||||
free
|
|
||||||
|
|
||||||
commands=
|
commands=
|
||||||
python -c "import pyqtgraph as pg; pg.systemInfo()"
|
python -c "import pyqtgraph as pg; pg.systemInfo()"
|
||||||
pytest {posargs:}
|
pytest -n auto {posargs:}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user