From 3b1e55af1e68cffe4d79b1c2ff477cf18b833fff Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Tue, 22 Dec 2020 12:25:06 -0600 Subject: [PATCH] MAINT: Post 0.11.1 release, drop py2, qt4 (#1473) * MAINT: Post 0.11.1 release, drop py2, qt4 This focuses on distribution, tests, and docs. This may not be comprehensive, but covers the cases I found by looking and a few greps Noteably, this does not change any actual internal code yet, to avoid merge conflicts with pending PRs. * NEP 29 language/versions --- README.md | 38 ++++++++++++++++++++++-------------- azure-test-template.yml | 8 -------- doc/source/how_to_use.rst | 12 ++++++------ doc/source/installation.rst | 4 ++-- doc/source/qtcrashcourse.rst | 3 +-- pyqtgraph/__init__.py | 2 +- setup.py | 7 +++---- tox.ini | 5 ----- 8 files changed, 36 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index a1043fbb..c86f5445 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ PyQtGraph ========= -A pure-Python graphics library for PyQt/PySide/PyQt5/PySide2 +A pure-Python graphics library for PyQt5/PySide2 Copyright 2020 Luke Campagnola, University of North Carolina at Chapel Hill @@ -19,10 +19,23 @@ heavy leverage of numpy for number crunching, Qt's GraphicsView framework for Requirements ------------ -* Python 2.7, or 3.x +pyqtgraph has adopted [NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html). + +This project supports: + +* All minor versions of Python released 42 months prior to the project, and at minimum the two latest minor versions. + +* All minor versions of numpy released in the 24 months prior to the project, and at minimum the last three minor versions. +* All minor versions of Qt 5 currently supported by upstream Qt (Note, Qt 6 support is not yet implemented) + + +Currently this means: + +* Python 3.7+ +* Qt 5.12, 5.15 * Required - * PyQt 4.8+, PySide, PyQt5, or PySide2 - * `numpy` + * PyQt5, or PySide2 + * `numpy` 1.17+ * Optional * `scipy` for image processing * `pyopengl` for 3D graphics @@ -33,17 +46,12 @@ Qt Bindings Test Matrix The following table represents the python environments we test in our CI system. Our CI system uses Ubuntu 18.04, Windows Server 2019, and macOS 10.15 base images. -| Qt-Bindings | Python 2.7 | Python 3.6 | Python 3.7 | Python 3.8 | -| :------------- | :----------------: | :----------------: | :----------------: | :----------------: | -| PyQt-4 | :white_check_mark: | :x: | :x: | :x: | -| PySide1 | :white_check_mark: | :x: | :x: | :x: | -| PyQt5-5.9 | :x: | :white_check_mark: | :x: | :x: | -| PySide2-5.13 | :x: | :x: | :white_check_mark: | :x: | -| PyQt5-Latest | :x: | :x: | :x: | :white_check_mark: | -| PySide2-Latest | :x: | :x: | :x: | :white_check_mark: | - -* pyqtgraph has had some incompatibilities with PySide2 versions 5.6-5.11, and we recommend you avoid those versions if possible -* on macOS with Python 2.7 and Qt4 bindings (PyQt4 or PySide) the openGL related visualizations do not work reliably +| Qt-Bindings | Python 3.6 | Python 3.7 | Python 3.8 | +| :------------- | :----------------: | :----------------: | :----------------: | +| PyQt5-5.9 | :white_check_mark: | :x: | :x: | +| PySide2-5.13 | :x: | :white_check_mark: | :x: | +| PyQt5-Latest | :x: | :x: | :white_check_mark: | +| PySide2-Latest | :x: | :x: | :white_check_mark: | Support ------- diff --git a/azure-test-template.yml b/azure-test-template.yml index ad7b5d62..7ab0dce2 100644 --- a/azure-test-template.yml +++ b/azure-test-template.yml @@ -10,14 +10,6 @@ jobs: vmImage: ${{ parameters.vmImage }} strategy: matrix: - Python27-PyQt4-4.8: - python.version: '2.7' - qt.bindings: "pyqt=4" - install.method: "conda" - Python27-PySide-4.8: - python.version: '2.7' - qt.bindings: "pyside" - install.method: "conda" Python36-PyQt5-5.9: python.version: "3.6" qt.bindings: "pyqt" diff --git a/doc/source/how_to_use.rst b/doc/source/how_to_use.rst index e4424374..7c775d47 100644 --- a/doc/source/how_to_use.rst +++ b/doc/source/how_to_use.rst @@ -51,7 +51,7 @@ For the serious application developer, all of the functionality in pyqtgraph is #. Under "Header file", enter "pyqtgraph". #. Click "Add", then click "Promote". -See the designer documentation for more information on promoting widgets. The "VideoSpeedTest" and "ScatterPlotSpeedTest" examples both demonstrate the use of .ui files that are compiled to .py modules using pyuic4 or pyside-uic. The "designerExample" example demonstrates dynamically generating python classes from .ui files (no pyuic4 / pyside-uic needed). +See the designer documentation for more information on promoting widgets. The "VideoSpeedTest" and "ScatterPlotSpeedTest" examples both demonstrate the use of .ui files that are compiled to .py modules using pyuic5 or pyside-uic. The "designerExample" example demonstrates dynamically generating python classes from .ui files (no pyuic5 / pyside-uic needed). PyQt and PySide @@ -61,15 +61,15 @@ PyQtGraph supports two popular python wrappers for the Qt library: PyQt and PySi APIs and functionality, but for various reasons (discussed elsewhere) you may prefer to use one package or the other. When pyqtgraph is first imported, it automatically determines which library to use by making the fillowing checks: -#. If PyQt4 is already imported, use that -#. Else, if PySide is already imported, use that -#. Else, attempt to import PyQt4 -#. If that import fails, attempt to import PySide. +#. If PyQt5 is already imported, use that +#. Else, if PySide2 is already imported, use that +#. Else, attempt to import PyQt5 +#. If that import fails, attempt to import PySide2. If you have both libraries installed on your system and you wish to force pyqtgraph to use one or the other, simply make sure it is imported before pyqtgraph:: - import PySide ## this will force pyqtgraph to use PySide instead of PyQt4 + import PySide2 ## this will force pyqtgraph to use PySide2 instead of PyQt5 import pyqtgraph as pg diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 9cf276d7..8f094bac 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -3,8 +3,8 @@ Installation PyQtGraph depends on: -* Python 2.7 or Python 3.x -* A Qt library such as PyQt4, PyQt5, PySide, or PySide2 +* Python 3.7+ +* A Qt library such as PyQt5, or PySide2 * numpy The easiest way to meet these dependencies is with ``pip`` or with a scientific diff --git a/doc/source/qtcrashcourse.rst b/doc/source/qtcrashcourse.rst index 083a78ee..bc993974 100644 --- a/doc/source/qtcrashcourse.rst +++ b/doc/source/qtcrashcourse.rst @@ -17,7 +17,7 @@ PyQtGraph fits into this scheme by providing its own QWidget subclasses to be in Example:: - from PyQt4 import QtGui # (the example applies equally well to PySide) + from PyQt5 import QtGui # (the example applies equally well to PySide2) import pyqtgraph as pg ## Always start by initializing Qt (only once per application) @@ -99,4 +99,3 @@ QTimer, Multi-Threading Multi-threading vs Multi-processing in Qt ----------------------------------------- - diff --git a/pyqtgraph/__init__.py b/pyqtgraph/__init__.py index 55351ed4..f3833616 100644 --- a/pyqtgraph/__init__.py +++ b/pyqtgraph/__init__.py @@ -4,7 +4,7 @@ PyQtGraph - Scientific Graphics and GUI Library for Python www.pyqtgraph.org """ -__version__ = '0.11.1' +__version__ = '0.11.1.dev0' ### import all the goodies and add some helper functions for easy CLI use diff --git a/setup.py b/setup.py index aa1bb787..eaaf4272 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- DESCRIPTION = """\ -PyQtGraph is a pure-python graphics and GUI library built on PyQt4/PyQt5/PySide/PySide2 and +PyQtGraph is a pure-python graphics and GUI library built on PyQt5/PySide2 and numpy. It is intended for use in mathematics / scientific / engineering applications. @@ -19,8 +19,6 @@ setupOpts = dict( author_email='luke.campagnola@gmail.com', classifiers = [ "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Development Status :: 4 - Beta", "Environment :: Other Environment", @@ -138,10 +136,11 @@ setup( 'mergetest': helpers.MergeTestCommand, 'style': helpers.StyleCommand}, packages=allPackages, + python_requires=">=3.7", package_dir={'pyqtgraph.examples': 'examples'}, ## install examples along with the rest of the source package_data={'pyqtgraph.examples': ['optics/*.gz', 'relativity/presets/*.cfg']}, install_requires = [ - 'numpy>=1.8.0', + 'numpy>=1.17.0', ], **setupOpts ) diff --git a/tox.ini b/tox.ini index 130085ba..bc2c5403 100644 --- a/tox.ini +++ b/tox.ini @@ -9,9 +9,6 @@ envlist = ; qt 5.9.7 (LTS) py36-{pyqt5,pyside2}_59_conda - ; qt 4.8.7 - py27-{pyqt4,pyside}_conda - [base] deps = pytest @@ -37,8 +34,6 @@ deps= conda_deps= pyside2_59_conda: pyside2=5.9 pyqt5_59_conda: pyqt=5.9 - pyqt4_conda: pyqt=4 - pyside_conda: pyside conda_channels= conda-forge