Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipykernel for JupyterLab app #413

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions easyconfigs/i/ipykernel/ipykernel-6.25.1-GCCcore-12.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
easyblock = 'PythonBundle'

name = 'ipykernel'
version = "6.25.1"

homepage = 'https://ipykernel.readthedocs.io'
description = """IPython Kernel for Jupyter."""

toolchain = {'name': 'GCCcore', 'version': '12.3.0'}

dependencies = [
('Python', '3.11.3'),
('hatchling', '1.18.0'),
('IPython', '8.14.0'),
('PyZMQ', '25.1.1'),
('tornado', '6.3.2'),
]

sanity_pip_check = True
use_pip = True

exts_list = [
('jupyter_core', '5.3.1', {
'patches': ['jupyter-core-5.3.1_fix_jupyter_path.patch'],
'checksums': [
{'jupyter_core-5.3.1.tar.gz': '5ba5c7938a7f97a6b0481463f7ff0dbac7c15ba48cf46fa4035ca6e838aa1aba'},
{'jupyter-core-5.3.1_fix_jupyter_path.patch':
'030f1beb91987eb7519360c6d0b5c999f8843f00bca6a170f9ea5d3667ee61e5'},
],
}),
('jupyter_client', '8.3.0', {
'checksums': ['3af69921fe99617be1670399a0b857ad67275eefcfa291e2c81a160b7b650f5f'],
}),
('comm', '0.1.4', {
'checksums': ['354e40a59c9dd6db50c5cc6b4acc887d82e9603787f83b68c01a80a923984d15'],
}),
('nest_asyncio', '1.5.7', {
'checksums': ['6a80f7b98f24d9083ed24608977c09dd608d83f91cccc24c9d2cba6d10e01c10'],
}),
('%(name)s', '%(version)s', {
'checksums': ['050391364c0977e768e354bdb60cbbfbee7cbb943b1af1618382021136ffd42f'],
}),
('debugpy', '1.6.7.post1', {
'source_tmpl': '%(name)s-%(version)s-py2.py3-none-any.whl',
'checksums': ['1093a5c541af079c13ac8c70ab8b24d1d35c8cacb676306cf11e57f699c02926'],
}),
]

sanity_check_paths = {
'files': ['lib/python%(pyshortver)s/site-packages/ipykernel_launcher.py'],
'dirs': ['lib/python%(pyshortver)s/site-packages/ipykernel'],
}

moduleclass = 'tools'
34 changes: 34 additions & 0 deletions easyconfigs/i/ipykernel/jupyter-core-5.3.1_fix_jupyter_path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Patch jupyter_core to help jupyter find the correct installation path.
#
# If jupyter is installed by EasyBuild, jupyter is not in the same place as python.
# `EB_ENV_JUPYTER_ROOT` is used to indicate where jupyter are and should be set to
# the instllation path in easyconfigs.
# Avoid using `ENV_JUPYTER_PATH` and `ENV_CONFIG_PATH`. Otherwise user configuration
# has lower priority and cannot save their own settings.
# Author: Chia-Jung Hsu, 2024-01-31
diff --git a/jupyter_core/paths.py b/jupyter_core/paths.py
index a7bf051..b38589c 100644
--- a/jupyter_core/paths.py
+++ b/jupyter_core/paths.py
@@ -225,7 +225,10 @@ else:
]

ENV_JUPYTER_PATH: List[str] = [os.path.join(sys.prefix, "share", "jupyter")]
-
+if os.environ.get("EB_ENV_JUPYTER_ROOT"):
+ EB_ENV_JUPYTER_ROOT = [p.rstrip(os.sep) for p in os.environ["EB_ENV_JUPYTER_ROOT"].split(os.pathsep)]
+ ENV_JUPYTER_PATH = [str(Path(p, "share", "jupyter")) for p in EB_ENV_JUPYTER_ROOT]
+

def jupyter_path(*subdirs: str) -> List[str]:
"""Return a list of directories to search for data files
@@ -303,6 +306,9 @@ else:
"/etc/jupyter",
]
ENV_CONFIG_PATH: List[str] = [os.path.join(sys.prefix, "etc", "jupyter")]
+if os.environ.get("EB_ENV_JUPYTER_ROOT"):
+ EB_ENV_JUPYTER_ROOT = [p.rstrip(os.sep) for p in os.environ["EB_ENV_JUPYTER_ROOT"].split(os.pathsep)]
+ ENV_CONFIG_PATH = [str(Path(p, "etc", "jupyter")) for p in EB_ENV_JUPYTER_ROOT]


def jupyter_config_path() -> List[str]: