Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09 2.6 kB view raw
1{ stdenv, buildPythonPackage, fetchPypi, isPy27, makeDesktopItem, intervaltree, jedi, pycodestyle, 2 psutil, pyflakes, rope, numpy, scipy, matplotlib, pylint, keyring, numpydoc, 3 qtconsole, qtawesome, nbconvert, mccabe, pyopengl, cloudpickle, pygments, 4 spyder-kernels, qtpy, pyzmq, chardet, qdarkstyle, watchdog, python-language-server 5, pyqtwebengine, atomicwrites, pyxdg, diff-match-patch 6}: 7 8buildPythonPackage rec { 9 pname = "spyder"; 10 version = "4.1.4"; 11 12 disabled = isPy27; 13 14 src = fetchPypi { 15 inherit pname version; 16 sha256 = "6946b2128afaf1b64e878a74d33f9abd60c91f75949b3d05f305b3c3f5fec1e2"; 17 }; 18 19 nativeBuildInputs = [ pyqtwebengine.wrapQtAppsHook ]; 20 21 propagatedBuildInputs = [ 22 intervaltree jedi pycodestyle psutil pyflakes rope numpy scipy matplotlib pylint keyring 23 numpydoc qtconsole qtawesome nbconvert mccabe pyopengl cloudpickle spyder-kernels 24 pygments qtpy pyzmq chardet pyqtwebengine qdarkstyle watchdog python-language-server 25 atomicwrites pyxdg diff-match-patch 26 ]; 27 28 # There is no test for spyder 29 doCheck = false; 30 31 desktopItem = makeDesktopItem { 32 name = "Spyder"; 33 exec = "spyder"; 34 icon = "spyder"; 35 comment = "Scientific Python Development Environment"; 36 desktopName = "Spyder"; 37 genericName = "Python IDE"; 38 categories = "Development;IDE;"; 39 }; 40 41 postPatch = '' 42 # remove dependency on pyqtwebengine 43 # this is still part of the pyqt 5.11 version we have in nixpkgs 44 sed -i /pyqtwebengine/d setup.py 45 substituteInPlace setup.py \ 46 --replace "pyqt5<5.13" "pyqt5" \ 47 --replace "parso==0.7.0" "parso" \ 48 --replace "jedi==0.17.1" "jedi" 49 ''; 50 51 postInstall = '' 52 # add Python libs to env so Spyder subprocesses 53 # created to run compute kernels don't fail with ImportErrors 54 wrapProgram $out/bin/spyder3 --prefix PYTHONPATH : "$PYTHONPATH" 55 56 # Create desktop item 57 mkdir -p $out/share/icons 58 cp spyder/images/spyder.svg $out/share/icons 59 cp -r $desktopItem/share/applications/ $out/share 60 ''; 61 62 dontWrapQtApps = true; 63 64 preFixup = '' 65 makeWrapperArgs+=("''${qtWrapperArgs[@]}") 66 ''; 67 68 meta = with stdenv.lib; { 69 description = "Scientific python development environment"; 70 longDescription = '' 71 Spyder (previously known as Pydee) is a powerful interactive development 72 environment for the Python language with advanced editing, interactive 73 testing, debugging and introspection features. 74 ''; 75 homepage = "https://github.com/spyder-ide/spyder/"; 76 license = licenses.mit; 77 platforms = platforms.linux; 78 maintainers = with maintainers; [ gebner ]; 79 }; 80}