1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, scipy
6, numpy
7, pyqt5
8, pyopengl
9, qt5
10, pytestCheckHook
11, freefont_ttf
12, makeFontsConf
13, setuptools
14}:
15
16let
17 fontsConf = makeFontsConf {
18 fontDirectories = [ freefont_ttf ];
19 };
20in
21buildPythonPackage rec {
22 pname = "pyqtgraph";
23 version = "0.13.3";
24 format = "pyproject";
25
26 src = fetchFromGitHub {
27 owner = "pyqtgraph";
28 repo = "pyqtgraph";
29 rev = "refs/tags/pyqtgraph-${version}";
30 hash = "sha256-kFTNhv8pgIRSJX0ePmp1I0+MGfCaW8b86baIYZ2bZQM=";
31 };
32
33 nativeBuildInputs = [
34 setuptools
35 ];
36
37 propagatedBuildInputs = [
38 numpy
39 pyqt5
40 scipy
41 pyopengl
42 ];
43
44 nativeCheckInputs = [ pytestCheckHook ];
45
46 preCheck = ''
47 export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
48 export QT_QPA_PLATFORM=offscreen
49 export DYLD_FRAMEWORK_PATH=/System/Library/Frameworks
50 export FONTCONFIG_FILE=${fontsConf}
51 '';
52
53 pytestFlagsArray = [
54 # we only want to run unittests
55 "tests"
56 ];
57
58 disabledTests = lib.optionals (!stdenv.hostPlatform.isx86) [
59 # small precision-related differences on other architectures,
60 # upstream doesn't consider it serious.
61 # https://github.com/pyqtgraph/pyqtgraph/issues/2110
62 "test_PolyLineROI"
63 ] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
64 # https://github.com/pyqtgraph/pyqtgraph/issues/2645
65 "test_rescaleData"
66 ];
67
68 meta = with lib; {
69 description = "Scientific Graphics and GUI Library for Python";
70 homepage = "https://www.pyqtgraph.org/";
71 changelog = "https://github.com/pyqtgraph/pyqtgraph/blob/master/CHANGELOG";
72 license = licenses.mit;
73 platforms = platforms.unix;
74 maintainers = with maintainers; [ koral ];
75 };
76
77}