From 25f99265da5a11f617d80aa2c0b8cb9a2a80f392 Mon Sep 17 00:00:00 2001 From: Marcus Boyd Date: Wed, 18 Mar 2020 15:18:39 +1030 Subject: [PATCH] python3Packages.spyder-kernels: Add spyder-kernels_0_5 Previously top-level/python-packages.nix called spyder-kernels v0.5 for Py2k. Now both v0.5 and v1.8 (default.nix) are in pythonPackages, as required by cq-editor and spyder v4 respectively. v0.5 also now comes from GitHub instead of PyPi, with checks enabled. --- .../python-modules/spyder-kernels/0.x.nix | 72 +++++++++++++++++++ .../python-modules/spyder-kernels/2.nix | 30 -------- pkgs/top-level/python-packages.nix | 4 +- 3 files changed, 74 insertions(+), 32 deletions(-) create mode 100644 pkgs/development/python-modules/spyder-kernels/0.x.nix delete mode 100644 pkgs/development/python-modules/spyder-kernels/2.nix diff --git a/pkgs/development/python-modules/spyder-kernels/0.x.nix b/pkgs/development/python-modules/spyder-kernels/0.x.nix new file mode 100644 index 000000000000..c4a61520333e --- /dev/null +++ b/pkgs/development/python-modules/spyder-kernels/0.x.nix @@ -0,0 +1,72 @@ +{ + lib + , buildPythonPackage + , fetchFromGitHub + , cloudpickle + , ipykernel + , wurlitzer + , jupyter_client + , pyzmq + , numpy + , pandas + , scipy + , matplotlib + , xarray + , pytest + , flaky + , isPy3k +}: + +buildPythonPackage rec { + pname = "spyder-kernels"; + version = "0.5.2"; + + src = fetchFromGitHub { + owner = "spyder-ide"; + repo = "spyder-kernels"; + rev = "v0.5.2"; + sha256 = "1yan589g0470y61bcyjy3wj13i94ndyffckqdyrg97vw2qhfrisb"; + }; + + # requirement xarray not available on Py2k + disabled = !isPy3k; + + propagatedBuildInputs = [ + cloudpickle + ipykernel + wurlitzer + jupyter_client + pyzmq + ]; + + checkInputs = [ + numpy + pandas + scipy + matplotlib + xarray + pytest + flaky + ]; + + # skipped tests: + # turtle requires graphics + # cython test fails, I don't think this can ever access cython? + # umr pathlist test assumes standard directories, not compatible with nix + checkPhase = '' + export JUPYTER_RUNTIME_DIR=$(mktemp -d) + pytest -x -vv -k '\ + not test_turtle_launch \ + and not test_umr_skip_cython \ + and not test_umr_pathlist' \ + -W 'ignore::DeprecationWarning' \ + spyder_kernels + ''; + + meta = with lib; { + description = "Jupyter kernels for Spyder's console"; + homepage = "https://github.com/spyder-ide/spyder-kernels"; + license = licenses.mit; + maintainers = with maintainers; [ gebner marcus7070 ]; + }; +} diff --git a/pkgs/development/python-modules/spyder-kernels/2.nix b/pkgs/development/python-modules/spyder-kernels/2.nix deleted file mode 100644 index 86daec23d954..000000000000 --- a/pkgs/development/python-modules/spyder-kernels/2.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ stdenv, buildPythonPackage, fetchPypi, cloudpickle, ipykernel, wurlitzer, - jupyter_client, pyzmq }: - -buildPythonPackage rec { - pname = "spyder-kernels"; - version = "0.5.2"; - - src = fetchPypi { - inherit pname version; - sha256 = "01354b7fa180a87212cc005553b31a7300159b108d36828e301d3782291323f7"; - }; - - propagatedBuildInputs = [ - cloudpickle - ipykernel - wurlitzer - jupyter_client - pyzmq - ]; - - # No tests - doCheck = false; - - meta = with stdenv.lib; { - description = "Jupyter kernels for Spyder's console"; - homepage = "https://github.com/spyder-ide/spyder-kernels"; - license = licenses.mit; - maintainers = with maintainers; [ gebner ]; - }; -} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7d1c36f2d874..cd594153eec5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1504,8 +1504,8 @@ in { sniffio = callPackage ../development/python-modules/sniffio { }; - spyder-kernels = if isPy3k then callPackage ../development/python-modules/spyder-kernels {} - else callPackage ../development/python-modules/spyder-kernels/2.nix {}; + spyder-kernels = callPackage ../development/python-modules/spyder-kernels {}; + spyder-kernels_0_5 = callPackage ../development/python-modules/spyder-kernels/0.x.nix {}; spyder = if isPy3k then callPackage ../development/python-modules/spyder {} else callPackage ../development/python-modules/spyder/2.nix {};