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
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ env:

matrix:
include:
- env: RUNTIME=3.6 TOOLKITS="null pyqt pyqt5 pyside2" PILLOW='pillow'
- env: RUNTIME=3.6 TOOLKITS="wx" PILLOW='pillow'
- env: RUNTIME=3.6 TOOLKITS=null PILLOW='pillow<3.0.0'
- env: RUNTIME=3.6 TOOLKITS="null pyqt pyqt5 pyside2"
- env: RUNTIME=3.6 TOOLKITS="wx"
fast_finish: true

branches:
Expand All @@ -60,13 +59,13 @@ before_install:
install:
- for toolkit in ${TOOLKITS}; do
if [[ ${TRAVIS_EVENT_TYPE} == "cron" ]] ; then
edm run -- python ci/edmtool.py install --runtime=${RUNTIME} --toolkit=${toolkit} --pillow=${PILLOW} --source || exit;
edm run -- python ci/edmtool.py install --runtime=${RUNTIME} --toolkit=${toolkit} --source || exit;
else
edm run -- python ci/edmtool.py install --runtime=${RUNTIME} --toolkit=${toolkit} --pillow=${PILLOW} || exit;
edm run -- python ci/edmtool.py install --runtime=${RUNTIME} --toolkit=${toolkit} || exit;
fi;
done
script:
- for toolkit in ${TOOLKITS}; do edm run -- python ci/edmtool.py test --runtime=${RUNTIME} --toolkit=${toolkit} --pillow=${PILLOW} || exit; done
- for toolkit in ${TOOLKITS}; do edm run -- python ci/edmtool.py test --runtime=${RUNTIME} --toolkit=${toolkit} || exit; done

after_success:
- edm run -- coverage combine
Expand Down
2 changes: 1 addition & 1 deletion appveyor-run.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FOR %%x IN (%*) DO (
SET /A counter=!counter! + 1
IF !counter! EQU 1 SET operation=%%x
IF !counter! EQU 2 SET runtime=%%x
IF !counter! GTR 2 CALL edm run -- python ci/edmtool.py !operation! --runtime=!runtime! --toolkit=%%x --pillow=pillow || GOTO error
IF !counter! GTR 2 CALL edm run -- python ci/edmtool.py !operation! --runtime=!runtime! --toolkit=%%x || GOTO error
)
GOTO end

Expand Down
55 changes: 25 additions & 30 deletions ci/edmtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@
dependencies = {
"apptools",
"coverage",
"fonttools",
"hypothesis",
"kiwisolver",
"numpy",
"pygments",
"pyparsing",
"pillow",
"reportlab",
"swig",
"traits",
"traitsui",
Expand Down Expand Up @@ -132,8 +137,6 @@
'null': {'ETS_TOOLKIT': 'null.image'},
}

pillow_trans = ''.maketrans({'<': '_', '=': '_', '>': '_'})

if sys.platform == 'darwin':
dependencies.add('Cython')

Expand Down Expand Up @@ -162,18 +165,17 @@ def cli():
@cli.command()
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--pillow', default='pillow')
@click.option('--environment', default=None)
@click.option(
"--source/--no-source",
default=False,
help="Install ETS packages from source",
)
def install(runtime, toolkit, pillow, environment, source):
def install(runtime, toolkit, environment, source):
""" Install project and dependencies into a clean EDM environment.

"""
parameters = get_parameters(runtime, toolkit, pillow, environment)
parameters = get_parameters(runtime, toolkit, environment)
parameters['packages'] = ' '.join(
dependencies | extra_dependencies.get(toolkit, set()))
# edm commands to setup the development environment
Expand All @@ -182,7 +184,6 @@ def install(runtime, toolkit, pillow, environment, source):
"--force --version={runtime}"),
("edm --config {edm_config} install -y -e {environment} {packages} "
"--add-repository enthought/lgpl"),
"edm run -e {environment} -- pip install {pillow}",
("edm run -e {environment} -- pip install -r ci/requirements.txt"
" --no-dependencies"),
]
Expand Down Expand Up @@ -241,11 +242,10 @@ def install(runtime, toolkit, pillow, environment, source):
@cli.command()
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--pillow', default='pillow')
@click.option('--environment', default=None)
def docs(runtime, toolkit, pillow, environment):
def docs(runtime, toolkit, environment):
""" Build documentation. """
parameters = get_parameters(runtime, toolkit, pillow, environment)
parameters = get_parameters(runtime, toolkit, environment)
packages = " ".join([
"sphinx",
"enthought_sphinx_theme",
Expand Down Expand Up @@ -311,14 +311,13 @@ def docs(runtime, toolkit, pillow, environment):
@cli.command()
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--pillow', default='pillow')
@click.option('--environment', default=None)
def shell(runtime, toolkit, pillow, environment):
def shell(runtime, toolkit, environment):
""" Create a shell into the EDM development environment
(aka 'activate' it).

"""
parameters = get_parameters(runtime, toolkit, pillow, environment)
parameters = get_parameters(runtime, toolkit, environment)
commands = [
"edm shell -e {environment}",
]
Expand All @@ -328,13 +327,12 @@ def shell(runtime, toolkit, pillow, environment):
@cli.command()
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--pillow', default='pillow')
@click.option('--environment', default=None)
def test(runtime, toolkit, pillow, environment):
def test(runtime, toolkit, environment):
""" Run the test suite in a given environment with the specified toolkit.

"""
parameters = get_parameters(runtime, toolkit, pillow, environment)
parameters = get_parameters(runtime, toolkit, environment)
environ = environment_vars.get(toolkit, {}).copy()
environ['PYTHONUNBUFFERED'] = "1"
commands = [
Expand All @@ -358,13 +356,12 @@ def test(runtime, toolkit, pillow, environment):
@cli.command()
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--pillow', default='pillow')
@click.option('--environment', default=None)
def cleanup(runtime, toolkit, pillow, environment):
def cleanup(runtime, toolkit, environment):
""" Remove a development environment.

"""
parameters = get_parameters(runtime, toolkit, pillow, environment)
parameters = get_parameters(runtime, toolkit, environment)
commands = [
"edm run -e {environment} -- python setup.py clean",
"edm environments remove {environment} --purge -y",
Expand All @@ -377,14 +374,14 @@ def cleanup(runtime, toolkit, pillow, environment):
@cli.command()
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--pillow', default='pillow')
def test_clean(runtime, toolkit, pillow):
def test_clean(runtime, toolkit):
""" Run tests in a clean environment, cleaning up afterwards

"""
args = ['--toolkit={}'.format(toolkit),
'--runtime={}'.format(runtime),
'--pillow={}'.format(pillow)]
args = [
'--toolkit={}'.format(toolkit),
'--runtime={}'.format(runtime),
]
try:
install(args=args, standalone_mode=False)
test(args=args, standalone_mode=False)
Expand All @@ -395,13 +392,12 @@ def test_clean(runtime, toolkit, pillow):
@cli.command()
@click.option('--runtime', default='3.6')
@click.option('--toolkit', default='null')
@click.option('--pillow', default='pillow')
@click.option('--environment', default=None)
def update(runtime, toolkit, pillow, environment):
def update(runtime, toolkit, environment):
""" Update/Reinstall package into environment.

"""
parameters = get_parameters(runtime, toolkit, pillow, environment)
parameters = get_parameters(runtime, toolkit, environment)
commands = [
"edm run -e {environment} -- python setup.py install"]
click.echo("Re-installing in '{environment}'".format(**parameters))
Expand All @@ -425,19 +421,18 @@ def test_all():
# Utility routines
# ----------------------------------------------------------------------------

def get_parameters(runtime, toolkit, pillow, environment):
def get_parameters(runtime, toolkit, environment):
"""Set up parameters dictionary for format() substitution
"""
parameters = {'runtime': runtime, 'toolkit': toolkit, 'pillow': pillow,
parameters = {'runtime': runtime, 'toolkit': toolkit,
'environment': environment}
if toolkit not in supported_combinations[runtime]:
msg = ("Python {runtime}, toolkit {toolkit}, and pillow {pillow} "
msg = ("Python {runtime} and toolkit {toolkit} "
"not supported by test environments")
raise RuntimeError(msg.format(**parameters))
if environment is None:
tmpl = 'enable-test-{runtime}-{toolkit}'
environment = tmpl.format(**parameters)
environment += '-{}'.format(str(pillow).translate(pillow_trans))
parameters['environment'] = environment

parameters["edm_config"] = EDM_CONFIG
Expand Down
6 changes: 1 addition & 5 deletions ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
pygarrayimage
hypothesis<3.0.0
fonttools==3.28.0
reportlab<=3.1
kiwisolver ; python_version <= "2.7"
https://bitbucket.org/pyglet/pyglet/get/pyglet-1.1.4.zip ; python_version <= "2.7"
pyglet
32 changes: 0 additions & 32 deletions kiva/quartz/ABCGI.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ cdef class CGImage
cdef class CGPDFDocument
cdef class Rect
cdef class CGLayerContext(CGContextInABox)
cdef class CGGLContext(CGContextInABox)
cdef class CGBitmapContext(CGContext)
cdef class CGPDFContext(CGContext)
cdef class CGImageMask(CGImage)
Expand Down Expand Up @@ -1343,37 +1342,6 @@ cdef class CGContextFromSWIG(CGContext):
CGContext.__init__(self, ptr)


cdef class CGGLContext(CGContextInABox):
cdef readonly size_t glcontext

def __init__(self, size_t glcontext, int width, int height):
if glcontext == 0:
raise ValueError("Need a valid pointer")

self.glcontext = glcontext

self.context = CGGLContextCreate(<void*>glcontext,
CGSizeMake(width, height), NULL)
if self.context == NULL:
raise RuntimeError("could not create CGGLContext")
self.can_release = 1

self._width = width
self._height = height
self.size = (self._width, self._height)

self._setup_color_space()
self._setup_fonts()


def resize(self, int width, int height):
CGGLContextUpdateViewportSize(self.context, CGSizeMake(width, height))
self._width = width
self._height = height
self.size = (width, height)



cdef class CGPDFContext(CGContext):
cdef readonly char* filename
cdef CGRect media_box
Expand Down
7 changes: 1 addition & 6 deletions kiva/quartz/CoreGraphics.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

cdef extern from "ApplicationServices/ApplicationServices.h":
ctypedef void* CGContextRef

ctypedef double CGFloat

ctypedef struct CGPoint:
Expand Down Expand Up @@ -458,11 +458,6 @@ cdef extern from "ApplicationServices/ApplicationServices.h":

void CGPathApply(CGPathRef path, void *info, CGPathApplierFunction function)

CGContextRef CGGLContextCreate(void *glContext, CGSize size,
CGColorSpaceRef colorspace)
void CGGLContextUpdateViewportSize(CGContextRef context, CGSize size)


ctypedef void* CGFunctionRef

ctypedef void (*CGFunctionEvaluateCallback)(void *info, CGFloat *in_data, CGFloat *out)
Expand Down