Skip to content

Commit 07c0188

Browse files
authored
Merge pull request #112 from silx-kit/jupyterhub5
Added support of Jupyterhub v5
2 parents d7fac91 + 56d64d0 commit 07c0188

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

demo/jupyterhub_conf.py

+3
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@
9595
c.JupyterHub.ip = "127.0.0.1"
9696
c.JupyterHub.hub_ip = "127.0.0.1"
9797
c.JupyterHub.port = 8000
98+
99+
# Demo: Allow any user
100+
c.Authenticator.allow_all = True

jupyterhub_moss/models.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
field_validator,
99
BaseModel,
1010
ConfigDict,
11-
FieldValidationInfo,
1211
NonNegativeInt,
1312
PositiveInt,
1413
RootModel,
14+
ValidationInfo,
1515
)
1616

1717
# Validators
1818

1919

20-
def check_match_gpu(v: Optional[int], info: FieldValidationInfo) -> Optional[int]:
20+
def check_match_gpu(v: Optional[int], info: ValidationInfo) -> Optional[int]:
2121
if v is not None and v > 0 and info.data.get("gpu") == "":
2222
return 0 # GPU explicitly disabled
2323
return v
@@ -69,7 +69,7 @@ class JupyterEnvironment(BaseModel, frozen=True, extra="forbid"):
6969

7070
# validators
7171
@field_validator("modules")
72-
def check_path_or_mods(cls, v: str, info: FieldValidationInfo) -> str:
72+
def check_path_or_mods(cls, v: str, info: ValidationInfo) -> str:
7373
if not v and not info.data.get("path"):
7474
raise ValueError("Jupyter environment path or modules is required")
7575
return v

jupyterhub_moss/templates/option_form.html

+8-4
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,19 @@ <h4 class="subheading">Available resources</h4>
3131
charset="utf-8"
3232
></script>
3333
<ul class="nav nav-tabs nav-justified">
34-
<li class="active">
35-
<a data-toggle="tab" href="#home" id="simple_tab_link">
34+
<li class="nav-item">
35+
<a class="nav-link active" data-bs-toggle="tab" href="#home" id="simple_tab_link" >
3636
Simple
3737
</a>
3838
</li>
39-
<li><a data-toggle="tab" href="#menu1" id="advanced_tab_link">Advanced</a></li>
39+
<li class="nav-item">
40+
<a class="nav-link" data-bs-toggle="tab" href="#menu1" id="advanced_tab_link">
41+
Advanced
42+
</a>
43+
</li>
4044
</ul>
4145
<div class="tab-content">
42-
<div id="home" class="tab-pane fade in active">
46+
<div id="home" class="tab-pane fade show active">
4347
<h4 class="subheading">Partition</h4>
4448
<div class="radio-toolbar">
4549
{% for name, partition in partitions.items() %}

setup.cfg

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ python_requires = >=3.8
2525
install_requires =
2626
batchspawner>=1.0
2727
jinja2
28-
jupyterhub
29-
pydantic>=2.0,<3
28+
jupyterhub>=5.0.0
29+
pydantic>=2.4.0,<3
3030
traitlets
3131

3232
[options.extras_require]
@@ -39,7 +39,7 @@ dev =
3939
jupyter_server
4040
mypy
4141
pytest
42-
pytest-asyncio
42+
pytest-asyncio>=0.17,<0.23
4343

4444
# E501 (line too long) ignored
4545
# E203 and W503 incompatible with black formatting (https://black.readthedocs.io/en/stable/compatible_configs.html#flake8)

0 commit comments

Comments
 (0)