File tree Expand file tree Collapse file tree 5 files changed +9
-5
lines changed
.github/actions/install-qt-support Expand file tree Collapse file tree 5 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 20
20
sudo apt-get install libxcb-render-util0
21
21
sudo apt-get install libxcb-xinerama0
22
22
sudo apt-get install libxcb-shape0
23
+ sudo apt-get install libxcb-cursor0
23
24
sudo apt-get install pulseaudio
24
25
sudo apt-get install libpulse-mainloop-glib0
25
26
# Needed to work around https://bugreports.qt.io/browse/PYSIDE-1547
Original file line number Diff line number Diff line change 95
95
"importlib_resources>=1.1.0" ,
96
96
"traits" + TRAITS_VERSION_REQUIRES ,
97
97
"traitsui" ,
98
- "numpy" ,
99
98
"pygments" ,
100
99
"coverage" ,
101
100
"flake8" ,
112
111
)
113
112
if b'AVX2' in result .stdout .split ():
114
113
dependencies .add ('pillow_simd' )
114
+ dependencies .add ('numpy' )
115
115
else :
116
116
dependencies .add ('pillow_simd' )
117
+ dependencies .add ('numpy' )
117
118
118
119
119
120
source_dependencies = {
Original file line number Diff line number Diff line change @@ -259,16 +259,17 @@ def __getattr__(name):
259
259
result = toolkit_object (f"{ source } :{ name } " )
260
260
261
261
elif name in _optional_imports :
262
+ from importlib import import_module
262
263
import logging
263
- from pyface .toolkit import toolkit_object
264
264
from pyface .util ._optional_dependencies import optional_import
265
265
dependency , source = _optional_imports [name ]
266
266
with optional_import (
267
267
dependency ,
268
268
msg = f"{ name } is not available due to missing { dependency } ." ,
269
269
logger = logging .getLogger (__name__ ),
270
270
):
271
- result = toolkit_object (f"{ source } :{ name } " )
271
+ module = import_module (f"pyface.{ source } " )
272
+ result = getattr (module , name )
272
273
273
274
if result is not_found :
274
275
raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def test_public_attrs(self):
33
33
attrs = [
34
34
name
35
35
for name in dir (api )
36
- if not name .startswith ('_' ) or name in api ._optional_imports
36
+ if not ( name .startswith ('_' ) or name in api ._optional_imports )
37
37
]
38
38
for attr in attrs :
39
39
with self .subTest (attr = attr ):
Original file line number Diff line number Diff line change 13
13
14
14
from traits .testing .optional_dependencies import numpy as np , requires_numpy
15
15
16
- from ..array_image import ArrayImage
16
+ if np is not None :
17
+ from ..array_image import ArrayImage
17
18
18
19
19
20
@requires_numpy
You can’t perform that action at this time.
0 commit comments