1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 numpy,
11 qtpy,
12
13 # tests
14 pyqt6,
15 qt6,
16 pytestCheckHook,
17}:
18
19buildPythonPackage rec {
20 pname = "pythonqwt";
21 version = "0.14.6";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "PlotPyStack";
26 repo = "PythonQwt";
27 tag = "v${version}";
28 hash = "sha256-D7iZ/737x+f63clnH41S8DtmBXDMf01A04UBKsHTJwA=";
29 };
30
31 build-system = [
32 setuptools
33 ];
34
35 dependencies = [
36 qtpy
37 numpy
38 ];
39 nativeCheckInputs = [
40 pytestCheckHook
41 # Not propagating this, to allow one to choose to either choose a pyqt /
42 # pyside implementation
43 pyqt6
44 ];
45
46 preCheck = ''
47 export QT_PLUGIN_PATH="${lib.getBin qt6.qtbase}/${qt6.qtbase.qtPluginPrefix}"
48 export QT_QPA_PLATFORM=offscreen
49 '';
50
51 pythonImportsCheck = [ "qwt" ];
52
53 meta = {
54 description = "Qt plotting widgets for Python (pure Python reimplementation of Qwt C++ library)";
55 homepage = "https://github.com/PlotPyStack/PythonQwt";
56 changelog = "https://github.com/PlotPyStack/PythonQwt/blob/${src.tag}/CHANGELOG.md";
57 license = lib.licenses.lgpl21Only;
58 maintainers = with lib.maintainers; [ doronbehar ];
59 };
60}