Skip to content

Commit 6a397ce

Browse files
author
Samuel Moors
committed
update jupyter-core patch for jupyter-server v2.16.0
1 parent 32e3ea7 commit 6a397ce

2 files changed

Lines changed: 42 additions & 3 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Patch jupyter_core to help jupyter find the correct installation path.
2+
#
3+
# If jupyter is installed by EasyBuild, jupyter is not in the same place as python.
4+
# `EB_ENV_JUPYTER_ROOT` is used to indicate where jupyter are and should be set to
5+
# the instllation path in easyconfigs.
6+
# Avoid using `ENV_JUPYTER_PATH` and `ENV_CONFIG_PATH`. Otherwise user configuration
7+
# has lower priority and cannot save their own settings.
8+
# Author: Chia-Jung Hsu, 2024-01-31
9+
# Updated for jupyter-core 5.8.1 by Samuel Moors (Vrije Universiteit Brussel)
10+
11+
diff -ur jupyter_core-5.8.1.orig/jupyter_core/paths.py jupyter_core-5.8.1/jupyter_core/paths.py
12+
--- jupyter_core-5.8.1.orig/jupyter_core/paths.py 2020-02-02 01:00:00.000000000 +0100
13+
+++ jupyter_core-5.8.1/jupyter_core/paths.py 2026-01-23 16:45:30.078244084 +0100
14+
@@ -246,7 +246,11 @@
15+
"/usr/share/jupyter",
16+
]
17+
18+
-ENV_JUPYTER_PATH: list[str] = [str(Path(sys.prefix, "share", "jupyter"))]
19+
+if os.environ.get("EB_ENV_JUPYTER_ROOT"):
20+
+ EB_ENV_JUPYTER_ROOT = [p.rstrip(os.sep) for p in os.environ["EB_ENV_JUPYTER_ROOT"].split(os.pathsep)]
21+
+ ENV_JUPYTER_PATH = [str(Path(p, "share", "jupyter")) for p in EB_ENV_JUPYTER_ROOT]
22+
+else:
23+
+ ENV_JUPYTER_PATH: list[str] = [str(Path(sys.prefix, "share", "jupyter"))]
24+
25+
26+
def jupyter_path(*subdirs: str) -> list[str]:
27+
@@ -337,7 +341,11 @@
28+
return paths
29+
30+
31+
-ENV_CONFIG_PATH: list[str] = [str(Path(sys.prefix, "etc", "jupyter"))]
32+
+if os.environ.get("EB_ENV_JUPYTER_ROOT"):
33+
+ EB_ENV_JUPYTER_ROOT = [p.rstrip(os.sep) for p in os.environ["EB_ENV_JUPYTER_ROOT"].split(os.pathsep)]
34+
+ ENV_CONFIG_PATH = [str(Path(p, "etc", "jupyter")) for p in EB_ENV_JUPYTER_ROOT]
35+
+else:
36+
+ ENV_CONFIG_PATH: list[str] = [str(Path(sys.prefix, "etc", "jupyter"))]
37+
38+
if use_platform_dirs():
39+
if os.name == "nt" and not _use_programdata:

easybuild/easyconfigs/j/jupyter-server/jupyter-server-2.16.0-GCCcore-14.2.0.eb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ exts_list = [
104104
'checksums': ['55158fa3d93b98cc75299b1e67078ad9003ca27945c76162c1c0766d6f91820a'],
105105
}),
106106
('jupyter_core', '5.8.1', {
107-
'patches': ['jupyter-core-5.7.2_fix_jupyter_path.patch'],
107+
'patches': ['jupyter-core-5.8.1_fix_jupyter_path.patch'],
108108
'checksums': [
109109
{'jupyter_core-5.8.1.tar.gz': '0a5f9706f70e64786b75acba995988915ebd4601c8a52e534a40b51c95f59941'},
110-
{'jupyter-core-5.7.2_fix_jupyter_path.patch':
111-
'1ed5088728c1ad49687b66e31ed23965c36645ad285693785b2b96c4ff1b2f93'},
110+
{'jupyter-core-5.8.1_fix_jupyter_path.patch':
111+
'27a812336fe255f3f52b35fcaad799a792759136efa7bd026ff3d3c63b6879c9'},
112112
],
113113
}),
114114
('fastjsonschema', '2.21.1', {

0 commit comments

Comments
 (0)