From bb041da22199b5e35ec0f0807668ffe151bdcdcf Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 10:56:00 +0000 Subject: [PATCH 01/59] Enable building with Cython > 3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6f13c370a..8ab5b300d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["cython<3", "oldest-supported-numpy", "setuptools", "swig", "wheel"] +requires = ["cython", "oldest-supported-numpy", "setuptools", "swig", "wheel"] build-backend = "setuptools.build_meta" [tool.cibuildwheel] From ac33f620f1bcc79c51a71c751fe2367f68d57006 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:02:23 +0000 Subject: [PATCH 02/59] Convert to relative import --- kiva/_marker_renderer.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiva/_marker_renderer.pyx b/kiva/_marker_renderer.pyx index 62a3f35b1..58ca30b30 100644 --- a/kiva/_marker_renderer.pyx +++ b/kiva/_marker_renderer.pyx @@ -11,7 +11,7 @@ import cython import numpy as np from numpy cimport uint8_t -cimport _marker_renderer +from . cimport _marker_renderer ctypedef _marker_renderer.marker_renderer_base renderer_base_t From c29bf9934f67651fc11942858b1baee7b46a594e Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:11:29 +0000 Subject: [PATCH 03/59] Fix support for recent swig --- kiva/agg/src/osx/plat_support.i | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kiva/agg/src/osx/plat_support.i b/kiva/agg/src/osx/plat_support.i index cd62243d6..378eca539 100644 --- a/kiva/agg/src/osx/plat_support.i +++ b/kiva/agg/src/osx/plat_support.i @@ -63,7 +63,8 @@ namespace agg24 end_of_pix_formats }; - %name(PixelMap) class pixel_map + %rename(PixelMap) pixel_map; + class pixel_map { public: ~pixel_map(); From d1f9109183a5bdc82e83f83fe6308802a6be1638 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:24:40 +0000 Subject: [PATCH 04/59] Update code to work with Cython 3 --- kiva/quartz/ABCGI.pyx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kiva/quartz/ABCGI.pyx b/kiva/quartz/ABCGI.pyx index 25ac9c1d4..bfe0de903 100644 --- a/kiva/quartz/ABCGI.pyx +++ b/kiva/quartz/ABCGI.pyx @@ -19,7 +19,7 @@ cimport numpy import os import warnings -from CTFont import default_font_info +from .CTFont import default_font_info cdef extern from "math.h": double sqrt(double arg) @@ -1479,7 +1479,7 @@ cdef class CGBitmapContext(CGContext): raise ValueError("bits_per_component must be 5 or 8") cdef int min_bytes - min_bytes = (width*bits_per_pixel + 7) / 8 + min_bytes = (width*bits_per_pixel + 7) // 8 if bytes_per_row < min_bytes: bytes_per_row = min_bytes @@ -1763,7 +1763,7 @@ cdef class CGImage: raise ValueError("bits_per_component must be 5 or 8") cdef int min_bytes - min_bytes = (width*bits_per_pixel + 7) / 8 + min_bytes = (width*bits_per_pixel + 7) // 8 if bytes_per_row < min_bytes: bytes_per_row = min_bytes @@ -1826,16 +1826,16 @@ cdef class CGImageFile(CGImage): bits_per_pixel = 8 alpha_info = kCGImageAlphaNone - bytes_per_row = (bits_per_pixel*width + 7)/ 8 + bytes_per_row = (bits_per_pixel*width + 7) // 8 cdef char* data cdef char* py_data - cdef int dims[3] + cdef int numpy.npy_intp dims[3] dims[0] = height dims[1] = width - dims[2] = bits_per_pixel/bits_per_component + dims[2] = bits_per_pixel // bits_per_component - self.bmp_array = numpy.PyArray_SimpleNew(3, &(dims[0]), numpy.NPY_UBYTE) + self.bmp_array = numpy.PyArray_SimpleNew(3, dims, numpy.NPY_UBYTE) data = self.bmp_array.data bs = img.tobytes() @@ -2672,7 +2672,7 @@ cdef int bisect_left(PiecewiseLinearColorFunction self, CGFloat t): hi = self.num_stops lo = 0 while lo < hi: - mid = (lo + hi)/2 + mid = (lo + hi) / 2 stop = self.stops[mid] if t < stop: hi = mid @@ -2680,7 +2680,7 @@ cdef int bisect_left(PiecewiseLinearColorFunction self, CGFloat t): lo = mid + 1 return lo -cdef void piecewise_callback(void* obj, CGFloat* t, CGFloat* out): +cdef void piecewise_callback(void* obj, CGFloat* t, CGFloat* out) noexcept: cdef int i cdef CGFloat eps cdef PiecewiseLinearColorFunction self From 958c9578c5bc5c0270dc6a053f5b373c43644896 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:28:48 +0000 Subject: [PATCH 05/59] Fix cdef for dims --- kiva/quartz/ABCGI.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiva/quartz/ABCGI.pyx b/kiva/quartz/ABCGI.pyx index bfe0de903..3c9c59b44 100644 --- a/kiva/quartz/ABCGI.pyx +++ b/kiva/quartz/ABCGI.pyx @@ -1830,7 +1830,7 @@ cdef class CGImageFile(CGImage): cdef char* data cdef char* py_data - cdef int numpy.npy_intp dims[3] + cdef numpy.npy_intp dims[3] dims[0] = height dims[1] = width dims[2] = bits_per_pixel // bits_per_component From b11f2638791b1a38377b2d3959d43a9855584559 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:32:38 +0000 Subject: [PATCH 06/59] One more place for integer division --- kiva/quartz/ABCGI.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiva/quartz/ABCGI.pyx b/kiva/quartz/ABCGI.pyx index 3c9c59b44..08a22112c 100644 --- a/kiva/quartz/ABCGI.pyx +++ b/kiva/quartz/ABCGI.pyx @@ -2672,7 +2672,7 @@ cdef int bisect_left(PiecewiseLinearColorFunction self, CGFloat t): hi = self.num_stops lo = 0 while lo < hi: - mid = (lo + hi) / 2 + mid = (lo + hi) // 2 stop = self.stops[mid] if t < stop: hi = mid From 6551ebb533e1395e1fe1e5c1c303e2213de274e0 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:36:34 +0000 Subject: [PATCH 07/59] No need to add pxi include files to the Cython sources --- setup.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/setup.py b/setup.py index 440a7ffac..b823707d7 100644 --- a/setup.py +++ b/setup.py @@ -320,11 +320,6 @@ def macos_extensions(): 'kiva.quartz.ABCGI', sources=[ 'kiva/quartz/ABCGI.pyx', - 'kiva/quartz/Python.pxi', - 'kiva/quartz/numpy.pxi', - 'kiva/quartz/CoreFoundation.pxi', - 'kiva/quartz/CoreGraphics.pxi', - 'kiva/quartz/CoreText.pxi', ], extra_link_args=extra_link_args, include_dirs=[numpy.get_include()], @@ -333,9 +328,6 @@ def macos_extensions(): 'kiva.quartz.CTFont', sources=[ 'kiva/quartz/CTFont.pyx', - 'kiva/quartz/CoreFoundation.pxi', - 'kiva/quartz/CoreGraphics.pxi', - 'kiva/quartz/CoreText.pxi', ], extra_link_args=extra_link_args, ), From ef5c9a9fb42b654adfe65fb7b8ee095c666ab396 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:38:53 +0000 Subject: [PATCH 08/59] Do not build on macos-latest using pyside2 --- .github/workflows/test-with-pip.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 433c4fb96..0f303eb8c 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -30,6 +30,9 @@ jobs: toolkit: 'wx' - os: 'macos-latest' toolkit: 'wx' + # No PySide2 wheels for macos-latest + - os: 'macos-latest' + toolkit: 'pyside2' # Kiva tests hanging on windows, see #1038 - os: 'windows-latest' toolkit: 'pyqt5' From 14be4f68cf0ee5b9298681c0f981a71cb04cff77 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:45:01 +0000 Subject: [PATCH 09/59] Reduce the number of builds while we debug the build issues --- .github/workflows/test-with-pip.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 0f303eb8c..cd41027e9 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -12,8 +12,8 @@ jobs: test-ets: strategy: matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - toolkit: ['null', 'pyside2', 'pyside6', 'pyqt5', 'wx'] + os: ['ubuntu-latest'] # 'macos-latest', 'windows-latest'] + toolkit: ['null'] #, 'pyside2', 'pyside6', 'pyqt5', 'wx'] python-version: ['3.8', '3.10', '3.11'] exclude: # No Wx wheels available for Python 3.11 From e37b8edb1657876242f669bed01f69202f244793 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 11:55:52 +0000 Subject: [PATCH 10/59] Support both numpy 1.x and 2.x --- kiva/compatibility.py | 20 ++++++++++++++++++++ kiva/line_state.py | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 kiva/compatibility.py diff --git a/kiva/compatibility.py b/kiva/compatibility.py new file mode 100644 index 000000000..107fcc76e --- /dev/null +++ b/kiva/compatibility.py @@ -0,0 +1,20 @@ +# (C) Copyright 2025 Enthought, Inc., Austin, TX +# All rights reserved. +# +# This software is provided without warranty under the terms of the BSD +# license included in LICENSE.txt and may be redistributed only under +# the conditions described in the aforementioned license. The license +# is also available online at http://www.enthought.com/licenses/BSD.txt +# +# Thanks for using Enthought open source! +""" Compatibility workaround module + +Module to workaround compatibility issues with different versions of +the enable dependencies. + +""" + +try: + from numpy import sometrue +except ImportError: + from numpy import any as sometrue diff --git a/kiva/line_state.py b/kiva/line_state.py index e8064d888..5e28c50fe 100644 --- a/kiva/line_state.py +++ b/kiva/line_state.py @@ -14,7 +14,11 @@ state (eg. Wx, SVG and PDF backends, but not Agg or QPainter). """ -from numpy import array, asarray, shape, sometrue +from numpy import array, asarray, shape +try: + from numpy import sometrue +except ImportError: + from numpy import any as sometrue from .constants import NO_DASH From 9da7812b10cf03d4ea77d137ba3c10d72ecd42c3 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 12:04:20 +0000 Subject: [PATCH 11/59] Use the compatibility module --- kiva/line_state.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kiva/line_state.py b/kiva/line_state.py index 5e28c50fe..ec84d9e5d 100644 --- a/kiva/line_state.py +++ b/kiva/line_state.py @@ -1,4 +1,4 @@ -# (C) Copyright 2005-2023 Enthought, Inc., Austin, TX +# (C) Copyright 2005-2025 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD @@ -15,11 +15,8 @@ """ from numpy import array, asarray, shape -try: - from numpy import sometrue -except ImportError: - from numpy import any as sometrue +from .compatibility import sometrue from .constants import NO_DASH From a6f88801f7e73e4eaa24c6d0da004537d8b5bed1 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 12:04:35 +0000 Subject: [PATCH 12/59] Try to fix ImportError from numpy --- kiva/_marker_renderer.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/kiva/_marker_renderer.pyx b/kiva/_marker_renderer.pyx index 58ca30b30..ced7ce25e 100644 --- a/kiva/_marker_renderer.pyx +++ b/kiva/_marker_renderer.pyx @@ -10,6 +10,7 @@ import cython import numpy as np from numpy cimport uint8_t +numpy.import_array() from . cimport _marker_renderer From 5f54ee0679184279e473eeaf5d6be39263a75d96 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 12:12:43 +0000 Subject: [PATCH 13/59] Better fix for the import_array issue --- kiva/_marker_renderer.pyx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kiva/_marker_renderer.pyx b/kiva/_marker_renderer.pyx index ced7ce25e..6e3640782 100644 --- a/kiva/_marker_renderer.pyx +++ b/kiva/_marker_renderer.pyx @@ -7,13 +7,14 @@ # is also available online at http://www.enthought.com/licenses/BSD.txt # # Thanks for using Enthought open source! -import cython import numpy as np -from numpy cimport uint8_t -numpy.import_array() +from numpy cimport uint8_t, import_array +cimport cython from . cimport _marker_renderer +import_array() + ctypedef _marker_renderer.marker_renderer_base renderer_base_t @cython.internal From db9559d127ca35e119382ef0415b8d4f7d8915a0 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 12:18:20 +0000 Subject: [PATCH 14/59] More places to use import_array --- kiva/_cython_speedups.pyx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kiva/_cython_speedups.pyx b/kiva/_cython_speedups.pyx index dc346dc76..7ee29b170 100644 --- a/kiva/_cython_speedups.pyx +++ b/kiva/_cython_speedups.pyx @@ -8,9 +8,12 @@ # # Thanks for using Enthought open source! import numpy as np -from numpy cimport uint8_t -cimport _hit_test +from numpy cimport uint8_t, import_array +cimport cython +from . cimport _hit_test + +import_array() def points_in_polygon(pts, poly_pts, use_winding=False): """Test whether point pairs in pts are within the polygon, poly_pts. From 6850716138fdb9cb0d41c66e611c7129a663d0df Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 1 Feb 2025 12:26:59 +0000 Subject: [PATCH 15/59] Need to build with numpy > 2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8ab5b300d..099dd0828 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["cython", "oldest-supported-numpy", "setuptools", "swig", "wheel"] +requires = ["cython", "numpy>2", "setuptools", "swig", "wheel"] build-backend = "setuptools.build_meta" [tool.cibuildwheel] From 2ca5a7e2df1e3dbbbe35f028464e0e3a53737ae9 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 15 Mar 2025 12:22:11 +0000 Subject: [PATCH 16/59] Use oldest-supported-numpy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 099dd0828..8ab5b300d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["cython", "numpy>2", "setuptools", "swig", "wheel"] +requires = ["cython", "oldest-supported-numpy", "setuptools", "swig", "wheel"] build-backend = "setuptools.build_meta" [tool.cibuildwheel] From 73dd4d6c7a2d4adbc6f38cce5c5652ea6e5100c4 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 15 Mar 2025 13:28:32 +0000 Subject: [PATCH 17/59] Use older number for Python 3.8 and numpy > 2 for later --- pyproject.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8ab5b300d..5fdda9e85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,11 @@ [build-system] -requires = ["cython", "oldest-supported-numpy", "setuptools", "swig", "wheel"] +requires = [ + "cython", + "oldest-supported-numpy; python_version<'3.9'", + "numpy>=2; python_version>='3.9'", + "setuptools", + "swig", + "wheel"] build-backend = "setuptools.build_meta" [tool.cibuildwheel] From d05e6a364bc0e7d07d784131c9fbd4275f020c52 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 29 Mar 2025 14:01:22 +0000 Subject: [PATCH 18/59] Force c++14 for the agg extension --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index b823707d7..16aac9c2a 100644 --- a/setup.py +++ b/setup.py @@ -191,9 +191,11 @@ def agg_extensions(): for x in darwin_frameworks ] define_macros += [('__DARWIN__', None)] + compile_args = ['/std:c++14'] else: # This should work for most linux distributions plat = 'x11' + compile_args = ['-std=c++14'] freetype2_sources = [os.path.join(freetype_dir, 'src', src) for src in freetype2_sources] From 7c225a23c476c5e8d28ff01145068988263acb50 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 29 Mar 2025 14:02:42 +0000 Subject: [PATCH 19/59] Do not use the deprecated numpy api --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 16aac9c2a..db8e44e9f 100644 --- a/setup.py +++ b/setup.py @@ -169,6 +169,7 @@ def agg_extensions(): define_macros = [ # Numpy defines ('NUMPY', None), + ("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"), ('PY_ARRAY_TYPES_PREFIX', 'NUMPY_CXX'), ('OWN_DIMENSIONS', '0'), ('OWN_STRIDES', '0'), @@ -283,6 +284,9 @@ def base_extensions(): 'kiva/_hit_test.h', 'kiva/_hit_test.pxd', ], + define_macros=[ + ("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"), + ], include_dirs=['kiva', numpy.get_include()], language='c++', ), From 247a89a71d2986f69cf81d19cd93b688f4dd157e Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 29 Mar 2025 14:02:59 +0000 Subject: [PATCH 20/59] pass the extra compile options to the agg extension --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index db8e44e9f..ea9096f25 100644 --- a/setup.py +++ b/setup.py @@ -255,6 +255,7 @@ def agg_extensions(): ] + kiva_agg_sources, swig_opts=swig_opts, include_dirs=include_dirs, + extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, define_macros=define_macros, language='c++', From f0e143e76f320e51684c6e05a2875e6cf7b6784f Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 29 Mar 2025 14:11:17 +0000 Subject: [PATCH 21/59] No need to add more compile args --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index ea9096f25..d999275ac 100644 --- a/setup.py +++ b/setup.py @@ -192,11 +192,9 @@ def agg_extensions(): for x in darwin_frameworks ] define_macros += [('__DARWIN__', None)] - compile_args = ['/std:c++14'] else: # This should work for most linux distributions plat = 'x11' - compile_args = ['-std=c++14'] freetype2_sources = [os.path.join(freetype_dir, 'src', src) for src in freetype2_sources] @@ -255,7 +253,6 @@ def agg_extensions(): ] + kiva_agg_sources, swig_opts=swig_opts, include_dirs=include_dirs, - extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, define_macros=define_macros, language='c++', From a8c7f616b6f60755edb085e358124e8021700121 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 5 Apr 2025 13:40:59 +0100 Subject: [PATCH 22/59] Use more current numpy api (works with both 1.20.x and 2.x) --- kiva/agg/src/agg_typemaps.i | 44 +++++++++++++++++------------------ kiva/agg/src/gtk1/agg_bmp.cpp | 2 +- kiva/agg/src/numeric.i | 19 ++++++++------- kiva/agg/src/rect.i | 4 ++-- kiva/agg/src/rgba.i | 4 ++-- kiva/agg/src/rgba_array.i | 5 ++-- kiva/agg/src/x11/agg_bmp.cpp | 4 ++-- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/kiva/agg/src/agg_typemaps.i b/kiva/agg/src/agg_typemaps.i index 498d52028..7cbc09d63 100644 --- a/kiva/agg/src/agg_typemaps.i +++ b/kiva/agg/src/agg_typemaps.i @@ -71,7 +71,7 @@ %typemap(in) (double* point_array, int point_count) (PyArrayObject* ary=NULL, int is_new_object) { - ary = obj_to_array_contiguous_allow_conversion($input, PyArray_DOUBLE, + ary = obj_to_array_contiguous_allow_conversion($input, NPY_DOUBLE, is_new_object); int size[2] = {-1,2}; if (!ary || @@ -80,8 +80,8 @@ { goto fail; } - $1 = (double*) ary->data; - $2 = ary->dimensions[0]; + $1 = (double*)PyArray_DATA(ary); + $2 = array_size(ary, 0); } %typemap(freearg) (double* point_array, int point_count) @@ -104,7 +104,7 @@ %typemap(in) (unsigned char* results, int Nresults) (PyArrayObject* ary=NULL, int is_new_object) { - ary = obj_to_array_contiguous_allow_conversion($input, PyArray_BOOL, + ary = obj_to_array_contiguous_allow_conversion($input, NPY_BOOL, is_new_object); int size[1] = {-1}; if (!ary || @@ -113,8 +113,8 @@ { goto fail; } - $1 = (unsigned char*) ary->data; - $2 = ary->dimensions[0]; + $1 = (unsigned char*)PyArray_DATA(ary); + $2 = array_size(ary, 0); } %typemap(freearg) (unsigned char* results, int Nresults) @@ -139,7 +139,7 @@ %typemap(in) (double* rect_array, int rect_count) (PyArrayObject* ary=NULL, int is_new_object) { - ary = obj_to_array_contiguous_allow_conversion($input, PyArray_DOUBLE, + ary = obj_to_array_contiguous_allow_conversion($input, NPY_DOUBLE, is_new_object); int size[2] = {-1,4}; if (!ary || @@ -148,8 +148,8 @@ { goto fail; } - $1 = (double*) ary->data; - $2 = ary->dimensions[0]; + $1 = (double*)PyArray_DATA(ary); + $2 = array_size(ary, 0); } %typemap(freearg) (double* rect_array, int rect_count) @@ -220,10 +220,10 @@ %typemap(argout) double *array6 { // Append output value $1 to $result npy_intp dims = 6; - PyArrayObject* ary_obj = (PyArrayObject*) PyArray_SimpleNew(1,&dims,PyArray_DOUBLE); + PyArrayObject* ary_obj = (PyArrayObject*) PyArray_SimpleNew(1,&dims,NPY_DOUBLE); if( ary_obj == NULL ) return NULL; - double* data = (double*)ary_obj->data; + double* data = (double*)PyArray_DATA(ary_obj); for (int i=0; i < 6;i++) data[i] = $1[i]; Py_DECREF($result); @@ -255,15 +255,15 @@ } else { - ary = obj_to_array_contiguous_allow_conversion($input, PyArray_DOUBLE, + ary = obj_to_array_contiguous_allow_conversion($input, NPY_DOUBLE, is_new_object); if (!ary || !require_dimensions(ary,1)) { goto fail; } - $1 = (double*) ary->data; - $2 = ary->dimensions[0]; + $1 = (double*)PyArray_DATA(ary); + $2 = array_size(ary, 0); } } @@ -288,7 +288,7 @@ %typemap(in) (unsigned char *image_data=NULL, int width, int height, int stride) { - PyArrayObject* ary = obj_to_array_no_conversion($input, PyArray_UBYTE); + PyArrayObject* ary = obj_to_array_no_conversion($input, NPY_UBYTE); int dimensions[2] = {2,3}; // !! No longer requiring contiguity because some bitmaps are padded at the // !! end (i.e. Windows). We should probably special case that one though, @@ -301,11 +301,11 @@ { goto fail; } - $1 = (unsigned char*) ary->data; + $1 = (unsigned char*)PyArray_DATA(ary); // notice reversed orders... - $2 = ary->dimensions[1]; - $3 = ary->dimensions[0]; - $4 = ary->strides[0]; + $2 = PyArray_DIM(ary,1); + $3 = PyArray_DIM(ary,0); + $4 = PyArray_STRIDE(ary,0); } // -------------------------------------------------------------------------- @@ -328,7 +328,7 @@ %typemap(in) std::vector (PyArrayObject* ary=NULL, int is_new_object) { - PyArrayObject* ary = obj_to_array_no_conversion($input, PyArray_DOUBLE); + PyArrayObject* ary = obj_to_array_no_conversion($input, NPY_DOUBLE); if (ary == NULL) { goto fail; @@ -336,10 +336,10 @@ std::vector stops; - for (int i = 0; i < ary->dimensions[0]; i++) + for (int i = 0; i < PyArray_DIM(ary, 0); i++) { // the stop is offset, red, green, blue, alpha - double* data = (double*)(ary->data); + double* data = (double*)(PyArray_DATA(ary)); agg24::rgba8 color(data[5*i+1]*255, data[5*i+2]*255, data[5*i+3]*255, data[5*i+4]*255); stops.push_back(kiva::gradient_stop(data[5*i], color)); } diff --git a/kiva/agg/src/gtk1/agg_bmp.cpp b/kiva/agg/src/gtk1/agg_bmp.cpp index a80d3b62f..73140d1da 100644 --- a/kiva/agg/src/gtk1/agg_bmp.cpp +++ b/kiva/agg/src/gtk1/agg_bmp.cpp @@ -126,7 +126,7 @@ namespace agg24 arr = PyArray_SimpleNew(3, dims, PyArray_BYTE); if (arr==NULL) return NULL; - data = ((PyArrayObject *)arr)->data; + data = PyArray_DATA((PyArrayObject *)arr); switch (format) { case pix_format_bgra32: diff --git a/kiva/agg/src/numeric.i b/kiva/agg/src/numeric.i index 9b933070e..dc6c8d2bc 100644 --- a/kiva/agg/src/numeric.i +++ b/kiva/agg/src/numeric.i @@ -30,14 +30,15 @@ Here are the typemap helper functions for numeric arrays: */ %{ -#include "numpy/arrayobject.h" #include +#include "numpy/arrayobject.h" #define is_array(a) ((a) && PyArray_Check((PyArrayObject *)a)) -#define array_type(a) (int)(((PyArrayObject *)a)->descr->type_num) -#define array_dimensions(a) (((PyArrayObject *)a)->nd) -#define array_size(a,i) (((PyArrayObject *)a)->dimensions[i]) -#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(ary)) +#define array_type(a) (int)(PyArray_TYPE((PyArrayObject *)a)) +#define array_dimensions(a) PyArray_NDIM((PyArrayObject *)a) +#define array_size(a,i) PyArray_DIM((PyArrayObject *)a, i) +#define array_is_contiguous(a) PyArray_ISCONTIGUOUS(a) + std::string pytype_string(PyObject* py_obj) { @@ -75,10 +76,10 @@ int type_match(int actual_type, int desired_type) // Make sure input has correct numeric type. Allow character and byte to // match also allow int and long to match. if ( actual_type != desired_type && - !(desired_type == PyArray_CHAR && actual_type == PyArray_BYTE) && - !(desired_type == PyArray_BYTE && actual_type == PyArray_CHAR) && - !(desired_type == PyArray_INT && actual_type == PyArray_LONG) && - !(desired_type == PyArray_LONG && actual_type == PyArray_INT)) + !(desired_type == NPY_CHAR && actual_type == NPY_BYTE) && + !(desired_type == NPY_BYTE && actual_type == NPY_CHAR) && + !(desired_type == NPY_INT && actual_type == NPY_LONG) && + !(desired_type == NPY_LONG && actual_type == NPY_INT)) { match = 0; } diff --git a/kiva/agg/src/rect.i b/kiva/agg/src/rect.i index 8f2b9fcd6..0be0fbc77 100644 --- a/kiva/agg/src/rect.i +++ b/kiva/agg/src/rect.i @@ -15,7 +15,7 @@ { PyArrayObject* ary=NULL; int is_new_object; - ary = obj_to_array_contiguous_allow_conversion($input, PyArray_DOUBLE, + ary = obj_to_array_contiguous_allow_conversion($input, NPY_DOUBLE, is_new_object); int size[1] = {4}; @@ -26,7 +26,7 @@ goto fail; } - double* data = (double*)(ary->data); + double* data = (double*)PyArray_DATA(ary); kiva::rect_type rect(data[0], data[1], data[2], data[3]); $1 = ▭ diff --git a/kiva/agg/src/rgba.i b/kiva/agg/src/rgba.i index 4c8e4a574..07fa09325 100644 --- a/kiva/agg/src/rgba.i +++ b/kiva/agg/src/rgba.i @@ -20,10 +20,10 @@ %typemap(argout) double *out { // Append output value $1 to $result npy_intp dims = 4; - PyArrayObject* ary_obj = (PyArrayObject*) PyArray_SimpleNew(1,&dims,PyArray_DOUBLE); + PyArrayObject* ary_obj = (PyArrayObject*) PyArray_SimpleNew(1,&dims,NPY_DOUBLE); if( ary_obj == NULL ) return NULL; - double* data = (double*)ary_obj->data; + double* data = (double*)PyArray_DATA(ary_obj); for (int i=0; i < 4;i++) data[i] = $1[i]; Py_DECREF($result); diff --git a/kiva/agg/src/rgba_array.i b/kiva/agg/src/rgba_array.i index 75bc308b2..e2bdb51af 100644 --- a/kiva/agg/src/rgba_array.i +++ b/kiva/agg/src/rgba_array.i @@ -89,8 +89,8 @@ %typemap(out) rgba_as_array { npy_intp size = 4; - $result = PyArray_SimpleNew(1, &size, PyArray_DOUBLE); - double* data = (double*)((PyArrayObject*)$result)->data; + $result = PyArray_SimpleNew(1, &size, NPY_DOUBLE); + double* data = (double*)(PyArray_DATA((PyArrayObject*)$result)); data[0] = $1->r; data[1] = $1->g; data[2] = $1->b; @@ -98,4 +98,3 @@ } #endif - diff --git a/kiva/agg/src/x11/agg_bmp.cpp b/kiva/agg/src/x11/agg_bmp.cpp index 66bac29ca..964c00e60 100644 --- a/kiva/agg/src/x11/agg_bmp.cpp +++ b/kiva/agg/src/x11/agg_bmp.cpp @@ -124,10 +124,10 @@ namespace agg24 dims[1] = h; dims[2] = 3; import_array(); - arr = PyArray_SimpleNew(3,dims,PyArray_BYTE); + arr = PyArray_SimpleNew(3,dims,NPY_BYTE); if (arr==NULL) return NULL; - data = ((PyArrayObject *)arr)->data; + data = PyArray_BYTES((PyArrayObject *)arr); switch (format) { case pix_format_bgra32: From 0b7d4fb4a1f538734c3965f78ec65f891b0f0bca Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 10:37:51 +0100 Subject: [PATCH 23/59] Update test-with-edm.yml --- .github/workflows/test-with-edm.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index b3c20e23c..ff6c6b8b1 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -7,7 +7,7 @@ name: Test with EDM on: pull_request env: - INSTALL_EDM_VERSION: 3.5.0 + INSTALL_EDM_VERSION: 4.1.1 jobs: @@ -16,20 +16,20 @@ jobs: strategy: matrix: toolkit: ['null', 'pyside6'] - runtime: ['3.8'] + runtime: ['3.8', '3.11'] runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Qt dependencies uses: ./.github/actions/install-qt-support if: matrix.toolkit != 'wx' - name: Cache EDM packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ matrix.runtime }}-${{ hashFiles('ci/edmtool.py') }} - name: Setup EDM - uses: enthought/setup-edm-action@v2 + uses: enthought/setup-edm-action@v3.1 with: edm-version: ${{ env.INSTALL_EDM_VERSION }} - name: Install click to the default EDM environment @@ -46,7 +46,7 @@ jobs: matrix: os: ["windows-latest"] toolkit: ['null', 'pyside6', 'wx'] - runtime: ['3.8'] + runtime: ['3.11'] runs-on: ${{ matrix.os }} env: # Set root directory, mainly for Windows, so that the EDM Python @@ -55,9 +55,9 @@ jobs: # relative path between the site-packages and the source directory. EDM_ROOT_DIRECTORY: ${{ github.workspace }}/.edm steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache EDM packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ matrix.runtime }}-${{ hashFiles('ci/edmtool.py') }} From 1cf2dca0e33e1319d92ac0a84229221bcebb9188 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 10:38:46 +0100 Subject: [PATCH 24/59] Update test-with-pip.yml --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index cd41027e9..5bb46352b 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -39,7 +39,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: From 1e76033d5977ff4cb79a68c180b1bd2c93f850a6 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 10:45:52 +0100 Subject: [PATCH 25/59] Update bleeding-edge.yml --- .github/workflows/bleeding-edge.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bleeding-edge.yml b/.github/workflows/bleeding-edge.yml index b6e859302..674057bfe 100644 --- a/.github/workflows/bleeding-edge.yml +++ b/.github/workflows/bleeding-edge.yml @@ -14,16 +14,16 @@ jobs: matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] toolkit: ['null', 'pyside6'] - python-version: ['3.11'] + python-version: ['3.13'] include: # No Wx wheels available for Python 3.11, so test on 3.10 - os: 'windows-latest' toolkit: 'wx' - python-version: '3.10' + python-version: '3.13' runs-on: ${{ matrix.os }} steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: From 19e1976142a1916d786eac98a111368e6e70b82f Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 10:48:09 +0100 Subject: [PATCH 26/59] Update test-with-edm.yml --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index ff6c6b8b1..130e7b2f8 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -29,7 +29,7 @@ jobs: path: ~/.cache key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ matrix.runtime }}-${{ hashFiles('ci/edmtool.py') }} - name: Setup EDM - uses: enthought/setup-edm-action@v3.1 + uses: enthought/setup-edm-action@v4.1 with: edm-version: ${{ env.INSTALL_EDM_VERSION }} - name: Install click to the default EDM environment From a8d099b40c7e88ad33645f5045561ffd09ae176f Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 10:49:20 +0100 Subject: [PATCH 27/59] Update test-with-edm.yml --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 130e7b2f8..984034222 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -62,7 +62,7 @@ jobs: path: ~/.cache key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ matrix.runtime }}-${{ hashFiles('ci/edmtool.py') }} - name: Setup EDM - uses: enthought/setup-edm-action@v1 + uses: enthought/setup-edm-action@v4.1 with: edm-version: ${{ env.INSTALL_EDM_VERSION }} - name: Install click to the default EDM environment From e2c62286f8999f7ba12f75c128a9a4a88b412608 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 11:00:54 +0100 Subject: [PATCH 28/59] Update ci code to work with 3.11 on edm --- ci/edmtool.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index e46e36b02..9f62c6849 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -87,6 +87,7 @@ supported_combinations = { '3.6': {'pyside2', 'pyqt5', 'wx', 'null'}, '3.8': {'pyside6', 'pyqt6', 'wx', 'null'}, + '3.11': {'pyside6', 'pyqt6', 'wx', 'null'}, } dependencies = { @@ -124,6 +125,22 @@ "traitsui", "wheel", } + '3.11': { + "apptools", + "celiagg", + "coverage", + "Cython", + "fonttools", + "kiwisolver", + "numpy", + "pillow_simd", + "pyface", + "pygments", + "pyparsing", + "traits", + "traitsui", + "wheel", + } } # Dependencies we install from source for cron tests @@ -202,7 +219,7 @@ def install(runtime, toolkit, environment, source): " --no-dependencies"), ] - if toolkit == "wx": + if toolkit == "wx" and runtime in ("3.6", "3.8"): if sys.platform == "darwin": commands.append( "edm run -e {environment} -- python -m pip install wxPython<4.1" # noqa: E501 @@ -216,6 +233,8 @@ def install(runtime, toolkit, environment, source): commands.append( "edm run -e {environment} -- python -m pip install wxPython" ) + elif toolkit == "wx": + commands.append("edm install -e {environment} wxpython") click.echo("Creating environment '{environment}'".format(**parameters)) execute(commands, parameters) From 0b91de86a3a908e9ac1d32e6e446002c7a51f566 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 11:06:42 +0100 Subject: [PATCH 29/59] fix typo --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 9f62c6849..b1e1a681f 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -124,7 +124,7 @@ "traits", "traitsui", "wheel", - } + }, '3.11': { "apptools", "celiagg", From 8d0a849cabc57c3707ac89f1bea420b7b6bd5480 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 11:10:37 +0100 Subject: [PATCH 30/59] In 3.11 edm we only have pillow --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index b1e1a681f..fef565465 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -133,7 +133,7 @@ "fonttools", "kiwisolver", "numpy", - "pillow_simd", + "pillow", "pyface", "pygments", "pyparsing", From c0db6e18f4ce98256f2a4d2b0857e3fb877c8028 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 11:13:08 +0100 Subject: [PATCH 31/59] Add missing requirements file --- ci/requirements_3.11.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ci/requirements_3.11.txt diff --git a/ci/requirements_3.11.txt b/ci/requirements_3.11.txt new file mode 100644 index 000000000..2a49d052f --- /dev/null +++ b/ci/requirements_3.11.txt @@ -0,0 +1,2 @@ +pypdf2<3.0 +reportlab From 59158c69a85ec8565519c4f20bc33c3aaaee01ee Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 11:30:54 +0100 Subject: [PATCH 32/59] Use the right configuration to install wx --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index fef565465..a045eb3e2 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -234,7 +234,7 @@ def install(runtime, toolkit, environment, source): "edm run -e {environment} -- python -m pip install wxPython" ) elif toolkit == "wx": - commands.append("edm install -e {environment} wxpython") + commands.append("edm --config {edm_config} install -e {environment} wxpython") click.echo("Creating environment '{environment}'".format(**parameters)) execute(commands, parameters) From 912671623ddb26d5cfef16c83afcfbd5e6ac9431 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 12:09:43 +0100 Subject: [PATCH 33/59] Provide the platform option in edm to fix linux testing --- ci/edmtool.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index a045eb3e2..2b19cc726 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -90,6 +90,17 @@ '3.11': {'pyside6', 'pyqt6', 'wx', 'null'}, } +platforms = { + ('3.6', 'Linux') : 'rh7_x86_64', + ('3.8', 'Linux') : 'rh7_x86_64', + ('3.11', 'Linux') : 'rh8_x86_64', + ('3.6', 'Windows') : 'win_x86_64', + ('3.8', 'Windows') : 'win_x86_64', + ('3.11', 'Windows') : 'win_x86_64', + ('3.6', 'Darwin') : 'osx_x86_64', + ('3.8', 'Darwin') : 'osx_x86_64', + ('3.11', 'Darwin') : 'osx_x86_64'} + dependencies = { '3.6': { "apptools", @@ -212,7 +223,7 @@ def install(runtime, toolkit, environment, source): # edm commands to setup the development environment commands = [ ("edm --config {edm_config} environments create {environment} " - "--force --version={runtime}"), + "--force --version={runtime} --platform={platform}"), ("edm --config {edm_config} install -y -e {environment} {packages} " "--add-repository enthought/lgpl"), ("edm run -e {environment} -- pip install -r ci/requirements_{runtime}.txt" @@ -496,7 +507,8 @@ def get_parameters(runtime, toolkit, environment): tmpl = 'enable-test-{runtime}-{toolkit}' environment = tmpl.format(**parameters) parameters['environment'] = environment - + os = platform.system() + parameters['platform'] = platforms[(runtime, os)] parameters["edm_config"] = EDM_CONFIG return parameters From 20db70ac4dc76527d297ac0247486b7c8c5ed0e7 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 12:12:45 +0100 Subject: [PATCH 34/59] add missing import --- ci/edmtool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/edmtool.py b/ci/edmtool.py index 2b19cc726..30fd52abd 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -76,6 +76,7 @@ import glob import os +import platform import subprocess import sys from shutil import rmtree, copy as copyfile From 3284f1bc7e16a36aa6304e31dc4cf830506ecd59 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 12:15:30 +0100 Subject: [PATCH 35/59] Disable interactive mode when installing wxpython --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 30fd52abd..6d283d5b4 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -246,7 +246,7 @@ def install(runtime, toolkit, environment, source): "edm run -e {environment} -- python -m pip install wxPython" ) elif toolkit == "wx": - commands.append("edm --config {edm_config} install -e {environment} wxpython") + commands.append("edm --config {edm_config} install -e {environment} -y wxpython") click.echo("Creating environment '{environment}'".format(**parameters)) execute(commands, parameters) From 05cd86936268e9f43ea7eb155069da8d5a79c58f Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 12:26:24 +0100 Subject: [PATCH 36/59] Update test-with-pip.yml --- .github/workflows/test-with-pip.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 5bb46352b..c43c0167f 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -12,8 +12,8 @@ jobs: test-ets: strategy: matrix: - os: ['ubuntu-latest'] # 'macos-latest', 'windows-latest'] - toolkit: ['null'] #, 'pyside2', 'pyside6', 'pyqt5', 'wx'] + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + toolkit: ['null', 'pyside2', 'pyside6', 'pyqt5', 'wx'] python-version: ['3.8', '3.10', '3.11'] exclude: # No Wx wheels available for Python 3.11 From 8f3a34ff409e8e539d878d1a70b728bb795f34d9 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 12:28:18 +0100 Subject: [PATCH 37/59] Update test-with-pip.yml --- .github/workflows/test-with-pip.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index c43c0167f..df3dda1a9 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -16,20 +16,12 @@ jobs: toolkit: ['null', 'pyside2', 'pyside6', 'pyqt5', 'wx'] python-version: ['3.8', '3.10', '3.11'] exclude: - # No Wx wheels available for Python 3.11 - - toolkit: 'wx' - python-version: '3.11' # No PySide2 wheels available for Python 3.11 - toolkit: 'pyside2' python-version: '3.11' # No PyQt5 wheels available for Python 3.11 - toolkit: 'pyqt5' python-version: '3.11' - # No Wx wheels available for ubuntu or macos - - os: 'ubuntu-latest' - toolkit: 'wx' - - os: 'macos-latest' - toolkit: 'wx' # No PySide2 wheels for macos-latest - os: 'macos-latest' toolkit: 'pyside2' From 641de31f4969cd06da1ed4d36656a22e86d491fd Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 12:30:23 +0100 Subject: [PATCH 38/59] Update test-with-pip.yml --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index df3dda1a9..2c8560e08 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -12,7 +12,7 @@ jobs: test-ets: strategy: matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + os: ['macos-latest'] #, 'ubuntu-latest', 'windows-latest'] toolkit: ['null', 'pyside2', 'pyside6', 'pyqt5', 'wx'] python-version: ['3.8', '3.10', '3.11'] exclude: From 7a64fdaade017d8398f610f40403ded40e887c48 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Apr 2025 13:13:45 +0100 Subject: [PATCH 39/59] Fix CGFunctionEvaluateCallback signature --- kiva/quartz/CoreGraphics.pxi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kiva/quartz/CoreGraphics.pxi b/kiva/quartz/CoreGraphics.pxi index 45d3e5613..73dd4235d 100644 --- a/kiva/quartz/CoreGraphics.pxi +++ b/kiva/quartz/CoreGraphics.pxi @@ -465,7 +465,7 @@ cdef extern from "ApplicationServices/ApplicationServices.h": ctypedef void* CGFunctionRef - ctypedef void (*CGFunctionEvaluateCallback)(void *info, CGFloat *in_data, CGFloat *out) + ctypedef void (*CGFunctionEvaluateCallback)(void *info, const CGFloat *in_data, CGFloat *out) ctypedef void (*CGFunctionReleaseInfoCallback)(void *info) @@ -508,4 +508,3 @@ cdef extern from "ApplicationServices/ApplicationServices.h": CFTypeID CGLayerGetTypeID() CFTypeID CGContextGetTypeID() - From 6d8475e82153e3595c52eeeb24490ecc8538f21d Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 19 Apr 2025 10:41:55 +0100 Subject: [PATCH 40/59] Do not try to install celiagg --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 2c8560e08..f8e9c646a 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -54,7 +54,7 @@ jobs: run: | python -m pip install --upgrade pip wheel - name: Install local packages - run: pip install ".[celiagg,cairo,layout,pdf,svg,test,${{ matrix.toolkit }}]" + run: pip install ".[cairo,layout,pdf,svg,test,${{ matrix.toolkit }}]" - name: Sanity check package version run: pip list - name: Run kiva test suite (Linux) From ba6a4cdcc517452fe30b9c484fca2cfbdbf8eb9e Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Apr 2025 13:27:20 +0100 Subject: [PATCH 41/59] Update signature for callback functions --- kiva/quartz/ABCGI.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kiva/quartz/ABCGI.pyx b/kiva/quartz/ABCGI.pyx index 08a22112c..2c3354a75 100644 --- a/kiva/quartz/ABCGI.pyx +++ b/kiva/quartz/ABCGI.pyx @@ -2526,7 +2526,7 @@ cdef class ShadingFunction: if self.function == NULL: raise RuntimeError("could not make CGFunctionRef") -cdef void shading_callback(object self, CGFloat* in_data, CGFloat* out_data): +cdef void shading_callback(object self, const CGFloat* in_data, CGFloat* out_data): cdef int i out = self(in_data[0]) for i from 0 <= i < self.n_dims: @@ -2680,7 +2680,7 @@ cdef int bisect_left(PiecewiseLinearColorFunction self, CGFloat t): lo = mid + 1 return lo -cdef void piecewise_callback(void* obj, CGFloat* t, CGFloat* out) noexcept: +cdef void piecewise_callback(void* obj, const CGFloat* t, CGFloat* out) noexcept: cdef int i cdef CGFloat eps cdef PiecewiseLinearColorFunction self From a9740779a5a8f69310e45c60f10e938508329e12 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 10 May 2025 13:00:13 +0300 Subject: [PATCH 42/59] Run tests on all platforms --- .github/workflows/test-with-pip.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index f8e9c646a..fe87b8ed2 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -11,8 +11,9 @@ on: jobs: test-ets: strategy: + fail-fast: false matrix: - os: ['macos-latest'] #, 'ubuntu-latest', 'windows-latest'] + os: ['macos-latest', 'ubuntu-latest', 'windows-latest'] toolkit: ['null', 'pyside2', 'pyside6', 'pyqt5', 'wx'] python-version: ['3.8', '3.10', '3.11'] exclude: From c984194bd2e620af2e0e11ad96916db0db4d2b7f Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 17 May 2025 11:52:26 +0100 Subject: [PATCH 43/59] Remove 3.6 and 3.8 builds from the EDM testing We do not have a recent Cython in EDM 3.6 and 3.8 so we cannot easily build enable for these EDM environments --- .github/workflows/test-with-edm.yml | 2 +- ci/edmtool.py | 68 +---------------------------- ci/requirements_3.6.txt | 2 - ci/requirements_3.8.txt | 2 - 4 files changed, 3 insertions(+), 71 deletions(-) delete mode 100644 ci/requirements_3.6.txt delete mode 100644 ci/requirements_3.8.txt diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 984034222..145641515 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: toolkit: ['null', 'pyside6'] - runtime: ['3.8', '3.11'] + runtime: ['3.11'] runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 diff --git a/ci/edmtool.py b/ci/edmtool.py index 6d283d5b4..e32f0d795 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -86,57 +86,15 @@ import click supported_combinations = { - '3.6': {'pyside2', 'pyqt5', 'wx', 'null'}, - '3.8': {'pyside6', 'pyqt6', 'wx', 'null'}, '3.11': {'pyside6', 'pyqt6', 'wx', 'null'}, } platforms = { - ('3.6', 'Linux') : 'rh7_x86_64', - ('3.8', 'Linux') : 'rh7_x86_64', ('3.11', 'Linux') : 'rh8_x86_64', - ('3.6', 'Windows') : 'win_x86_64', - ('3.8', 'Windows') : 'win_x86_64', ('3.11', 'Windows') : 'win_x86_64', - ('3.6', 'Darwin') : 'osx_x86_64', - ('3.8', 'Darwin') : 'osx_x86_64', ('3.11', 'Darwin') : 'osx_x86_64'} dependencies = { - '3.6': { - "apptools", - "celiagg", - "coverage", - "Cython", - "fonttools", - "kiwisolver", - "numpy", - "pillow", - "pyface", - "pygments", - "pyparsing", - "pypdf2", - "reportlab", - "traits", - "traitsui", - "wheel", - }, - '3.8': { - "apptools", - "celiagg", - "coverage", - "Cython", - "fonttools", - "kiwisolver", - "numpy", - "pillow_simd", - "pyface", - "pygments", - "pyparsing", - "traits", - "traitsui", - "wheel", - }, '3.11': { "apptools", "celiagg", @@ -166,19 +124,14 @@ ] extra_dependencies = { - 'pyqt5': {'pyqt5'}, 'pyqt6': {'pyqt6'}, - 'pyside2': {'pyside2'}, 'pyside6': {'pyside6'}, - # XXX once wxPython 4 is available in EDM, we will want it here - "wx": set(), + "wx": {'wxPython'}, 'null': set() } environment_vars = { - 'pyside2': {'ETS_TOOLKIT': 'qt', 'QT_API': 'pyside2'}, 'pyside6': {'ETS_TOOLKIT': 'qt', 'QT_API': 'pyside6'}, - 'pyqt5': {'ETS_TOOLKIT': 'qt', 'QT_API': 'pyqt5'}, 'pyqt6': {'ETS_TOOLKIT': 'qt', 'QT_API': 'pyqt6'}, 'wx': {'ETS_TOOLKIT': 'wx'}, 'null': {'ETS_TOOLKIT': 'null.image'}, @@ -206,7 +159,7 @@ def cli(): @cli.command() -@click.option('--runtime', default='3.6') +@click.option('--runtime', default='3.11') @click.option('--toolkit', default='null') @click.option('--environment', default=None) @click.option( @@ -231,23 +184,6 @@ def install(runtime, toolkit, environment, source): " --no-dependencies"), ] - if toolkit == "wx" and runtime in ("3.6", "3.8"): - if sys.platform == "darwin": - commands.append( - "edm run -e {environment} -- python -m pip install wxPython<4.1" # noqa: E501 - ) - elif sys.platform == "linux": - # XXX this is mainly for TravisCI workers; need a generic solution - commands.append( - "edm run -e {environment} -- pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04/ wxPython" # noqa: E501 - ) - else: - commands.append( - "edm run -e {environment} -- python -m pip install wxPython" - ) - elif toolkit == "wx": - commands.append("edm --config {edm_config} install -e {environment} -y wxpython") - click.echo("Creating environment '{environment}'".format(**parameters)) execute(commands, parameters) diff --git a/ci/requirements_3.6.txt b/ci/requirements_3.6.txt deleted file mode 100644 index 9ddfdc157..000000000 --- a/ci/requirements_3.6.txt +++ /dev/null @@ -1,2 +0,0 @@ -pygarrayimage -pyglet<2.0 diff --git a/ci/requirements_3.8.txt b/ci/requirements_3.8.txt deleted file mode 100644 index 2a49d052f..000000000 --- a/ci/requirements_3.8.txt +++ /dev/null @@ -1,2 +0,0 @@ -pypdf2<3.0 -reportlab From 02c97cbd0d09f5e2ea0ccf96861189c1ab7bcce4 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 17 May 2025 11:55:14 +0100 Subject: [PATCH 44/59] Test the wx widget on EDM linux environments --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 145641515..94e4ff5bd 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -15,7 +15,7 @@ jobs: test-edm-linux: strategy: matrix: - toolkit: ['null', 'pyside6'] + toolkit: ['null', 'pyside6', 'wx'] runtime: ['3.11'] runs-on: "ubuntu-latest" steps: From 53270d3a3de863d084bec48ecdfdd8fb596751ad Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 17 May 2025 13:21:03 +0100 Subject: [PATCH 45/59] Update installed apt packages - We do not need to install Qt packages - We need to install the x11-dev headers --- .github/workflows/test-with-edm.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 94e4ff5bd..af9d76944 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -20,9 +20,8 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 - - name: Install Qt dependencies - uses: ./.github/actions/install-qt-support - if: matrix.toolkit != 'wx' + - name: Install x11 headers + run: sudo apt-get install libx11-dev - name: Cache EDM packages uses: actions/cache@v4 with: From 7f95aaac08dd1a1c061b452bed8e98cb9a68679f Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 17 May 2025 13:29:20 +0100 Subject: [PATCH 46/59] Update EDM testing - Install opengl0 for wx and qt toolkits --- .github/workflows/test-with-edm.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index af9d76944..fb9936ea9 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -21,7 +21,10 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install x11 headers - run: sudo apt-get install libx11-dev + run: | + sudo apt-get install libx11-dev + sudo apt-get install libopengl0 + if: matrix.toolkit != 'null' - name: Cache EDM packages uses: actions/cache@v4 with: From c5da416f96a83967c069562d4485c8f7e2a79a58 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 24 May 2025 11:20:52 +0100 Subject: [PATCH 47/59] Add the system usr/include folders for the agg compile --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index d999275ac..7d3e1dd06 100644 --- a/setup.py +++ b/setup.py @@ -243,6 +243,7 @@ def agg_extensions(): if plat == 'win32': plat_support_libraries += ['gdi32', 'user32'] elif plat == 'x11': + include_dirs += ['/usr/include'] plat_support_libraries += ['X11'] return [ From fce668e02c43021f03384346a801f3299e86055a Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 24 May 2025 11:50:46 +0100 Subject: [PATCH 48/59] Update edmtool - Install reportlab from edm - Use the build package to build enable in a separate step --- ci/edmtool.py | 14 ++++++++++---- ci/requirements_3.11.txt | 1 - 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index e32f0d795..1339f5174 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -110,6 +110,8 @@ "traits", "traitsui", "wheel", + "build", + "reportlab", } } @@ -211,10 +213,14 @@ def install(runtime, toolkit, environment, source): # No matter what happens before, always install local source again with no # dependencies or we risk testing against an released enable. - install_local = ( - "edm run -e {environment} -- " - "pip install --force-reinstall --no-dependencies " + ROOT - ) + local = [ + ( + "edm run -e {environment} -- " + "python -m build -x -n -w" + ROOT), + ( + "edm run -e {environment} -- " + "python -m pip install --no-deps dist/*.whl") + ] execute([install_local], parameters) click.echo('Done install') diff --git a/ci/requirements_3.11.txt b/ci/requirements_3.11.txt index 2a49d052f..ece09d9b0 100644 --- a/ci/requirements_3.11.txt +++ b/ci/requirements_3.11.txt @@ -1,2 +1 @@ pypdf2<3.0 -reportlab From e54cfb806975ab8d1af680470ec6d9e14f0892e7 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 29 May 2025 16:29:27 +0100 Subject: [PATCH 49/59] Fix variable name --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 1339f5174..29d227ea4 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -213,7 +213,7 @@ def install(runtime, toolkit, environment, source): # No matter what happens before, always install local source again with no # dependencies or we risk testing against an released enable. - local = [ + install_local = [ ( "edm run -e {environment} -- " "python -m build -x -n -w" + ROOT), From 61c20d09a465c4fd72b2747544d004154b29d893 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 29 May 2025 16:32:38 +0100 Subject: [PATCH 50/59] install local is already a list --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 29d227ea4..7910995a9 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -221,7 +221,7 @@ def install(runtime, toolkit, environment, source): "edm run -e {environment} -- " "python -m pip install --no-deps dist/*.whl") ] - execute([install_local], parameters) + execute(install_local, parameters) click.echo('Done install') From e199db2eb1f09a5e104d57ad09935a4517ea9488 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 29 May 2025 16:35:31 +0100 Subject: [PATCH 51/59] Add missing space in the command line --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 7910995a9..2c25ed1eb 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -216,7 +216,7 @@ def install(runtime, toolkit, environment, source): install_local = [ ( "edm run -e {environment} -- " - "python -m build -x -n -w" + ROOT), + "python -m build -x -n -w " + ROOT), ( "edm run -e {environment} -- " "python -m pip install --no-deps dist/*.whl") From 17b59d329b4e368edd6cd240918761a94ec23bba Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 29 May 2025 16:40:26 +0100 Subject: [PATCH 52/59] Update test-with-edm.yml --- .github/workflows/test-with-edm.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index fb9936ea9..57614b34e 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -24,7 +24,6 @@ jobs: run: | sudo apt-get install libx11-dev sudo apt-get install libopengl0 - if: matrix.toolkit != 'null' - name: Cache EDM packages uses: actions/cache@v4 with: From 77790ad4af38fdb6fd58ec50ee6bd417219801ce Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 31 May 2025 11:22:43 +0100 Subject: [PATCH 53/59] Update edmtool.py --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 2c25ed1eb..9fd62e069 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -219,7 +219,7 @@ def install(runtime, toolkit, environment, source): "python -m build -x -n -w " + ROOT), ( "edm run -e {environment} -- " - "python -m pip install --no-deps dist/*.whl") + "python -m pip install --no-deps dist/*") ] execute(install_local, parameters) From af1216e0be78a33be45d0a2745af5cbe4742fa88 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 31 May 2025 11:38:00 +0100 Subject: [PATCH 54/59] Update edmtool.py --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 9fd62e069..fbdebde6c 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -219,7 +219,7 @@ def install(runtime, toolkit, environment, source): "python -m build -x -n -w " + ROOT), ( "edm run -e {environment} -- " - "python -m pip install --no-deps dist/*") + f"python -m pip install --no-deps {ROOT}/dist/*") ] execute(install_local, parameters) From cbcede0ab36c2d5c876d4132074e22ccc0d60723 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 31 May 2025 11:44:00 +0100 Subject: [PATCH 55/59] Update test-with-edm.yml --- .github/workflows/test-with-edm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 57614b34e..8e50f9816 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -8,6 +8,7 @@ on: pull_request env: INSTALL_EDM_VERSION: 4.1.1 + PYTHONUNBUFFERED: 1 jobs: From 26f4f70789b0b81342a8f6967e2bcd4002fd7093 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 31 May 2025 11:49:16 +0100 Subject: [PATCH 56/59] Update edmtool.py --- ci/edmtool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index fbdebde6c..e767dce2c 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -216,10 +216,10 @@ def install(runtime, toolkit, environment, source): install_local = [ ( "edm run -e {environment} -- " - "python -m build -x -n -w " + ROOT), + "python -m build -x -n -w ."), ( "edm run -e {environment} -- " - f"python -m pip install --no-deps {ROOT}/dist/*") + f"python -m pip install --no-deps ./dist/*.whl") ] execute(install_local, parameters) From 7bb825089df2f0860d8e5784fa5763d0832462c0 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 31 May 2025 12:00:00 +0100 Subject: [PATCH 57/59] Update edmtool.py --- ci/edmtool.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index e767dce2c..d7cd9b75e 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -213,16 +213,15 @@ def install(runtime, toolkit, environment, source): # No matter what happens before, always install local source again with no # dependencies or we risk testing against an released enable. - install_local = [ - ( - "edm run -e {environment} -- " - "python -m build -x -n -w ."), - ( - "edm run -e {environment} -- " - f"python -m pip install --no-deps ./dist/*.whl") - ] - execute(install_local, parameters) - + build_enable = [ + "edm run -e {environment} -- python -m build -x -n -w ."] + execute(build_enable, parameters) + whl = glob.glob(f"{ROOT}/dist/*.whl")[0] + install_enable = [( + "edm run -e {environment} -- " + f"python -m pip install --no-deps {whl}")] + execute(install_enable, parameters) + click.echo('Done install') From c014e62edeffd149ae993274dde1b46be7016771 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 31 May 2025 12:04:43 +0100 Subject: [PATCH 58/59] Update test-with-edm.yml --- .github/workflows/test-with-edm.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 8e50f9816..3aa4a93a1 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -22,9 +22,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install x11 headers - run: | - sudo apt-get install libx11-dev - sudo apt-get install libopengl0 + run: sudo apt-get install libx11-dev libopengl0 libegl1 - name: Cache EDM packages uses: actions/cache@v4 with: From 0bdf1f45bb725443bed7e0785d36106088aebdf8 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 31 May 2025 12:11:31 +0100 Subject: [PATCH 59/59] Update test-with-pip.yml --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index fe87b8ed2..4efcd7de3 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -53,7 +53,7 @@ jobs: if: matrix.os == 'macos-latest' - name: Install build dependencies run: | - python -m pip install --upgrade pip wheel + python -m pip install --upgrade pip wheel cython - name: Install local packages run: pip install ".[cairo,layout,pdf,svg,test,${{ matrix.toolkit }}]" - name: Sanity check package version