summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/orange-canvas-core/default.nix
blob: 7b496befe1f4594083ac908476b055a6c0952ce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  trubar,

  # dependencies
  anyqt,
  cachecontrol,
  commonmark,
  dictdiffer,
  docutils,
  filelock,
  lockfile,
  numpy,
  packaging,
  pip,
  qasync,
  requests,
  requests-cache,
  truststore,
  typing-extensions,

  # tests
  qt5,
  pytest-qt,
  pytestCheckHook,

  stdenv,
  gitUpdater,
}:

buildPythonPackage rec {
  pname = "orange-canvas-core";
  version = "0.2.6";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "biolab";
    repo = "orange-canvas-core";
    tag = version;
    hash = "sha256-cEy9ADU/jZoKmGXVlqwG+qWKZ22STjALgCb1IxAwpO0=";
  };

  build-system = [
    setuptools
    trubar
  ];

  dependencies = [
    anyqt
    commonmark
    dictdiffer
    docutils
    filelock
    lockfile
    numpy
    packaging
    pip
    qasync
    requests
    requests-cache
    truststore
    typing-extensions
  ];

  pythonImportsCheck = [ "orangecanvas" ];

  preCheck = ''
    export HOME=$(mktemp -d)
    export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
    export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";
    export QT_QPA_PLATFORM=offscreen
  '';

  nativeCheckInputs = [
    pytest-qt
    pytestCheckHook
  ];

  disabledTests = [
    # Failed: CALL ERROR: Exceptions caught in Qt event loop
    "test_create_new_window"
    "test_dont_load_swp_on_new_window"
    "test_editlinksnode"
    "test_flattened"
    "test_links_edit"
    "test_links_edit_widget"
    "test_new_window"
    "test_toolbox"
    "test_tooltree_registry"
    "test_widgettoolgrid"
  ];

  passthru.updateScript = gitUpdater { };

  disabledTestPaths = [ "orangecanvas/canvas/items/tests/test_graphicstextitem.py" ];

  meta = {
    description = "Orange framework for building graphical user interfaces for editing workflows";
    homepage = "https://github.com/biolab/orange-canvas-core";
    changelog = "https://github.com/biolab/orange-canvas-core/releases/tag/${src.tag}";
    license = [ lib.licenses.gpl3 ];
    maintainers = [ ];
    # Segmentation fault during tests
    broken = stdenv.hostPlatform.isDarwin;
  };
}