diff --git a/.travis.yml b/.travis.yml index 6fb1979..c749be0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,12 +54,15 @@ install: - popd # PySide - if [ $TRAVIS_PYTHON_VERSION != '3.5' && $TRAVIS_PYTHON_VERSION != '3.6' ]; then pip install --find-links wheelhouse/ pyside; fi + # PySide2 + - if [ $TRAVIS_PYTHON_VERSION != '3.4' ]; then pip install pyside2; fi # flake8 style checker - pip install flake8 pep8-naming flake8-debugger flake8-docstrings pytest-timeout flake8-commas script: - flake8 - flake8 --select=D1 quamash/*.py - - if [ $TRAVIS_PYTHON_VERSION != '3.5' && $TRAVIS_PYTHON_VERSION != '3.6']; then QUAMASH_QTIMPL=PySide py.test; fi + - if [ $TRAVIS_PYTHON_VERSION != '3.5' && $TRAVIS_PYTHON_VERSION != '3.6' ]; then QUAMASH_QTIMPL=PySide py.test; fi + - if [ $TRAVIS_PYTHON_VERSION != '3.4' ]; then QUAMASH_QTIMPL=PySide2 py.test; fi - QUAMASH_QTIMPL=PyQt4 py.test - QUAMASH_QTIMPL=PyQt5 py.test cache: diff --git a/README.rst b/README.rst index 21e8be1..0620552 100644 --- a/README.rst +++ b/README.rst @@ -39,7 +39,7 @@ Implementation of the `PEP 3156`_ Event-Loop with Qt Requirements ============ -Quamash requires Python 3.4 or Python 3.3 with the backported ``asyncio`` library and either PyQt4, PyQt5 or PySide. +Quamash requires Python >=3.4 with the backported ``asyncio`` library and either PyQt4, PyQt5, PySide or PySide2. Installation ============ @@ -115,6 +115,7 @@ Changelog ========= Version 0.6.1 +------------- * Python 3.7 support (no automated test coverage) Version 0.6.0 @@ -216,30 +217,23 @@ Continuous Integration & Supported Platforms This project uses Travis CI to perform tests on linux (Ubuntu 12.04 LTS "Precise Pangolin") and Appveyor (Windows Server 2012 R2, similar to Windows 8) to perform continuous integration. -On linux, Python 3.3 and 3.4 with PySide, PyQt4, and PyQt5 are tested. On windows, Python 3.4 with -PySide, PyQt4 and PyQt5 are tested, but Python 3.3 is only tested with PySide since binary installers -for PyQt are not provided for Python 3.3 (at least not the newest versions of PyQt), and compiling -from source probably isn't worth it. - -Python 3.5 is now tested on linux with PyQt4 and PyQt5. - Testing Matrix ~~~~~~~~~~~~~~ +----------------------+---------+---------+--------------+----------------+ | | PyQt4 | PyQt5 | PySide (Qt4) | PySide 2 (Qt5) | +======================+=========+=========+==============+================+ -| Linux - Python 3.3 | yes | yes | yes | planned | +| Linux - Python 3.4 | yes | yes | yes | n/a | +----------------------+---------+---------+--------------+----------------+ -| Linux - Python 3.4 | yes | yes | yes | planned | +| Linux - Python 3.5 | yes | yes | n/a | yes | +----------------------+---------+---------+--------------+----------------+ -| Linux - Python 3.5 | yes | yes | n/a | planned | +| Linux - Python 3.6 | yes | yes | n/a | yes | +----------------------+---------+---------+--------------+----------------+ -| Windows - Python 3.3 | no | no | yes | no | +| Windows - Python 3.4 | yes | yes | yes | n/a | +----------------------+---------+---------+--------------+----------------+ -| Windows - Python 3.4 | yes | yes | yes | planned | +| Windows - Python 3.5 | n/a | yes | n/a | yes | +----------------------+---------+---------+--------------+----------------+ -| Windows - Python 3.5 | planned | planned | planned | planned | +| Windows - Python 3.6 | n/a | yes | n/a | yes | +----------------------+---------+---------+--------------+----------------+ License diff --git a/appveyor.yml b/appveyor.yml index 0093bac..7e7985c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,23 +19,34 @@ environment: - PYTHON: "C:\\Python35-x64" PYTHON_VERSION: "3.5.x" PYTHON_ARCH: "64" - QTIMPL: "PyQt4" + QTIMPL: "PyQt5" + + - PYTHON: "C:\\Python35-x64" + PYTHON_VERSION: "3.5.x" + PYTHON_ARCH: "64" + QTIMPL: "PySide2" - PYTHON: "C:\\Python36-x64" PYTHON_VERSION: "3.6.x" PYTHON_ARCH: "64" - QTIMPL: "PyQt4" + QTIMPL: "PyQt5" + + - PYTHON: "C:\\Python36" + PYTHON_VERSION: "3.6.x" + PYTHON_ARCH: "32" + QTIMPL: "PyQt5" - PYTHON: "C:\\Python36-x64" PYTHON_VERSION: "3.6.x" PYTHON_ARCH: "64" - QTIMPL: "PyQt5" + QTIMPL: "PySide2" - PYTHON: "C:\\Python36" PYTHON_VERSION: "3.6.x" PYTHON_ARCH: "32" - QTIMPL: "PyQt5" + QTIMPL: "PySide2" init: + - "ECHO %PATH%" - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH% %QTIMPL%" install: diff --git a/appveyor/install.ps1 b/appveyor/install.ps1 index 282be19..1129170 100644 --- a/appveyor/install.ps1 +++ b/appveyor/install.ps1 @@ -22,7 +22,7 @@ function InstallPip ($python_home) { function InstallPackage ($python_home, $pkg) { $pip_path = $python_home + "\Scripts\pip.exe" - & $pip_path install --only-binary=PySide --only-binary=PyQt4 --only-binary=PyQt5 --find-links .\wheelhouse $pkg + & $pip_path install --only-binary=PySide --only-binary=PySide2 --only-binary=PyQt4 --only-binary=PyQt5 --find-links .\wheelhouse $pkg } function main () { @@ -35,6 +35,9 @@ function main () { "PySide" { InstallPackage $env:Python PySide } + "PySide2" { + InstallPackage $env:Python PySide2 + } "PyQt4" { InstallPackage $env:Python PyQt4 } diff --git a/conftest.py b/conftest.py index c1078d3..7ece003 100644 --- a/conftest.py +++ b/conftest.py @@ -38,5 +38,5 @@ @fixture(scope='session') def application(): - from quamash import QApplication - return QApplication([]) + from quamash import QCoreApplication + return QCoreApplication([]) diff --git a/quamash/__init__.py b/quamash/__init__.py index 1c16118..b477279 100644 --- a/quamash/__init__.py +++ b/quamash/__init__.py @@ -29,7 +29,7 @@ QtModule = importlib.import_module(QtModuleName) if not QtModule: - for QtModuleName in ('PyQt5', 'PyQt4', 'PySide'): + for QtModuleName in ('PyQt5', 'PySide2', 'PyQt4', 'PySide'): try: QtModule = importlib.import_module(QtModuleName) except ImportError: @@ -42,13 +42,7 @@ logger.info('Using Qt Implementation: {}'.format(QtModuleName)) QtCore = importlib.import_module(QtModuleName + '.QtCore', package=QtModuleName) -QtGui = importlib.import_module(QtModuleName + '.QtGui', package=QtModuleName) -if QtModuleName == 'PyQt5': - from PyQt5 import QtWidgets - QApplication = QtWidgets.QApplication -else: - QApplication = QtGui.QApplication - +QCoreApplication = QtCore.QCoreApplication from ._common import with_logger @@ -238,8 +232,8 @@ class _QEventLoop: """ def __init__(self, app=None): - self.__app = app or QApplication.instance() - assert self.__app is not None, 'No QApplication has been instantiated' + self.__app = app or QCoreApplication.instance() + assert self.__app is not None, 'No QCoreApplication has been instantiated' self.__is_running = False self.__debug_enabled = False self.__default_executor = None