1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 anyqt,
11 cachecontrol,
12 commonmark,
13 dictdiffer,
14 docutils,
15 filelock,
16 lockfile,
17 numpy,
18 pip,
19 trubar,
20 qasync,
21 requests-cache,
22 typing-extensions,
23
24 # tests
25 qt5,
26 pytest-qt,
27 pytestCheckHook,
28
29 stdenv,
30 gitUpdater,
31}:
32
33buildPythonPackage rec {
34 pname = "orange-canvas-core";
35 version = "0.2.6";
36 pyproject = true;
37
38 src = fetchFromGitHub {
39 owner = "biolab";
40 repo = "orange-canvas-core";
41 tag = version;
42 hash = "sha256-cEy9ADU/jZoKmGXVlqwG+qWKZ22STjALgCb1IxAwpO0=";
43 };
44
45 build-system = [ setuptools ];
46
47 dependencies = [
48 anyqt
49 cachecontrol
50 commonmark
51 dictdiffer
52 docutils
53 filelock
54 lockfile
55 numpy
56 pip
57 qasync
58 requests-cache
59 typing-extensions
60 trubar
61 ];
62
63 pythonImportsCheck = [ "orangecanvas" ];
64
65 preCheck = ''
66 export HOME=$(mktemp -d)
67 export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
68 export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";
69 export QT_QPA_PLATFORM=offscreen
70 '';
71
72 nativeCheckInputs = [
73 pytest-qt
74 pytestCheckHook
75 ];
76
77 disabledTests = [
78 # Failed: CALL ERROR: Exceptions caught in Qt event loop
79 "test_create_new_window"
80 "test_dont_load_swp_on_new_window"
81 "test_editlinksnode"
82 "test_flattened"
83 "test_links_edit"
84 "test_links_edit_widget"
85 "test_new_window"
86 "test_toolbox"
87 "test_tooltree_registry"
88 "test_widgettoolgrid"
89 ];
90
91 passthru.updateScript = gitUpdater { };
92
93 disabledTestPaths = [ "orangecanvas/canvas/items/tests/test_graphicstextitem.py" ];
94
95 meta = {
96 description = "Orange framework for building graphical user interfaces for editing workflows";
97 homepage = "https://github.com/biolab/orange-canvas-core";
98 changelog = "https://github.com/biolab/orange-canvas-core/releases/tag/${src.tag}";
99 license = [ lib.licenses.gpl3 ];
100 maintainers = [ lib.maintainers.lucasew ];
101 # Segmentation fault during tests
102 broken = stdenv.hostPlatform.isDarwin;
103 };
104}