diff --git a/pkgs/development/python-modules/jupyter-packaging/default.nix b/pkgs/development/python-modules/jupyter-packaging/default.nix new file mode 100644 index 000000000000..fdc28f08ef4b --- /dev/null +++ b/pkgs/development/python-modules/jupyter-packaging/default.nix @@ -0,0 +1,38 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, packaging +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "jupyter-packaging"; + version = "0.7.12"; + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-sUAyV3GIGn33t/LRSZe2GQY/51rnVrkCWFLkNGAAu7g="; + }; + + propagatedBuildInputs = [ packaging ]; + + checkInputs = [ pytestCheckHook ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + # disable tests depending on network connection + disabledTests = [ "test_develop" "test_install" ]; + + pythonImportsCheck = [ "jupyter_packaging" ]; + + meta = with lib; { + description = "Jupyter Packaging Utilities"; + homepage = "https://github.com/jupyter/jupyter-packaging"; + license = licenses.bsd3; + maintainers = [ maintainers.elohmeier ]; + }; +} diff --git a/pkgs/development/python-modules/jupyter_server/default.nix b/pkgs/development/python-modules/jupyter_server/default.nix new file mode 100644 index 000000000000..a9f98781b4fb --- /dev/null +++ b/pkgs/development/python-modules/jupyter_server/default.nix @@ -0,0 +1,75 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, pytestCheckHook +, pytest-tornasync +, jinja2 +, tornado +, pyzmq +, ipython_genutils +, traitlets +, jupyter_core +, jupyter_client +, nbformat +, nbconvert +, send2trash +, terminado +, prometheus_client +, anyio +, requests +}: + +buildPythonPackage rec { + pname = "jupyter_server"; + version = "1.4.1"; + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-sBJvI39nlTPuxGJEz8ZtYeOh+OwPrS1HNS+hnT51Tkc="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "anyio>=2.0.2" "anyio" + ''; + + propagatedBuildInputs = [ + jinja2 + tornado + pyzmq + ipython_genutils + traitlets + jupyter_core + jupyter_client + nbformat + nbconvert + send2trash + terminado + prometheus_client + anyio + ]; + + checkInputs = [ + pytestCheckHook + pytest-tornasync + requests + ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + pytestFlagsArray = [ "jupyter_server/tests/" ]; + + # disabled failing tests + disabledTests = [ "test_server_extension_list" "test_list_formats" "test_base_url" ]; + + meta = with lib; { + description = "The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications."; + homepage = "https://github.com/jupyter-server/jupyter_server"; + license = licenses.bsdOriginal; + maintainers = [ maintainers.elohmeier ]; + }; +} diff --git a/pkgs/development/python-modules/jupyterlab/default.nix b/pkgs/development/python-modules/jupyterlab/default.nix index ff725ce18297..81ad668db08f 100644 --- a/pkgs/development/python-modules/jupyterlab/default.nix +++ b/pkgs/development/python-modules/jupyterlab/default.nix @@ -4,19 +4,21 @@ , jupyterlab_server , notebook , pythonOlder +, jupyter-packaging +, nbclassic }: buildPythonPackage rec { pname = "jupyterlab"; - version = "2.2.9"; + version = "3.0.11"; disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; - sha256 = "3be8f8edea173753dd838c1b6d3bbcb6f5c801121f824a477025c1b6a1d33dc6"; + sha256 = "sha256-zkz08xFjzlGu0BPAGoV8BdQ6k8Ru1pAWbkhkT255R94="; }; - propagatedBuildInputs = [ jupyterlab_server notebook ]; + propagatedBuildInputs = [ jupyterlab_server notebook jupyter-packaging nbclassic ]; makeWrapperArgs = [ "--set" "JUPYTERLAB_DIR" "$out/share/jupyter/lab" diff --git a/pkgs/development/python-modules/jupyterlab_server/default.nix b/pkgs/development/python-modules/jupyterlab_server/default.nix index 3d9b5b9f831b..c110cc0590fe 100644 --- a/pkgs/development/python-modules/jupyterlab_server/default.nix +++ b/pkgs/development/python-modules/jupyterlab_server/default.nix @@ -1,34 +1,45 @@ { lib , buildPythonPackage , fetchPypi -, notebook , jsonschema , pythonOlder , requests -, pytest +, pytestCheckHook , pyjson5 +, Babel +, jupyter_server +, pytest-tornasync +, pytestcov +, strict-rfc3339 }: buildPythonPackage rec { pname = "jupyterlab_server"; - version = "1.2.0"; + version = "2.3.0"; disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; - sha256 = "5431d9dde96659364b7cc877693d5d21e7b80cea7ae3959ecc2b87518e5f5d8c"; + sha256 = "sha256-56AkWqPeI6GAPeLv9AHkykWUU42fWYBhNPMEGabYtqM="; }; - checkInputs = [ requests pytest ]; - propagatedBuildInputs = [ notebook jsonschema pyjson5 ]; + propagatedBuildInputs = [ requests jsonschema pyjson5 Babel jupyter_server ]; - # test_listing test fails - # this is a new package and not all tests pass - doCheck = false; + checkInputs = [ + pytestCheckHook + pytest-tornasync + pytestcov + strict-rfc3339 + ]; - checkPhase = '' - pytest - ''; + disabledTests = [ + "test_get_locale" + "test_get_installed_language_pack_locales_passes" + "test_get_installed_package_locales" + "test_get_installed_packages_locale" + "test_get_language_packs" + "test_get_language_pack" + ]; meta = with lib; { description = "JupyterLab Server"; diff --git a/pkgs/development/python-modules/nbclassic/default.nix b/pkgs/development/python-modules/nbclassic/default.nix new file mode 100644 index 000000000000..3644b4e48dd7 --- /dev/null +++ b/pkgs/development/python-modules/nbclassic/default.nix @@ -0,0 +1,37 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, notebook +, pythonOlder +, jupyter_server +, pytestCheckHook +, pytest-tornasync +}: + +buildPythonPackage rec { + pname = "nbclassic"; + version = "0.2.6"; + disabled = pythonOlder "3.5"; + + # tests only on github + src = fetchFromGitHub { + owner = "jupyterlab"; + repo = pname; + rev = version; + sha256 = "sha256-stp0LZJAOCrnObvJIPEVt8mMb8yL29nlHECypbTg3ec="; + }; + + propagatedBuildInputs = [ jupyter_server notebook ]; + + checkInputs = [ + pytestCheckHook + pytest-tornasync + ]; + + meta = with lib; { + description = "Jupyter lab environment notebook server extension."; + license = with licenses; [ bsd3 ]; + homepage = "https://github.com/jupyterlab/nbclassic"; + maintainers = [ maintainers.elohmeier ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 861b8e086136..04a6e7b5eb08 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3565,6 +3565,8 @@ in { jupyter_core = callPackage ../development/python-modules/jupyter_core { }; + jupyter_server = callPackage ../development/python-modules/jupyter_server { }; + jupyterhub = callPackage ../development/python-modules/jupyterhub { }; jupyterhub-ldapauthenticator = callPackage ../development/python-modules/jupyterhub-ldapauthenticator { }; @@ -3583,6 +3585,8 @@ in { jupyterlab_server = callPackage ../development/python-modules/jupyterlab_server { }; + jupyter-packaging = callPackage ../development/python-modules/jupyter-packaging { }; + jupyter-repo2docker = callPackage ../development/python-modules/jupyter-repo2docker { pkgs-docker = pkgs.docker; }; @@ -4486,6 +4490,8 @@ in { naturalsort = callPackage ../development/python-modules/naturalsort { }; + nbclassic = callPackage ../development/python-modules/nbclassic { }; + nbclient = callPackage ../development/python-modules/nbclient { }; nbconflux = callPackage ../development/python-modules/nbconflux { };