Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ htmlcov/

# VSCode
.vscode
/.pytest_cache
/poetry.lock
71 changes: 5 additions & 66 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,14 @@
sudo: false
language: python
python:
- "3.4"
- "3.5"
- "3.6"
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# Cached Downloads
- sudo mkdir -p /downloads
- sudo chmod a+rw /downloads
- if [ ! -f /downloads/sip.tar.gz ]; then curl -L -o /downloads/sip.tar.gz https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.3/sip-4.19.3.tar.gz; fi
- if [ ! -f /downloads/pyqt4.tar.gz ]; then curl -L -o /downloads/pyqt4.tar.gz https://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.1/PyQt4_gpl_x11-4.12.1.tar.gz; fi
- if [ ! -f /downloads/pyqt5.tar.gz ]; then curl -L -o /downloads/pyqt5.tar.gz https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.9/PyQt5_gpl-5.9.tar.gz; fi
- echo '4708187f74a4188cb4e294060707106f /downloads/sip.tar.gz' | md5sum -c -
- echo '0112e15858cd7d318a09e7366922f874 /downloads/pyqt4.tar.gz' | md5sum -c -
- echo 'a409ac0d65ead9178b90c2822759a84b /downloads/pyqt5.tar.gz' | md5sum -c -
# Builds
- sudo mkdir -p /builds
- sudo chmod a+rw /builds
install:
# Qt4
- sudo apt-get update
- sudo apt-get install -y libqt4-dev
# Qt5
- sudo add-apt-repository -y ppa:beineri/opt-qt591-trusty
- sudo apt-get update
- sudo apt-get install -y qt59base
# Builds
- pushd /builds
# SIP
- tar xzf /downloads/sip.tar.gz --keep-newer-files
- pushd sip-4.19.3
- python configure.py
- make
- sudo make install
- popd
# PyQt4
- tar xzf /downloads/pyqt4.tar.gz --keep-newer-files
- pushd PyQt4_gpl_x11-4.12.1
- python configure.py -c --confirm-license --no-designer-plugin -e QtCore -e QtGui
- make
- sudo make install
- popd
# PyQt5
- source /opt/qt59/bin/qt59-env.sh # switch to Qt5
- tar xzf /downloads/pyqt5.tar.gz --keep-newer-files
- pushd PyQt5_gpl-5.9
- python configure.py -c --confirm-license --no-designer-plugin -e QtCore -e QtGui -e QtWidgets
- make
- sudo make install
- popd
# Builds Complete
- popd
# PySide
- if [ $TRAVIS_PYTHON_VERSION != '3.5' && $TRAVIS_PYTHON_VERSION != '3.6' ]; then pip install --find-links wheelhouse/ pyside; 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
- QUAMASH_QTIMPL=PyQt4 py.test
- QUAMASH_QTIMPL=PyQt5 py.test
cache:
directories:
- /downloads
apt: true
- "3.7"
install: pip install tox-travis
script: tox
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/0ed6fa8828890c4a49ea
on_success: change
on_failure: always
on_start: false
on_start: false
42 changes: 1 addition & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1 @@
FROM ubuntu:14.04
RUN apt-get update -y && apt-get install -y curl build-essential software-properties-common python-software-properties

RUN \
sudo mkdir -p /downloads && \
sudo chmod a+rw /downloads && \
if [ ! -f /downloads/sip.tar.gz ]; then curl -L -o /downloads/sip.tar.gz https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.3/sip-4.19.3.tar.gz; fi && \
if [ ! -f /downloads/pyqt4.tar.gz ]; then curl -L -o /downloads/pyqt4.tar.gz https://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.1/PyQt4_gpl_x11-4.12.1.tar.gz; fi && \
if [ ! -f /downloads/pyqt5.tar.gz ]; then curl -L -o /downloads/pyqt5.tar.gz https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.9/PyQt5_gpl-5.9.tar.gz; fi && \
echo '4708187f74a4188cb4e294060707106f /downloads/sip.tar.gz' | md5sum -c - && \
echo '0112e15858cd7d318a09e7366922f874 /downloads/pyqt4.tar.gz' | md5sum -c - && \
echo 'a409ac0d65ead9178b90c2822759a84b /downloads/pyqt5.tar.gz' | md5sum -c - && \
sudo mkdir -p /builds && \
sudo chmod a+rw /builds && \
cd /builds && \
tar xzf /downloads/sip.tar.gz --keep-newer-files && \
tar xzf /downloads/pyqt4.tar.gz --keep-newer-files && \
tar xzf /downloads/pyqt5.tar.gz --keep-newer-files && \
sudo apt-get install -y libqt4-dev && \
sudo add-apt-repository -y ppa:beineri/opt-qt591-trusty && \
sudo add-apt-repository -y ppa:deadsnakes/ppa && \
sudo apt-get update && \
sudo apt-get install -y qt59base python3.4-dev python3.5-dev python3.6-dev
SHELL ["/bin/bash", "-c"]
RUN \
for python in python3.4 python3.5 python3.6; do \
cd /builds/sip-4.19.3 && \
$python configure.py && \
make clean && make && make install && \
cd /builds/PyQt4_gpl_x11-4.12.1 && \
$python configure.py -c --confirm-license --no-designer-plugin -e QtCore -e QtGui && \
make clean && make && make install && \
cd /builds/PyQt5_gpl-5.9 && \
( \
. /opt/qt59/bin/qt59-env.sh && \
$python configure.py -c --confirm-license --no-designer-plugin -e QtCore -e QtGui -e QtWidgets && \
make clean && make && make install; \
) \
done
ADD . /quamash
WORKDIR /quamash
FROM themattrix/tox:latest
83 changes: 30 additions & 53 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Implementation of the `PEP 3156`_ Event-Loop with Qt
:target: https://pypi.python.org/pypi/quamash/
:alt: License

.. image:: https://img.shields.io/pypi/status/Django.svg
.. image:: https://img.shields.io/pypi/status/quamash.svg
:target: https://pypi.python.org/pypi/quamash/
:alt: Development Status

Expand All @@ -39,12 +39,23 @@ 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.6 or later with PyQt5 or PySide2.

Installation
============
Quamash without dependencies:

``pip install quamash``

Quamash with PySide2 dependency for use in a PySide2 project:

``pip install quamash[pyside2]``

Quamash with PyQT5 dependency for use in a PyQT5 project:

``pip install quamash[pyqt5]``


Upgrade from Version 0.4 to 0.5
===============================
The loop context manager will no longer set the event loop only close it.
Expand Down Expand Up @@ -113,15 +124,23 @@ Usage

Changelog
=========
Version 0.7.0
-------------
* Dropped support for Python 3.3, 3.4, and 3.5
* Dropped support for PyQt4 and PySide
* Added support for PySide2
* Tests now uses `tox` and wheels, no weird dependency management.
* Now uses poetry to manage deps (though this transparent to users, who can use whatever)
* setup.py no longer imports the package

Version 0.6.1
-------------
* Python 3.7 support (no automated test coverage)

Version 0.6.0
-------------
* Lots of bugfixes and performance improvements.


Version 0.5.5
-------------
* Fix `#62`_ a serious memory leak by switching from ``QTimer`` to ``QObject.timerEvent``.
Expand Down Expand Up @@ -187,64 +206,22 @@ First version worth using.

Testing
=======
Quamash is tested with pytest_; in order to run the test suite, just install pytest
and execute py.test on the commandline. The tests themselves are beneath the 'tests' directory.
The full suite of tests can be run for the current platform with `tox`

Testing can also be done with tox_. The current tox setup in tox.ini requires PyQT4/5 and PySide to
be installed globally. (pip can't install PyQt into a virtualenv which is what tox will try to do).
For this reason it may be good to run tox tests while specificying which environments to run. e.g.
``tox -e py34-pyqt5`` to test python 3.4 with PyQt5. It is unlikely this tox configuration will
work well on Windows especially since PyQt5 and PyQt4 cannot coexist in the same python installation
on Windows. Also the PyQt4 w/ Qt5 oddity appears to be mostly a windows only thing too.
If you have docker/docker-compose installed, `docker-compose run tox` will run the tests on linux (in docker).

Style testing is also handled by tox. Run ``tox -e flake8``.
Style testing is also handled by tox. Run ``tox -e flake8`` to run the style tests only.

Code Coverage
-------------
Getting a full coverage support is quite time consuming. In theory this could by done with `pytest-xdist`_,
but I haven't had time to make that work. Install ``pytest-cov`` with ``pip install pytest-cov`` then
run ``py.test --cov quamash`` then append a dot and an identifier the generated ``.coverage`` file. For example,
``mv .coverage .coverage.nix.p33.pyside`` then repeat on all the platforms you want to run on. (at least linux
and windows). Put all the ``.coverage.*`` files in one directory that also has quamash source code in it.
``cd`` to that directory and run ``coverage combine`` finally run ``coverage html`` for html based reports
or ``coverage report`` for a simple report. These last commands may fail with errors about not being able to
find source code. Use the ``.coveragerc`` file to specify equivelant paths. The default configuration has linux
source code in ``/quamash`` and windows source at ``C:\quamash``.

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 | planned |
+----------------------+---------+---------+--------------+----------------+
| Linux - Python 3.5 | yes | yes | n/a | planned |
+----------------------+---------+---------+--------------+----------------+
| Windows - Python 3.3 | no | no | yes | no |
+----------------------+---------+---------+--------------+----------------+
| Windows - Python 3.4 | yes | yes | yes | planned |
+----------------------+---------+---------+--------------+----------------+
| Windows - Python 3.5 | planned | planned | planned | planned |
+----------------------+---------+---------+--------------+----------------+
This project uses Travis CI to perform tests on linux and
Appveyor to perform continuous integration.


License
=======
You may use, modify, and redistribute this software under the terms of the `BSD License`_.
You may use, modify, and redistribute this software under the terms of the `BSD 2 Clause License`_.
See LICENSE.

Name
Expand All @@ -254,7 +231,7 @@ starts with a "Q".

.. _`PEP 3156`: http://python.org/dev/peps/pep-3156/
.. _`pytest`: http://pytest.org
.. _`BSD License`: http://opensource.org/licenses/BSD-2-Clause
.. _`BSD 2 Clause License`: http://opensource.org/licenses/BSD-2-Clause
.. _tox: https://tox.readthedocs.org/
.. _pytest-xdist: https://pypi.python.org/pypi/pytest-xdist
.. _#31: https://github.com/harvimt/quamash/issues/31
Expand Down
63 changes: 22 additions & 41 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,34 @@
environment:

matrix:
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: "64"
QTIMPL: "PySide"

- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: "64"
QTIMPL: "PyQt4"

- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: "64"
QTIMPL: "PyQt5"

- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: "64"
QTIMPL: "PyQt4"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"
QTIMPL: "PyQt4"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"
QTIMPL: "PyQt5"
- TOXENV: "py36-pyqt5"
TOX_APPVEYOR_X64: 1

- TOXENV: "py36-pyqt5"
TOX_APPVEYOR_X64: 0

- TOXENV: "py37-pyqt5"
TOX_APPVEYOR_X64: 1

- TOXENV: "py37-pyqt5"
TOX_APPVEYOR_X64: 0

- TOXENV: "flake8"
TOX_APPVEYOR_X64: 1

# turn off msbuild
build: off

- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "32"
QTIMPL: "PyQt5"
init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH% %QTIMPL%"
# For the sections below, the Python version doesn't matter:
# tox will make an environment based on the environment variables.

install:
- "powershell appveyor\\install.ps1"

build: off
- "py -m pip install wheel tox tox-appveyor"

test_script:
- "%PYTHON%\\Scripts\\py.test.exe"
- "py -m tox"

notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/9723bec82b34a9f3faf0
on_build_success: false
on_build_failure: True
on_build_failure: True
47 changes: 0 additions & 47 deletions appveyor/install.ps1

This file was deleted.

Loading