enthought / enthought/enable

Cannot build/install enable (kiva) on macOS Ventura using macports python 3.10

Open
#1,006 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
97
Forks
45
PR merge metrics
No merged PRs in 30d

Description

There seems to be an issue with macOS SDK compatibility when trying to install enable 5.3.1 in a fresh virtualenv if using the macports supplied python 3.10.9. I'm successful using Apples python 3.9 that ships as part of the Xcode commandline tools, though.

A similar issue seems to apply to other open source projects (I found https://trac.macports.org/ticket/66095), where a proposed solution was to set the macos deployment target to 12.0. Not sure if that is desired here – instead, it might be necessary to make kiva build against current, non-deprecated APIs.

Here is how it looks using Apple's python 3.9:
```shell
mark@marks-laptop /tmp % python3.9 --version
Python 3.9.16
mark@marks-laptop /tmp % python3.9 -m venv venv39
mark@marks-laptop /tmp % source venv39/bin/activate
(venv39) mark@marks-laptop /tmp % python -m pip install --upgrade pip wheel
Requirement already satisfied: pip in ./venv39/lib/python3.9/site-packages (22.0.4)
Collecting pip
Using cached pip-22.3.1-py3-none-any.whl (2.1 MB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: wheel, pip
Attempting uninstall: pip
Found existing installation: pip 22.0.4
Uninstalling pip-22.0.4:
Successfully uninstalled pip-22.0.4
Successfully installed pip-22.3.1 wheel-0.38.4
(venv39) mark@marks-laptop /tmp % python -m pip install enable
Collecting enable
Using cached enable-5.3.1-cp39-cp39-macosx_10_9_universal2.whl
Collecting numpy
Using cached numpy-1.24.1-cp39-cp39-macosx_10_9_x86_64.whl (19.8 MB)
Collecting pyface>=7.2.0
Using cached pyface-7.4.4-py3-none-any.whl (1.3 MB)
Collecting fonttools
Using cached fonttools-4.38.0-py3-none-any.whl (965 kB)
Collecting traitsui
Using cached traitsui-7.4.2-py3-none-any.whl (1.5 MB)
Collecting pillow
Using cached Pillow-9.4.0-1-cp39-cp39-macosx_10_10_x86_64.whl (3.3 MB)
Collecting traits>=6.2.0
Using cached traits-6.4.1-cp39-cp39-macosx_10_9_x86_64.whl (5.0 MB)
Installing collected packages: traits, pillow, numpy, fonttools, pyface, traitsui, enable
Successfully installed enable-5.3.1 fonttools-4.38.0 numpy-1.24.1 pillow-9.4.0 pyface-7.4.4 traits-6.4.1 traitsui-7.4.2
```

Here is how it looks using macports' python 3.10:
```shell
mark@marks-laptop /tmp % python3.10 --version
Python 3.10.9
mark@marks-laptop /tmp % python3.10 -m venv venv310
mark@marks-laptop /tmp % source venv310/bin/activate
(venv310) mark@marks-laptop /tmp % python -m pip install --upgrade pip wheel
Requirement already satisfied: pip in ./venv310/lib/python3.10/site-packages (22.3.1)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: wheel
Successfully installed wheel-0.38.4
(venv310) mark@marks-laptop /tmp % python -m pip install enable
Collecting enable
Using cached enable-5.3.1.tar.gz (3.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy
Using cached numpy-1.24.1-cp310-cp310-macosx_10_9_x86_64.whl (19.8 MB)
Collecting traits>=6.2.0
Using cached traits-6.4.1-cp310-cp310-macosx_10_9_x86_64.whl (5.0 MB)
Collecting traitsui
Using cached traitsui-7.4.2-py3-none-any.whl (1.5 MB)
Collecting pillow
Using cached Pillow-9.4.0-1-cp310-cp310-macosx_10_10_x86_64.whl (3.3 MB)
Collecting fonttools
Using cached fonttools-4.38.0-py3-none-any.whl (965 kB)
Collecting pyface>=7.2.0
Using cached pyface-7.4.4-py3-none-any.whl (1.3 MB)
Building wheels for collected packages: enable
Building wheel for enable (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for enable (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [1319 lines of output]
running bdist_wheel
running build
running build_ext
cythoning kiva/_cython_speedups.pyx to kiva/_cython_speedups.cpp
/private/var/folders/33/gn8vzx7s65l6h13k8hj_gsqh0000gn/T/pip-build-env-wqufj7gj/overlay/lib/python3.10/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/33/gn8vzx7s65l6h13k8hj_gsqh0000gn/T/pip-install-wbn1_e7w/enable_47fafbf6ca474944b64c21ed41aed38c/kiva/_cython_speedups.pyx
tree = Parsing.p_module(s, pxd, full_module_name)

[...]

/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -DNUMPY -DPY_ARRAY_TYPES_PREFIX=NUMPY_CXX -DOWN_DIMENSIONS=0 -DOWN_STRIDES=0 -DFT2_BUILD_LIBRARY -D__DARWIN__ -I/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Headers -I/private/var/folders/33/gn8vzx7s65l6h13k8hj_gsqh0000gn/T/pip-build-env-wqufj7gj/overlay/lib/python3.10/site-packages/numpy/core/include -Ikiva/agg/src -Ikiva/agg/agg-24/include -Ikiva/agg/agg-24/font_freetype -Ikiva/agg/freetype2/src -Ikiva/agg/freetype2/include -Ikiva/agg/freetype2/src/autofit -Ikiva/agg/freetype2/src/base -Ikiva/agg/freetype2/src/bdf -Ikiva/agg/freetype2/src/cache -Ikiva/agg/freetype2/src/cff -Ikiva/agg/freetype2/src/cid -Ikiva/agg/freetype2/src/gxvalid -Ikiva/agg/freetype2/src/gzip -Ikiva/agg/freetype2/src/lzw -Ikiva/agg/freetype2/src/otvalid -Ikiva/agg/freetype2/src/pcf -Ikiva/agg/freetype2/src/pfr -Ikiva/agg/freetype2/src/psaux -Ikiva/agg/freetype2/src/pshinter -Ikiva/agg/freetype2/src/psnames -Ikiva/agg/freetype2/src/raster -Ikiva/agg/freetype2/src/sfnt -Ikiva/agg/freetype2/src/smooth -Ikiva/agg/freetype2/src/tools -Ikiva/agg/freetype2/src/truetype -Ikiva/agg/freetype2/src/type1 -Ikiva/agg/freetype2/src/type42 -Ikiva/agg/freetype2/src/winfonts -I/private/tmp/venv310/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c kiva/agg/freetype2/src/base/ftbase.c -o build/temp.macosx-13.0-x86_64-cpython-310/kiva/agg/freetype2/src/base/ftbase.o
In file included from kiva/agg/freetype2/src/base/ftbase.c:29:
kiva/agg/freetype2/src/base/ftobjs.c:748:27: warning: address of 'internal->transform_matrix' will always evaluate to 'true' [-Wpointer-bool-conversion]
if ( &internal->transform_matrix )
~~ ~~~~~~~~~~^~~~~~~~~~~~~~~~
kiva/agg/freetype2/src/base/ftobjs.c:752:27: warning: address of 'internal->transform_delta' will always evaluate to 'true' [-Wpointer-bool-conversion]
if ( &internal->transform_delta )
~~ ~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from kiva/agg/freetype2/src/base/ftbase.c:38:
kiva/agg/freetype2/src/base/ftmac.c:150:11: error: implicit declaration of function 'ATSFontGetFileReference' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
err = ATSFontGetFileReference( ats_font_id, ats_font_ref );
^
kiva/agg/freetype2/src/base/ftmac.c:150:11: note: did you mean 'FT_ATSFontGetFileReference'?
kiva/agg/freetype2/src/base/ftmac.c:142:3: note: 'FT_ATSFontGetFileReference' declared here
FT_ATSFontGetFileReference( ATSFontRef ats_font_id,
^
kiva/agg/freetype2/src/base/ftmac.c:186:19: error: 'ATSFontFindFromName' is unavailable
ats_font_id = ATSFontFindFromName( cf_fontName,
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h:811:1: note: 'ATSFontFindFromName' has been explicitly marked unavailable here
ATSFontFindFromName(
^

[...]

39 warnings and 2 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for enable
Failed to build enable
ERROR: Could not build wheels for enable, which is required to install pyproject.toml-based projects
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.