about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorOTABI Tomoya <tomoya.otabi@gmail.com>2024-06-01 11:06:18 +0900
committerGitHub <noreply@github.com>2024-06-01 11:06:18 +0900
commitb278279a9aab3d96957c7523c862b830540fd610 (patch)
tree5ad1544411dcb654b7a33f73a0e4ac23a1807b8a /pkgs
parentf99897f4e2c72873d888226e2908dfbbc3995223 (diff)
parent5f554e685382c4e24e9ea7f4855602debd3b0c59 (diff)
Merge pull request #314865 from natsukium/jupyter/update
jupyter updates 2024-05-26
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/jupyter-client/default.nix9
-rw-r--r--pkgs/development/python-modules/jupyterhub/default.nix171
-rw-r--r--pkgs/development/python-modules/jupyterlab-server/default.nix12
-rw-r--r--pkgs/development/python-modules/jupyterlab/default.nix8
-rw-r--r--pkgs/development/python-modules/nbclassic/default.nix41
5 files changed, 98 insertions, 143 deletions
diff --git a/pkgs/development/python-modules/jupyter-client/default.nix b/pkgs/development/python-modules/jupyter-client/default.nix
index 0a43bcf920a7b..82778299c799c 100644
--- a/pkgs/development/python-modules/jupyter-client/default.nix
+++ b/pkgs/development/python-modules/jupyter-client/default.nix
@@ -14,18 +14,18 @@
 
 buildPythonPackage rec {
   pname = "jupyter-client";
-  version = "8.6.1";
+  version = "8.6.2";
   pyproject = true;
 
   src = fetchPypi {
     pname = "jupyter_client";
     inherit version;
-    hash = "sha256-6EJRXiurjhkYbYn9/qer0V453VgflOOZ8A4q9aFlLT8=";
+    hash = "sha256-K9oU1V7lulhVKoxTrkPSFa2YaIU0iSE/N9oGDO1U2N8=";
   };
 
-  nativeBuildInputs = [ hatchling ];
+  build-system = [ hatchling ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     jupyter-core
     python-dateutil
     pyzmq
@@ -43,5 +43,6 @@ buildPythonPackage rec {
     homepage = "https://github.com/jupyter/jupyter_client";
     changelog = "https://github.com/jupyter/jupyter_client/blob/v${version}/CHANGELOG.md";
     license = lib.licenses.bsd3;
+    maintainers = lib.teams.jupyter.members;
   };
 }
diff --git a/pkgs/development/python-modules/jupyterhub/default.nix b/pkgs/development/python-modules/jupyterhub/default.nix
index 7a08e773646d9..543564b606eae 100644
--- a/pkgs/development/python-modules/jupyterhub/default.nix
+++ b/pkgs/development/python-modules/jupyterhub/default.nix
@@ -8,156 +8,127 @@
   certipy,
   configurable-http-proxy,
   cryptography,
-  entrypoints,
-  fetchPypi,
-  fetchzip,
+  fetchFromGitHub,
+  fetchNpmDeps,
+  idna,
   importlib-metadata,
   jinja2,
   jsonschema,
-  jupyter-telemetry,
+  jupyter-events,
   jupyterlab,
-  jupyter-core,
-  jupyter-server,
   mock,
   nbclassic,
-  nodePackages,
-  notebook,
+  nodejs,
+  npmHooks,
   oauthlib,
   packaging,
   pamela,
   playwright,
   prometheus-client,
+  pydantic,
   pytest-asyncio,
   pytestCheckHook,
   python-dateutil,
   pythonOlder,
   requests,
   requests-mock,
-  selenium,
+  setuptools,
+  setuptools-scm,
   sqlalchemy,
   tornado,
   traitlets,
   virtualenv,
 }:
 
-let
-  # js/css assets that setup.py tries to fetch via `npm install` when building
-  # from source. https://github.com/jupyterhub/jupyterhub/blob/master/package.json
-  bootstrap = fetchzip {
-    url = "https://registry.npmjs.org/bootstrap/-/bootstrap-3.4.1.tgz";
-    sha256 = "1ywmxqdccg0mgx0xknrn1hlrfnhcwphc12y9l91zizx26fqfmzgc";
-  };
-  font-awesome = fetchzip {
-    url = "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz";
-    sha256 = "1xnxbdlfdd60z5ix152m8r2kk9dkwlqwpypky1mm3dv64ajnzdbk";
-  };
-  jquery = fetchzip {
-    url = "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz";
-    sha256 = "0yi9ql493din1qa1s923nd5zvd0klk1sx00xj1wx2yambmq86vm9";
-  };
-  moment = fetchzip {
-    url = "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz";
-    sha256 = "0ifzzla4zffw23g3xvhwx3fj3jny6cjzxfzl1x0317q8wa0c7w5i";
-  };
-  requirejs = fetchzip {
-    url = "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz";
-    sha256 = "165hkli3qcd59cjqvli9r5f92i0h7czkmhcg1cgwamw2d0b7xibz";
-  };
-in
-
 buildPythonPackage rec {
   pname = "jupyterhub";
-  version = "4.1.5";
-  format = "setuptools";
+  version = "5.0.0";
+  pyproject = true;
 
-  disabled = pythonOlder "3.7";
+  disabled = pythonOlder "3.8";
 
-  src = fetchPypi {
-    inherit pname version;
-    hash = "sha256-Y7ofxxhDbBUZRqWKO0A+xP6LP2JPsZW8HY5ww5sz4ZQ=";
+  src = fetchFromGitHub {
+    owner = "jupyterhub";
+    repo = "jupyterhub";
+    rev = "refs/tags/${version}";
+    hash = "sha256-YGDbyWe3JSXbluOX6qyLqzl92Z/f5sD/5TPc2LR7W80=";
   };
 
-  # Most of this only applies when building from source (e.g. js/css assets are
-  # pre-built and bundled in the official release tarball on pypi).
-  #
-  # Stuff that's always needed:
-  #   * At runtime, we need configurable-http-proxy, so we substitute the store
-  #     path.
-  #
-  # Other stuff that's only needed when building from source:
-  #   * js/css assets are fetched from npm.
-  #   * substitute store path for `lessc` commmand.
-  #   * set up NODE_PATH so `lessc` can find `less-plugin-clean-css`.
-  #   * don't run `npm install`.
-  preBuild = ''
-    export NODE_PATH=${nodePackages.less-plugin-clean-css}/lib/node_modules
+  npmDeps = fetchNpmDeps {
+    inherit src;
+    hash = "sha256-7G/Y2yaMi9cyf20/o8rLXKIE6SdZ74HSWJ3Wfypl4Cc=";
+  };
 
-    substituteInPlace jupyterhub/proxy.py --replace \
+  postPatch = ''
+    substituteInPlace jupyterhub/proxy.py --replace-fail \
       "'configurable-http-proxy'" \
       "'${configurable-http-proxy}/bin/configurable-http-proxy'"
 
-    substituteInPlace jupyterhub/tests/test_proxy.py --replace \
+    substituteInPlace jupyterhub/tests/test_proxy.py --replace-fail \
       "'configurable-http-proxy'" \
       "'${configurable-http-proxy}/bin/configurable-http-proxy'"
+  '';
 
-    substituteInPlace setup.py --replace \
-      "'npm'" "'true'"
-
-    declare -A deps
-    deps[bootstrap]=${bootstrap}
-    deps[font-awesome]=${font-awesome}
-    deps[jquery]=${jquery}
-    deps[moment]=${moment}
-    deps[requirejs]=${requirejs}
+  nativeBuildInputs = [
+    nodejs
+    npmHooks.npmConfigHook
+  ];
 
-    mkdir -p share/jupyter/hub/static/components
-    for dep in "''${!deps[@]}"; do
-      if [ ! -e share/jupyter/hub/static/components/$dep ]; then
-        cp -r ''${deps[$dep]} share/jupyter/hub/static/components/$dep
-      fi
-    done
-  '';
+  build-system = [
+    setuptools
+    setuptools-scm
+  ];
 
-  propagatedBuildInputs = [
-    alembic
-    async-generator
-    certipy
-    python-dateutil
-    entrypoints
-    jinja2
-    jupyter-telemetry
-    oauthlib
-    packaging
-    pamela
-    prometheus-client
-    requests
-    selenium
-    sqlalchemy
-    tornado
-    traitlets
-    jupyter-core
-    jupyter-server
-  ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
+  dependencies =
+    [
+      alembic
+      certipy
+      idna
+      jinja2
+      jupyter-events
+      oauthlib
+      packaging
+      pamela
+      prometheus-client
+      pydantic
+      python-dateutil
+      requests
+      sqlalchemy
+      tornado
+      traitlets
+    ]
+    ++ lib.optionals (pythonOlder "3.10") [
+      async-generator
+      importlib-metadata
+    ];
 
   nativeCheckInputs = [
     beautifulsoup4
     cryptography
-    notebook
     jsonschema
-    nbclassic
-    mock
     jupyterlab
+    mock
+    nbclassic
     playwright
-    pytest-asyncio
+    # require pytest-asyncio<0.23
+    # https://github.com/jupyterhub/jupyterhub/pull/4663
+    (pytest-asyncio.overrideAttrs (
+      final: prev: {
+        version = "0.21.2";
+        src = fetchFromGitHub {
+          inherit (prev.src) owner repo;
+          rev = "refs/tags/v${final.version}";
+          hash = "sha256-AVVvdo/CDF9IU6l779sLc7wKz5h3kzMttdDNTPLYxtQ=";
+        };
+      }
+    ))
     pytestCheckHook
     requests-mock
     virtualenv
   ];
 
   preCheck = ''
-    substituteInPlace jupyterhub/tests/test_spawner.py --replace \
-      "'jupyterhub-singleuser'" "'$out/bin/jupyterhub-singleuser'"
-    export PATH="$PATH:$out/bin";
+    export PATH=$out/bin:$PATH;
   '';
 
   disabledTests = [
@@ -195,7 +166,7 @@ buildPythonPackage rec {
 
   meta = with lib; {
     description = "Serves multiple Jupyter notebook instances";
-    homepage = "https://jupyter.org/";
+    homepage = "https://github.com/jupyterhub/jupyterhub";
     changelog = "https://github.com/jupyterhub/jupyterhub/blob/${version}/docs/source/reference/changelog.md";
     license = licenses.bsd3;
     maintainers = teams.jupyter.members;
diff --git a/pkgs/development/python-modules/jupyterlab-server/default.nix b/pkgs/development/python-modules/jupyterlab-server/default.nix
index 7aab011ea3b1a..8926c561e8efc 100644
--- a/pkgs/development/python-modules/jupyterlab-server/default.nix
+++ b/pkgs/development/python-modules/jupyterlab-server/default.nix
@@ -22,7 +22,7 @@
 
 buildPythonPackage rec {
   pname = "jupyterlab-server";
-  version = "2.27.1";
+  version = "2.27.2";
   pyproject = true;
 
   disabled = pythonOlder "3.8";
@@ -30,16 +30,16 @@ buildPythonPackage rec {
   src = fetchPypi {
     pname = "jupyterlab_server";
     inherit version;
-    hash = "sha256-CXtaxwm2dscoSsnF43PxGTClYfUs1ahuT8flqcioYx0=";
+    hash = "sha256-FcuzSdxF6VTgm6z4G5+byxCBX/Zg+yA07NdBfbOn6ic=";
   };
 
   postPatch = ''
     sed -i "/timeout/d" pyproject.toml
   '';
 
-  nativeBuildInputs = [ hatchling ];
+  build-system = [ hatchling ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     babel
     jinja2
     json5
@@ -49,7 +49,7 @@ buildPythonPackage rec {
     requests
   ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
 
-  passthru.optional-dependencies = {
+  optional-dependencies = {
     openapi = [
       openapi-core
       ruamel-yaml
@@ -61,7 +61,7 @@ buildPythonPackage rec {
     pytestCheckHook
     requests-mock
     strict-rfc3339
-  ] ++ passthru.optional-dependencies.openapi;
+  ] ++ optional-dependencies.openapi;
 
   preCheck = ''
     export HOME=$(mktemp -d)
diff --git a/pkgs/development/python-modules/jupyterlab/default.nix b/pkgs/development/python-modules/jupyterlab/default.nix
index 7668dae613fd1..166a1bb82b3f0 100644
--- a/pkgs/development/python-modules/jupyterlab/default.nix
+++ b/pkgs/development/python-modules/jupyterlab/default.nix
@@ -21,22 +21,22 @@
 
 buildPythonPackage rec {
   pname = "jupyterlab";
-  version = "4.2.0";
+  version = "4.2.1";
   pyproject = true;
 
   disabled = pythonOlder "3.8";
 
   src = fetchPypi {
     inherit pname version;
-    hash = "sha256-NW6SBaaiq2icR8j+SRnbpsB243bQPya6rcBXSMJDXdU=";
+    hash = "sha256-oQ+3EIWmkAggxi1DMkAFBGQC/8jw/eaWED43I4qDlQc=";
   };
 
-  nativeBuildInputs = [
+  build-system = [
     hatch-jupyter-builder
     hatchling
   ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     async-lru
     httpx
     packaging
diff --git a/pkgs/development/python-modules/nbclassic/default.nix b/pkgs/development/python-modules/nbclassic/default.nix
index 6b9cfcd9ba6a2..71cf418e13a2b 100644
--- a/pkgs/development/python-modules/nbclassic/default.nix
+++ b/pkgs/development/python-modules/nbclassic/default.nix
@@ -1,60 +1,43 @@
 {
   lib,
-  argon2-cffi,
   buildPythonPackage,
   fetchPypi,
+  babel,
   ipykernel,
   ipython-genutils,
-  jinja2,
-  jupyter-client,
-  jupyter-core,
+  jupyter-packaging,
   jupyter-server,
-  nbconvert,
-  nbformat,
   nest-asyncio,
   notebook-shim,
-  prometheus-client,
   pytest-jupyter,
   pytest-tornasync,
   pytestCheckHook,
   pythonOlder,
-  pyzmq,
-  send2trash,
-  terminado,
-  tornado,
-  traitlets,
 }:
 
 buildPythonPackage rec {
   pname = "nbclassic";
-  version = "1.0.0";
-  format = "setuptools";
+  version = "1.1.0";
+  pyproject = true;
 
   disabled = pythonOlder "3.7";
 
   src = fetchPypi {
     inherit pname version;
-    hash = "sha256-CuEesjGUVdgFWWvzIDNs2pVUtB2Zq5o8Mb+BgL/6MOM=";
+    hash = "sha256-d7d7qF+emI+brYXfNFtRTp5kx/DoIpkqsd9KeKxk/B4=";
   };
 
-  propagatedBuildInputs = [
-    argon2-cffi
+  build-system = [
+    babel
+    jupyter-packaging
+    jupyter-server
+  ];
+
+  dependencies = [
     ipykernel
     ipython-genutils
-    jinja2
-    jupyter-client
-    jupyter-core
-    jupyter-server
-    nbconvert
-    nbformat
     nest-asyncio
     notebook-shim
-    prometheus-client
-    pyzmq
-    send2trash
-    terminado
-    tornado
-    traitlets
   ];
 
   nativeCheckInputs = [