Skip to content

Commit

Permalink
jupyter updates 2024-11-02 (#353035)
Browse files Browse the repository at this point in the history
  • Loading branch information
natsukium authored Nov 2, 2024
2 parents e62fd5b + 5478518 commit 6b2e0aa
Show file tree
Hide file tree
Showing 11 changed files with 236 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
lib,
buildPythonPackage,
fetchPypi,
hatchling,
hatch-jupyter-builder,
jupyter-collaboration,
}:

buildPythonPackage rec {
pname = "jupyter-collaboration-ui";
version = "1.0.0";
pyproject = true;

src = fetchPypi {
pname = "jupyter_collaboration_ui";
inherit version;
hash = "sha256-hTyUmLzRvexNTZxTv4Mbflm+OTW9j0HReLpAJuk/WnY=";
};

postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail ', "jupyterlab>=4.0.0"' ""
'';

build-system = [
hatchling
hatch-jupyter-builder
];

pythonImportsCheck = [ "jupyter_collaboration_ui" ];

# no tests
doCheck = false;

passthru.tests = jupyter-collaboration.tests;

meta = {
description = "JupyterLab/Jupyter Notebook 7+ extension providing user interface integration for real time collaboration";
homepage = "https://github.com/jupyterlab/jupyter-collaboration/tree/main/projects/jupyter-collaboration-ui";
license = lib.licenses.bsd3;
maintainers = lib.teams.jupyter.members;
};
}
57 changes: 13 additions & 44 deletions pkgs/development/python-modules/jupyter-collaboration/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,42 @@
fetchPypi,

# build-system
hatch-jupyter-builder,
hatch-nodejs-version,
hatchling,
jupyterlab,

# dependencies
jsonschema,
jupyter-events,
jupyter-server,
jupyter-server-fileid,
jupyter-ydoc,
pycrdt,
pycrdt-websocket,
jupyter-collaboration-ui,
jupyter-docprovider,
jupyter-server-ydoc,

# tests
pytest-jupyter,
pytestCheckHook,
websockets,
callPackage,
}:

buildPythonPackage rec {
pname = "jupyter-collaboration";
version = "2.1.4";
version = "3.0.0";
pyproject = true;

src = fetchPypi {
pname = "jupyter_collaboration";
inherit version;
hash = "sha256-YT3wrTQ8imuTK8zeJbwscHtawtqspf1oItGzMMfg5io=";
hash = "sha256-eewAsh/EI8DV4FNWgjEhT61RUbaYE6suOAny4bf1CCw=";
};

postPatch = ''
sed -i "/^timeout/d" pyproject.toml
'';

build-system = [
hatch-jupyter-builder
hatch-nodejs-version
hatchling
jupyterlab
];
build-system = [ hatchling ];

dependencies = [
jsonschema
jupyter-events
jupyter-server
jupyter-server-fileid
jupyter-ydoc
pycrdt
pycrdt-websocket
];

nativeCheckInputs = [
pytest-jupyter
pytestCheckHook
websockets
jupyter-collaboration-ui
jupyter-docprovider
jupyter-server-ydoc
];

pythonImportsCheck = [ "jupyter_collaboration" ];

preCheck = ''
export HOME=$TEMP
'';

pytestFlagsArray = [ "-Wignore::DeprecationWarning" ];
# no tests
doCheck = false;

__darwinAllowLocalNetworking = true;
passthru.tests = callPackage ./test.nix { };

meta = {
description = "JupyterLab Extension enabling Real-Time Collaboration";
Expand Down
39 changes: 39 additions & 0 deletions pkgs/development/python-modules/jupyter-collaboration/test.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
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
];
})
44 changes: 44 additions & 0 deletions pkgs/development/python-modules/jupyter-docprovider/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
lib,
buildPythonPackage,
fetchPypi,
hatchling,
hatch-jupyter-builder,
jupyter-collaboration,
}:

buildPythonPackage rec {
pname = "jupyter-docprovider";
version = "1.0.0";
pyproject = true;

src = fetchPypi {
pname = "jupyter_docprovider";
inherit version;
hash = "sha256-EcO3GqdbhRxawHwfSnjOHfFmYjpZy2NuuGc5CSW/xlY=";
};

postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail ', "jupyterlab>=4.0.0"' ""
'';

build-system = [
hatchling
hatch-jupyter-builder
];

pythonImportsCheck = [ "jupyter_docprovider" ];

# no tests
doCheck = false;

passthru.tests = jupyter-collaboration.tests;

meta = {
description = "JupyterLab/Jupyter Notebook 7+ extension integrating collaborative shared models";
homepage = "https://github.com/jupyterlab/jupyter-collaboration/tree/main/projects/jupyter-docprovider";
license = lib.licenses.bsd3;
maintainers = lib.teams.jupyter.members;
};
}
52 changes: 52 additions & 0 deletions pkgs/development/python-modules/jupyter-server-ydoc/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
lib,
buildPythonPackage,
fetchPypi,
hatchling,
jsonschema,
jupyter-events,
jupyter-server,
jupyter-server-fileid,
jupyter-ydoc,
pycrdt,
pycrdt-websocket,
jupyter-collaboration,
}:

buildPythonPackage rec {
pname = "jupyter-server-ydoc";
version = "1.0.0";
pyproject = true;

src = fetchPypi {
pname = "jupyter_server_ydoc";
inherit version;
hash = "sha256-MBdSTB2gaIFbdIyPHr5+wI7aBH/Fl85ywSWxgAmjkek=";
};

build-system = [ hatchling ];

dependencies = [
jsonschema
jupyter-events
jupyter-server
jupyter-server-fileid
jupyter-ydoc
pycrdt
pycrdt-websocket
];

pythonImportsCheck = [ "jupyter_server_ydoc" ];

# no tests
doCheck = false;

passthru.tests = jupyter-collaboration.tests;

meta = {
description = "Jupyter-server extension integrating collaborative shared models";
homepage = "https://github.com/jupyterlab/jupyter-collaboration/tree/main/projects/jupyter-server-ydoc";
license = lib.licenses.bsd3;
maintainers = lib.teams.jupyter.members;
};
}
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/jupyter-ydoc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

buildPythonPackage rec {
pname = "jupyter-ydoc";
version = "2.1.2";
version = "3.0.0";
pyproject = true;

src = fetchPypi {
pname = "jupyter_ydoc";
inherit version;
hash = "sha256-yYnIm0s9ljtYQJVzKJcimNTVSDTtjzz3Zo3WE9OfKsw=";
hash = "sha256-nPOU7nxpVSh+6tERJq2DYIOpyjze8uJyIdxN/gW7arE=";
};

build-system = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,52 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
jupyterhub,
ldap3,
fetchPypi,
traitlets,
pytestCheckHook,
pytest-asyncio,
}:

buildPythonPackage rec {
pname = "jupyterhub-ldapauthenticator";
version = "1.3.2";
format = "setuptools";
version = "2.0.1";
pyproject = true;

src = fetchPypi {
inherit pname version;
sha256 = "758081bbdb28b26313bb18c9d8aa2b8fcdc9162e4d3ab196c626567e64f1ab8b";
src = fetchFromGitHub {
owner = "jupyterhub";
repo = "ldapauthenticator";
rev = "refs/tags/${version}";
hash = "sha256-pb1d0dqu3VGCsuibpYgncbqCM9fz09yyoKGcKb14f4k=";
};

# No tests implemented
doCheck = false;
build-system = [ setuptools ];

propagatedBuildInputs = [
dependencies = [
jupyterhub
ldap3
traitlets
];

pythonImportsCheck = [ "ldapauthenticator" ];

nativeCheckInputs = [
pytest-asyncio
pytestCheckHook
];

disabledTests = [
# touch the socket
"test_allow_config"
"test_ldap_auth"
];

meta = with lib; {
description = "Simple LDAP Authenticator Plugin for JupyterHub";
homepage = "https://github.com/jupyterhub/ldapauthenticator";
changelog = "https://github.com/jupyterhub/ldapauthenticator/blob/${version}/CHANGELOG.md";
license = licenses.bsd3;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

buildPythonPackage rec {
pname = "jupyterhub-systemdspawner";
version = "1.0.1";
version = "1.0.2";
pyproject = true;

disabled = pythonOlder "3.8";
Expand All @@ -20,7 +20,7 @@ buildPythonPackage rec {
owner = "jupyterhub";
repo = "systemdspawner";
rev = "refs/tags/v${version}";
hash = "sha256-2Pxswa472umovHBUVTIX1l+Glj6bzzgBLsu+p4IA6jA=";
hash = "sha256-obM8HGCHsisRV1+kHMWdA7d6eb6awwPMBuDUAf3k0uI=";
};

postPatch = ''
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/python-modules/jupyterhub/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

buildPythonPackage rec {
pname = "jupyterhub";
version = "5.1.0";
version = "5.2.1";
pyproject = true;

disabled = pythonOlder "3.8";
Expand All @@ -51,12 +51,12 @@ buildPythonPackage rec {
owner = "jupyterhub";
repo = "jupyterhub";
rev = "refs/tags/${version}";
hash = "sha256-3L83FLhLCdTgOuFRgRMbz316cYbai0Z+hJwxXUCYB2Y=";
hash = "sha256-zOWcXpByJRzI9sTjTl+w/vo99suKOEN0TvPn1ZWlNmc=";
};

npmDeps = fetchNpmDeps {
inherit src;
hash = "sha256-b7j6iGYXrwco4YruqRPEEi4yWRF6otTUD2jKCEPcLTE=";
hash = "sha256-My7WUAqIvOrbbVTxSnA6a5NviM6u95+iyykx1xbudpw=";
};

postPatch = ''
Expand Down
Loading

0 comments on commit 6b2e0aa

Please sign in to comment.