diff --git a/pkgs/development/python-modules/jupyter-collaboration-ui/default.nix b/pkgs/development/python-modules/jupyter-collaboration-ui/default.nix index 7c3b703a4d96..114962dada89 100644 --- a/pkgs/development/python-modules/jupyter-collaboration-ui/default.nix +++ b/pkgs/development/python-modules/jupyter-collaboration-ui/default.nix @@ -33,7 +33,7 @@ buildPythonPackage rec { # no tests doCheck = false; - passthru.tests = jupyter-collaboration.tests; + passthru.tests = jupyter-collaboration; meta = { description = "JupyterLab/Jupyter Notebook 7+ extension providing user interface integration for real time collaboration"; diff --git a/pkgs/development/python-modules/jupyter-collaboration/default.nix b/pkgs/development/python-modules/jupyter-collaboration/default.nix index 3776a2d1f869..dace73df26e3 100644 --- a/pkgs/development/python-modules/jupyter-collaboration/default.nix +++ b/pkgs/development/python-modules/jupyter-collaboration/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, # build-system hatchling, @@ -10,9 +10,15 @@ jupyter-collaboration-ui, jupyter-docprovider, jupyter-server-ydoc, + jupyterlab, # tests - callPackage, + dirty-equals, + httpx-ws, + pytest-jupyter, + pytest-timeout, + pytestCheckHook, + writableTmpDirAsHomeHook, }: buildPythonPackage rec { @@ -20,26 +26,43 @@ buildPythonPackage rec { version = "4.0.2"; pyproject = true; - src = fetchPypi { - pname = "jupyter_collaboration"; - inherit version; - hash = "sha256-MXKFiuwO36TZGsLlemRUuy04JW/GCWMVdgRBIFTQuiE="; + src = fetchFromGitHub { + owner = "jupyterlab"; + repo = "jupyter-collaboration"; + tag = "v${version}"; + hash = "sha256-BCvTtrlP45YC9G/m/e8Nvbls7AugIaQzO2Gect1EmGE="; }; + sourceRoot = "${src.name}/projects/jupyter-collaboration"; + build-system = [ hatchling ]; dependencies = [ jupyter-collaboration-ui jupyter-docprovider jupyter-server-ydoc + jupyterlab ]; pythonImportsCheck = [ "jupyter_collaboration" ]; - # no tests - doCheck = false; + nativeCheckInputs = [ + dirty-equals + httpx-ws + pytest-jupyter + pytest-timeout + pytestCheckHook + writableTmpDirAsHomeHook + ]; - passthru.tests = callPackage ./test.nix { }; + pytestFlagsArray = [ + # pytest.PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/build/source/pytest-cache-files-plraagdr' + "-p" + "no:cacheprovider" + "$src/tests" + ]; + + __darwinAllowLocalNetworking = true; meta = { description = "JupyterLab Extension enabling Real-Time Collaboration"; diff --git a/pkgs/development/python-modules/jupyter-collaboration/test.nix b/pkgs/development/python-modules/jupyter-collaboration/test.nix deleted file mode 100644 index 044b923a723d..000000000000 --- a/pkgs/development/python-modules/jupyter-collaboration/test.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - stdenvNoCC, - fetchFromGitHub, - jupyter-collaboration, - pytest-jupyter, - pytestCheckHook, - websockets, -}: -stdenvNoCC.mkDerivation (finalAttrs: { - pname = "jupyter-collaboration-test"; - inherit (jupyter-collaboration) version; - - src = fetchFromGitHub { - owner = "jupyterlab"; - repo = "jupyter-collaboration"; - rev = "refs/tags/v${finalAttrs.version}"; - hash = "sha256-6hDYB1uC0WraB37s9EKLJF7jyFu0B3xLocuLYyKj4hs="; - }; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "timeout = 300" "" - ''; - - installPhase = '' - touch $out - ''; - - env.HOME = "$TMPDIR"; - - doCheck = true; - - nativeCheckInputs = [ - jupyter-collaboration - pytest-jupyter - pytestCheckHook - websockets - ]; -}) diff --git a/pkgs/development/python-modules/jupyter-docprovider/default.nix b/pkgs/development/python-modules/jupyter-docprovider/default.nix index dc94b0b85744..834b1b63ebda 100644 --- a/pkgs/development/python-modules/jupyter-docprovider/default.nix +++ b/pkgs/development/python-modules/jupyter-docprovider/default.nix @@ -33,7 +33,7 @@ buildPythonPackage rec { # no tests doCheck = false; - passthru.tests = jupyter-collaboration.tests; + passthru.tests = jupyter-collaboration; meta = { description = "JupyterLab/Jupyter Notebook 7+ extension integrating collaborative shared models"; diff --git a/pkgs/development/python-modules/jupyter-server-ydoc/default.nix b/pkgs/development/python-modules/jupyter-server-ydoc/default.nix index d8e823355b32..fdf1a4cd95b6 100644 --- a/pkgs/development/python-modules/jupyter-server-ydoc/default.nix +++ b/pkgs/development/python-modules/jupyter-server-ydoc/default.nix @@ -41,7 +41,7 @@ buildPythonPackage rec { # no tests doCheck = false; - passthru.tests = jupyter-collaboration.tests; + passthru.tests = jupyter-collaboration; meta = { description = "Jupyter-server extension integrating collaborative shared models";