From a9b79f246115156c83c22afafc578d8f60ea90bf Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Thu, 24 Dec 2020 11:10:18 +0000 Subject: [PATCH 1/3] Install from EDM where possible. --- ci/edmtool.py | 4 ++++ ci/requirements.txt | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 9ef49bcba..8215c0463 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -93,9 +93,13 @@ dependencies = { "apptools", "coverage", + "fonttools", + "hypothesis", + "kiwisolver", "numpy", "pygments", "pyparsing", + "reportlab", "swig", "traits", "traitsui", diff --git a/ci/requirements.txt b/ci/requirements.txt index 320ea930f..a13329680 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -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 From 824672a2dcb74de3e91a3dfc8af36d4449c1eafe Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Thu, 24 Dec 2020 11:17:06 +0000 Subject: [PATCH 2/3] Remove old versions of Pillow from CI testing. --- .travis.yml | 11 +++++------ appveyor-run.cmd | 2 +- ci/edmtool.py | 51 ++++++++++++++++++++---------------------------- 3 files changed, 27 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index b689cffb5..1adc0a92f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -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 diff --git a/appveyor-run.cmd b/appveyor-run.cmd index ee30f6574..80229b38d 100644 --- a/appveyor-run.cmd +++ b/appveyor-run.cmd @@ -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 diff --git a/ci/edmtool.py b/ci/edmtool.py index 8215c0463..a057e3889 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -99,6 +99,7 @@ "numpy", "pygments", "pyparsing", + "pillow", "reportlab", "swig", "traits", @@ -136,8 +137,6 @@ 'null': {'ETS_TOOLKIT': 'null.image'}, } -pillow_trans = ''.maketrans({'<': '_', '=': '_', '>': '_'}) - if sys.platform == 'darwin': dependencies.add('Cython') @@ -166,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 @@ -186,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"), ] @@ -245,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", @@ -315,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}", ] @@ -332,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 = [ @@ -362,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", @@ -381,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) @@ -399,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)) @@ -429,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 From cdb0705127bf928a0c474c008fe68a271ba400dc Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Thu, 24 Dec 2020 13:08:02 +0000 Subject: [PATCH 3/3] Remove CGGLContext form Kiva Quartz wrapper. --- kiva/quartz/ABCGI.pyx | 32 -------------------------------- kiva/quartz/CoreGraphics.pxi | 7 +------ 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/kiva/quartz/ABCGI.pyx b/kiva/quartz/ABCGI.pyx index d1213d1e2..9da90732e 100644 --- a/kiva/quartz/ABCGI.pyx +++ b/kiva/quartz/ABCGI.pyx @@ -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) @@ -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(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 diff --git a/kiva/quartz/CoreGraphics.pxi b/kiva/quartz/CoreGraphics.pxi index 10d5f54e4..7d59db74e 100644 --- a/kiva/quartz/CoreGraphics.pxi +++ b/kiva/quartz/CoreGraphics.pxi @@ -5,7 +5,7 @@ cdef extern from "ApplicationServices/ApplicationServices.h": ctypedef void* CGContextRef - + ctypedef double CGFloat ctypedef struct CGPoint: @@ -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)