nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 pythonAtLeast,
6 fetchFromGitHub,
7
8 # build-system
9 setuptools,
10
11 # dependencies
12 distutils,
13 h5py,
14 numpy,
15 qtpy,
16 requests,
17 tomli,
18
19 # tests
20 pytestCheckHook,
21 qt6,
22 pyqt6,
23
24 # passthru.tests
25 guidata,
26 pyside6,
27 qt5,
28 pyqt5,
29 pyside2,
30}:
31
32buildPythonPackage rec {
33 pname = "guidata";
34 version = "3.14.2";
35 pyproject = true;
36
37 src = fetchFromGitHub {
38 owner = "PlotPyStack";
39 repo = "guidata";
40 tag = "v${version}";
41 hash = "sha256-iUfZX51Ef1PY7roy9ER8hG34BAhCLs3Sagoasd5BT3E=";
42 };
43
44 # https://github.com/PlotPyStack/guidata/issues/97
45 disabled = pythonAtLeast "3.14";
46
47 build-system = [
48 setuptools
49 ];
50
51 dependencies = [
52 distutils
53 h5py
54 numpy
55 qtpy
56 requests
57 tomli
58 ];
59
60 nativeCheckInputs = [
61 pytestCheckHook
62 # Not propagating this, to allow one to choose to choose a pyqt / pyside
63 # implementation.
64 pyqt6
65 ];
66
67 preCheck = ''
68 export QT_PLUGIN_PATH="${lib.getBin qt6.qtbase}/${qt6.qtbase.qtPluginPrefix}"
69 export QT_QPA_PLATFORM=offscreen
70 '';
71
72 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
73 # Fatal Python error: Segmentation fault
74 # guidata/dataset/qtitemwidgets.py", line 633 in __init__
75 "test_all_items"
76 "test_loadsave_hdf5"
77 "test_loadsave_json"
78 # guidata/dataset/qtitemwidgets.py", line 581 in __init__
79 "test_editgroupbox"
80 "test_item_order"
81 # guidata/qthelpers.py", line 710 in exec_dialog
82 "test_arrayeditor"
83 ];
84
85 pythonImportsCheck = [ "guidata" ];
86
87 passthru = {
88 tests = {
89 withPyQt6 = guidata.override {
90 pyqt6 = pyqt6;
91 qt6 = qt6;
92 };
93 withPySide6 = guidata.override {
94 pyqt6 = pyside6;
95 qt6 = qt6;
96 };
97 withPyQt5 = guidata.override {
98 pyqt6 = pyqt5;
99 qt6 = qt5;
100 };
101 };
102 # Upstream doesn't officially supports all of them, although they use qtpy,
103 # see: https://github.com/PlotPyStack/PlotPy/issues/20 . See also the
104 # comment near this attribute at plotpy
105 knownFailingTests = {
106 withPySide2 = guidata.override {
107 pyqt6 = pyside2;
108 qt6 = qt5;
109 };
110 };
111 };
112
113 meta = {
114 description = "Python library generating graphical user interfaces for easy dataset editing and display";
115 homepage = "https://github.com/PlotPyStack/guidata";
116 changelog = "https://github.com/PlotPyStack/guidata/blob/${src.tag}/CHANGELOG.md";
117 license = lib.licenses.bsd3;
118 maintainers = with lib.maintainers; [ doronbehar ];
119 };
120}