Skip to content

Fix build issues with enable #1070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bb041da
Enable building with Cython > 3
itziakos Feb 1, 2025
ac33f62
Convert to relative import
itziakos Feb 1, 2025
c29bf99
Fix support for recent swig
itziakos Feb 1, 2025
d1f9109
Update code to work with Cython 3
itziakos Feb 1, 2025
958c957
Fix cdef for dims
itziakos Feb 1, 2025
b11f263
One more place for integer division
itziakos Feb 1, 2025
6551ebb
No need to add pxi include files to the Cython sources
itziakos Feb 1, 2025
ef5c9a9
Do not build on macos-latest using pyside2
itziakos Feb 1, 2025
14be4f6
Reduce the number of builds while we debug the build issues
itziakos Feb 1, 2025
e37b8ed
Support both numpy 1.x and 2.x
itziakos Feb 1, 2025
9da7812
Use the compatibility module
itziakos Feb 1, 2025
a6f8880
Try to fix ImportError from numpy
itziakos Feb 1, 2025
5f54ee0
Better fix for the import_array issue
itziakos Feb 1, 2025
db9559d
More places to use import_array
itziakos Feb 1, 2025
6850716
Need to build with numpy > 2
itziakos Feb 1, 2025
2ca5a7e
Use oldest-supported-numpy
itziakos Mar 15, 2025
73dd4d6
Use older number for Python 3.8 and numpy > 2 for later
itziakos Mar 15, 2025
d05e6a3
Force c++14 for the agg extension
itziakos Mar 29, 2025
7c225a2
Do not use the deprecated numpy api
itziakos Mar 29, 2025
247a89a
pass the extra compile options to the agg extension
itziakos Mar 29, 2025
f0e143e
No need to add more compile args
itziakos Mar 29, 2025
a8c7f61
Use more current numpy api (works with both 1.20.x and 2.x)
itziakos Apr 5, 2025
0b7d4fb
Update test-with-edm.yml
itziakos Apr 12, 2025
1cf2dca
Update test-with-pip.yml
itziakos Apr 12, 2025
1e76033
Update bleeding-edge.yml
itziakos Apr 12, 2025
19e1976
Update test-with-edm.yml
itziakos Apr 12, 2025
a8d099b
Update test-with-edm.yml
itziakos Apr 12, 2025
e2c6228
Update ci code to work with 3.11 on edm
itziakos Apr 12, 2025
0b91de8
fix typo
itziakos Apr 12, 2025
8d0a849
In 3.11 edm we only have pillow
itziakos Apr 12, 2025
c0db6e1
Add missing requirements file
itziakos Apr 12, 2025
59158c6
Use the right configuration to install wx
itziakos Apr 12, 2025
9126716
Provide the platform option in edm to fix linux testing
itziakos Apr 12, 2025
20db70a
add missing import
itziakos Apr 12, 2025
3284f1b
Disable interactive mode when installing wxpython
itziakos Apr 12, 2025
05cd869
Update test-with-pip.yml
itziakos Apr 12, 2025
8f3a34f
Update test-with-pip.yml
itziakos Apr 12, 2025
641de31
Update test-with-pip.yml
itziakos Apr 12, 2025
7a64fda
Fix CGFunctionEvaluateCallback signature
itziakos Apr 12, 2025
6d8475e
Do not try to install celiagg
itziakos Apr 19, 2025
ba6a4cd
Update signature for callback functions
itziakos Apr 26, 2025
a974077
Run tests on all platforms
itziakos May 10, 2025
c984194
Remove 3.6 and 3.8 builds from the EDM testing
itziakos May 17, 2025
02c97cb
Test the wx widget on EDM linux environments
itziakos May 17, 2025
53270d3
Update installed apt packages
itziakos May 17, 2025
7f95aaa
Update EDM testing
itziakos May 17, 2025
c5da416
Add the system usr/include folders for the agg compile
itziakos May 24, 2025
fce668e
Update edmtool
itziakos May 24, 2025
e54cfb8
Fix variable name
itziakos May 29, 2025
61c20d0
install local is already a list
itziakos May 29, 2025
e199db2
Add missing space in the command line
itziakos May 29, 2025
17b59d3
Update test-with-edm.yml
itziakos May 29, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/bleeding-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/test-with-edm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,30 @@ name: Test with EDM
on: pull_request

env:
INSTALL_EDM_VERSION: 3.5.0
INSTALL_EDM_VERSION: 4.1.1

jobs:

# Test against EDM packages on Linux
test-edm-linux:
strategy:
matrix:
toolkit: ['null', 'pyside6']
runtime: ['3.8']
toolkit: ['null', 'pyside6', 'wx']
runtime: ['3.11']
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Install Qt dependencies
uses: ./.github/actions/install-qt-support
if: matrix.toolkit != 'wx'
- uses: actions/checkout@v4
- name: Install x11 headers
run: |
sudo apt-get install libx11-dev
sudo apt-get install libopengl0
- 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@v4.1
with:
edm-version: ${{ env.INSTALL_EDM_VERSION }}
- name: Install click to the default EDM environment
Expand All @@ -46,7 +47,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
Expand All @@ -55,14 +56,14 @@ 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') }}
- 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
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/test-with-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,28 @@ on:
jobs:
test-ets:
strategy:
fail-fast: false
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:
# 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'
# No PySide2 wheels for macos-latest
- os: 'macos-latest'
toolkit: 'wx'
toolkit: 'pyside2'
# Kiva tests hanging on windows, see #1038
- os: 'windows-latest'
toolkit: 'pyqt5'
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:
Expand All @@ -59,7 +55,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)
Expand Down
74 changes: 24 additions & 50 deletions ci/edmtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

import glob
import os
import platform
import subprocess
import sys
from shutil import rmtree, copy as copyfile
Expand All @@ -85,12 +86,16 @@
import click

supported_combinations = {
'3.6': {'pyside2', 'pyqt5', 'wx', 'null'},
'3.8': {'pyside6', 'pyqt6', 'wx', 'null'},
'3.11': {'pyside6', 'pyqt6', 'wx', 'null'},
}

platforms = {
('3.11', 'Linux') : 'rh8_x86_64',
('3.11', 'Windows') : 'win_x86_64',
('3.11', 'Darwin') : 'osx_x86_64'}

dependencies = {
'3.6': {
'3.11': {
"apptools",
"celiagg",
"coverage",
Expand All @@ -102,27 +107,11 @@
"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",
"build",
"reportlab",
}
}

Expand All @@ -137,19 +126,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'},
Expand Down Expand Up @@ -177,7 +161,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(
Expand All @@ -195,28 +179,13 @@ 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"
" --no-dependencies"),
]

if toolkit == "wx":
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"
)

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

Expand Down Expand Up @@ -244,11 +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} -- "
"pip install --force-reinstall --no-dependencies " + ROOT
)
execute([install_local], parameters)
install_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')

Expand Down Expand Up @@ -477,7 +450,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

Expand Down
1 change: 0 additions & 1 deletion ci/requirements_3.8.txt → ci/requirements_3.11.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pypdf2<3.0
reportlab
2 changes: 0 additions & 2 deletions ci/requirements_3.6.txt

This file was deleted.

7 changes: 5 additions & 2 deletions kiva/_cython_speedups.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions kiva/_marker_renderer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
# 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

cimport _marker_renderer
from numpy cimport uint8_t, import_array
cimport cython
from . cimport _marker_renderer

import_array()

ctypedef _marker_renderer.marker_renderer_base renderer_base_t

Expand Down
Loading
Loading