1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 atomicwrites,
7 chardet,
8 cloudpickle,
9 cookiecutter,
10 diff-match-patch,
11 intervaltree,
12 jedi,
13 jellyfish,
14 keyring,
15 matplotlib,
16 nbconvert,
17 numpy,
18 numpydoc,
19 pickleshare,
20 psutil,
21 pygments,
22 pylint-venv,
23 pyls-spyder,
24 pyopengl,
25 pyqtwebengine,
26 python-lsp-black,
27 python-lsp-server,
28 pyxdg,
29 pyzmq,
30 qdarkstyle,
31 qstylizer,
32 qtawesome,
33 qtconsole,
34 qtpy,
35 rope,
36 rtree,
37 scipy,
38 setuptools,
39 spyder-kernels,
40 textdistance,
41 three-merge,
42 watchdog,
43}:
44
45buildPythonPackage rec {
46 pname = "spyder";
47 version = "5.5.4";
48 pyproject = true;
49
50 disabled = pythonOlder "3.8";
51
52 src = fetchPypi {
53 inherit pname version;
54 hash = "sha256-UiIyoFREfd3gV0uhSgZ8TVFQiP3yprrBZDOm3+8Dge0=";
55 };
56
57 patches = [ ./dont-clear-pythonpath.patch ];
58
59 build-system = [
60 pyqtwebengine.wrapQtAppsHook
61 setuptools
62 ];
63
64 dependencies = [
65 atomicwrites
66 chardet
67 cloudpickle
68 cookiecutter
69 diff-match-patch
70 intervaltree
71 jedi
72 jellyfish
73 keyring
74 matplotlib
75 nbconvert
76 numpy
77 numpydoc
78 pickleshare
79 psutil
80 pygments
81 pylint-venv
82 pyls-spyder
83 pyopengl
84 pyqtwebengine
85 python-lsp-black
86 python-lsp-server
87 pyxdg
88 pyzmq
89 qdarkstyle
90 qstylizer
91 qtawesome
92 qtconsole
93 qtpy
94 rope
95 rtree
96 scipy
97 spyder-kernels
98 textdistance
99 three-merge
100 watchdog
101 ] ++ python-lsp-server.optional-dependencies.all;
102
103 # There is no test for spyder
104 doCheck = false;
105
106 postPatch = ''
107 # Remove dependency on pyqtwebengine
108 # This is still part of the pyqt 5.11 version we have in nixpkgs
109 sed -i /pyqtwebengine/d setup.py
110 substituteInPlace setup.py \
111 --replace "qdarkstyle>=3.0.2,<3.1.0" "qdarkstyle" \
112 --replace "ipython>=7.31.1,<8.0.0" "ipython"
113 '';
114
115 postInstall = ''
116 # Add Python libs to env so Spyder subprocesses
117 # created to run compute kernels don't fail with ImportErrors
118 wrapProgram $out/bin/spyder --prefix PYTHONPATH : "$PYTHONPATH"
119 '';
120
121 dontWrapQtApps = true;
122
123 preFixup = ''
124 makeWrapperArgs+=("''${qtWrapperArgs[@]}")
125 '';
126
127 meta = with lib; {
128 description = "Scientific python development environment";
129 mainProgram = "spyder";
130 longDescription = ''
131 Spyder (previously known as Pydee) is a powerful interactive development
132 environment for the Python language with advanced editing, interactive
133 testing, debugging and introspection features.
134 '';
135 homepage = "https://www.spyder-ide.org/";
136 downloadPage = "https://github.com/spyder-ide/spyder/releases";
137 changelog = "https://github.com/spyder-ide/spyder/blob/master/CHANGELOG.md";
138 license = licenses.mit;
139 maintainers = with maintainers; [ gebner ];
140 platforms = platforms.linux;
141 };
142}