Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 11 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@ addons:
- ccache
- cmake
- swig
- libxkbcommon-x11-0
- libglu1-mesa-dev

- libxcb-icccm4
Comment thread
rahulporuri marked this conversation as resolved.
- libxcb-image0
- libxcb-keysyms1
- libxcb-randr0
- libxcb-render-util0
- libxcb-xinerama0

env:
global:
- INSTALL_EDM_VERSION=2.0.0
PYTHONUNBUFFERED="1"
QT_DEBUG_PLUGINS="1"

matrix:
include:
- env: RUNTIME=2.7 TOOLKITS="null pyqt pyside wx"
- os : osx
env: RUNTIME=2.7 TOOLKITS="null pyqt pyside wx"
- env: RUNTIME=3.5 TOOLKITS="null pyqt"
- os : osx
env: RUNTIME=3.5 TOOLKITS="null pyqt"
- env: RUNTIME=3.6 TOOLKITS="null pyqt"
- env: RUNTIME=3.6 TOOLKITS="null pyqt pyqt5 pyside2"
- os : osx
env: RUNTIME=3.6 TOOLKITS="null pyqt"
env: RUNTIME=3.6 TOOLKITS="null pyqt pyqt5 pyside2"
fast_finish: true

branches:
Expand Down
6 changes: 1 addition & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ environment:
INSTALL_EDM_VERSION: "2.0.0"

matrix:
- RUNTIME: '2.7'
TOOLKITS: "null pyqt pyside wx"
- RUNTIME: '3.5'
TOOLKITS: "null pyqt"
- RUNTIME: '3.6'
TOOLKITS: "null pyqt"
TOOLKITS: "null pyqt pyqt5 pyside2"

branches:
only:
Expand Down
10 changes: 7 additions & 3 deletions chaco/shell/plot_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,15 @@ class PlotWindow(QtGui.QFrame):
def __init__(self, is_image=False, bgcolor="white",
image_default_origin="top left", *args, **kw):

if 'size' in kw and isinstance(kw['size'], tuple):
# Convert to a QSize.
kw['size'] = QtCore.QSize(*kw['size'])
size = kw.pop("size", None)
if isinstance(size, tuple):
size = QtCore.QSize(*size)

super(PlotWindow, self).__init__(None, *args, **kw )

if size is not None:
self.resize(size)

# Some defaults which should be overridden by preferences.
self.bgcolor = bgcolor
self.image_default_origin = image_default_origin
Expand Down
49 changes: 24 additions & 25 deletions ci/edmtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
using::
python edmtool.py test_all

Currently supported runtime values are ``2.7`` and ``3.5``, and currently
supported toolkits are ``null``, ``pyqt``, ``pyside``, and ``wx``. Not all
Currently supported runtime values are ``3.6``, and currently
supported toolkits are ``null``, ``pyqt``, ``pyqt5`` and ``pyside2``. Not all
combinations of toolkits and runtimes will work, but the tasks will fail with
a clear error if that is the case. Tests can still be run via the usual means
in other environments if that suits a developer's purpose.
Expand All @@ -60,9 +60,6 @@
commands for each task. See the EDM documentation for more information about
how to run commands within an EDM enviornment.
"""

from __future__ import print_function

import glob
import os
import subprocess
Expand All @@ -74,9 +71,7 @@
import click

supported_combinations = {
'2.7': {'pyqt', 'pyside', 'wx', 'null'},
'3.5': {'pyqt', 'null'},
'3.6': {'pyqt', 'null'},
'3.6': {'pyside2', 'pyqt', 'pyqt5', 'null'},
}

dependencies = {
Expand All @@ -92,16 +87,16 @@
}

extra_dependencies = {
'pyside': {'pyside'},
'pyside2': set(), # pyside2 is pip-installed during the install step
'pyqt': {'pyqt'},
'wx': {'wxpython'},
'pyqt5': {'pyqt5'},
'null': set()
}

environment_vars = {
'pyside': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyside'},
'pyside2': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyside2'},
'pyqt': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyqt'},
'wx': {'ETS_TOOLKIT': 'wx'},
'pyqt5': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyqt5'},
'null': {'ETS_TOOLKIT': 'null.image'},
}

Expand All @@ -112,7 +107,7 @@ def cli():


@cli.command()
@click.option('--runtime', default='3.5')
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--environment', default=None)
def install(runtime, toolkit, environment):
Expand All @@ -132,25 +127,26 @@ def install(runtime, toolkit, environment):
"pip install git+https://git@github.com/enthought/enable.git"),
"edm run -e {environment} -- pip install . --no-deps",
]
# pip install pyside2, because we don't have it in EDM yet
if toolkit == 'pyside2':
commands.append(
"edm run -e {environment} -- pip install pyside2==5.11"
)

click.echo("Creating environment '{environment}'".format(**parameters))
execute(commands, parameters)
click.echo('Done install')


@cli.command()
@click.option('--runtime', default='3.5')
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--environment', default=None)
def test(runtime, toolkit, environment):
""" Run the test suite in a given environment with the specified toolkit.
"""
parameters = get_parameters(runtime, toolkit, environment)
environ = environment_vars.get(toolkit, {}).copy()
# FIXME : See discussion on https://github.com/enthought/chaco/pull/442
# Note that we are overriding the existing definition of `ETS_TOOLKIT`
# in the `environment_vars` dictionary.
if sys.platform == 'darwin' and runtime == '2.7' and toolkit == 'wx':
environ['ETS_TOOLKIT'] = 'wx.image'

environ['PYTHONUNBUFFERED'] = "1"
commands = [
Expand All @@ -172,7 +168,7 @@ def test(runtime, toolkit, environment):


@cli.command()
@click.option('--runtime', default='3.5')
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--environment', default=None)
def cleanup(runtime, toolkit, environment):
Expand All @@ -189,7 +185,7 @@ def cleanup(runtime, toolkit, environment):


@cli.command()
@click.option('--runtime', default='3.5')
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
def test_clean(runtime, toolkit):
""" Run tests in a clean environment, cleaning up afterwards
Expand All @@ -204,7 +200,7 @@ def test_clean(runtime, toolkit):


@cli.command()
@click.option('--runtime', default='3.5')
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--environment', default=None)
def update(runtime, toolkit, environment):
Expand Down Expand Up @@ -239,9 +235,12 @@ def get_parameters(runtime, toolkit, environment):
parameters = {'runtime': runtime, 'toolkit': toolkit,
'environment': environment}
if toolkit not in supported_combinations[runtime]:
msg = ("Python {runtime}, toolkit {toolkit}, "
"not supported by test environments")
raise RuntimeError(msg.format(**parameters))
msg = ("Python {runtime!r}, toolkit {toolkit!r}, "
"not supported by test environments ({available})")
available = ", ".join(
repr(tk) for tk in sorted(supported_combinations[runtime])
)
raise RuntimeError(msg.format(available=available, **parameters))
if environment is None:
tmpl = 'chaco-test-{runtime}-{toolkit}'
environment = tmpl.format(**parameters)
Expand Down