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