Skip to content

Commit 1f9a171

Browse files
authored
Merge pull request #6 from yuvipanda/fix-prep
Fix more pre-commit hooks
2 parents ef923e3 + bf99e65 commit 1f9a171

File tree

8 files changed

+110
-107
lines changed

8 files changed

+110
-107
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = {
2828
"no-unused-vars": ["error", { args: "after-used" }],
2929
},
3030
ignorePatterns: [
31-
"kubespawner_dynamic_building_ui/static/*.js",
31+
"jupyterhub_fancy_profiles/static/*.js",
3232
"webpack.config.js",
3333
],
3434
};

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 120

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ repos:
5757

5858
# Lint: JS code
5959
- repo: https://github.com/pre-commit/mirrors-eslint
60-
rev: "v8.49.0" # Use the sha / tag you want to point at
60+
rev: "v8.53.0" # Use the sha / tag you want to point at
6161
hooks:
6262
- id: eslint
6363
files: \.jsx?$

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## Setting up a dev environment
44

5-
65
### Setting up `minikube`
76

87
Currently, these instructions only work with [minikube](https://minikube.sigs.k8s.io/docs/start/)
@@ -61,4 +60,4 @@ but can be adapted to work with any other local kubernetes setup.
6160

6261
```bash
6362
jupyterhub
64-
```
63+
```

binderhub_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
c = get_config() # noqa
12

23
c.BinderHub.debug = True
34

@@ -6,4 +7,4 @@
67

78
c.BinderHub.base_url = "/services/binder/"
89

9-
c.BinderHub.enable_api_only_mode = True
10+
c.BinderHub.enable_api_only_mode = True

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
git+https://github.com/jupyterhub/binderhub.git@main
12
jupyterhub
23
jupyterhub-kubespawner
3-
git+https://github.com/jupyterhub/binderhub.git@main

jupyterhub_config.py

Lines changed: 101 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import socket
21
import os
3-
c = get_config() # noqa
2+
import socket
43

54
from jupyterhub.auth import DummyAuthenticator
5+
from kubespawner.spawner import KubeSpawner
6+
7+
from jupyterhub_fancy_profiles import setup_ui
8+
9+
c = get_config() # noqa
10+
611

712
c.JupyterHub.authenticator_class = DummyAuthenticator
813

9-
# Optionally set a global password that all users must use
10-
# c.DummyAuthenticator.password = "your_password"
1114

12-
from kubespawner.spawner import KubeSpawner
1315
c.JupyterHub.spawner_class = KubeSpawner
1416

1517
c.Spawner.cmd = ["jupyterhub-singleuser"]
@@ -18,13 +20,13 @@
1820
# the hub to be able to restart without losing user containers
1921
c.JupyterHub.cleanup_servers = False
2022
c.JupyterHub.services = [
21-
{
22-
"name": "binder",
23-
"url": "http://localhost:8585",
24-
"command": ["python", "-m", "binderhub", "-f", "binderhub_config.py"],
25-
# Pass on environment variables required for binderhub to find where the docker image is
26-
"environment": os.environ.copy()
27-
}
23+
{
24+
"name": "binder",
25+
"url": "http://localhost:8585",
26+
"command": ["python", "-m", "binderhub", "-f", "binderhub_config.py"],
27+
# Pass on environment variables required for binderhub to find where the docker image is
28+
"environment": os.environ.copy(),
29+
}
2830
]
2931

3032
# Find the IP of the machine that minikube is most likely able to talk to
@@ -36,98 +38,97 @@
3638

3739
c.JupyterHub.hub_connect_ip = host_ip
3840

39-
from jupyterhub_fancy_profiles import setup_ui
41+
4042
setup_ui(c)
4143

4244
c.KubeSpawner.profile_list = [
43-
{
44-
"display_name": "Small",
45-
"description": "~2 CPU, ~2G RAM",
46-
"profile_options": {
47-
"image": {
48-
"display_name": "Image",
49-
"unlisted_choice": {
50-
"enabled": True,
51-
"display_name": "Custom image",
52-
"validation_regex": "^.+:.+$",
53-
"validation_message": "Must be a publicly available docker image, of form <image-name>:<tag>",
54-
"display_name_in_choices": "Specify an existing docker image",
55-
"description_in_choices": "Use a pre-existing docker image from a public docker registry (dockerhub, quay, etc)",
56-
"kubespawner_override": {
57-
"image": "{value}"
58-
}
59-
},
60-
"choices": {
61-
"pangeo": {
62-
"display_name": "Pangeo Notebook Image", "description": "Python image with scientific, dask and geospatial tools",
63-
"kubespawner_override": {
64-
"image": "pangeo/pangeo-notebook:2023.09.11"
65-
}
66-
},
67-
"geospatial": {
68-
"display_name": "Rocker Geospatial",
69-
"description": "R image with RStudio, the tidyverse & Geospatial tools",
70-
"default": True,
71-
"slug": "geospatial",
72-
"kubespawner_override": {
73-
"image": "rocker/binder:4.3",
74-
"default_url": "/rstudio",
75-
"working_dir": "/home/rstudio",
76-
}
77-
},
78-
"scipy": {
79-
"display_name": "Jupyter SciPy Notebook",
80-
"slug": "scipy",
81-
"kubespawner_override": {
82-
"image": "jupyter/scipy-notebook:2023-06-26"
83-
}
84-
}
85-
}
86-
},
87-
"resources": {
88-
"display_name": "Resource Allocation",
89-
"choices": {
90-
"mem_2_7": {
91-
"display_name": "2.7 GB RAM, upto 3.479 CPUs",
92-
"description": "Use this for the workshop on 2023 September",
93-
"kubespawner_override": {
94-
"mem_guarantee": 1024,
95-
"mem_limit": 2904451072,
96-
"cpu_guarantee": 0.1,
97-
"cpu_limit": 3.479,
45+
{
46+
"display_name": "Small",
47+
"description": "~2 CPU, ~2G RAM",
48+
"profile_options": {
49+
"image": {
50+
"display_name": "Image",
51+
"unlisted_choice": {
52+
"enabled": True,
53+
"display_name": "Custom image",
54+
"validation_regex": "^.+:.+$",
55+
"validation_message": "Must be a publicly available docker image, of form <image-name>:<tag>",
56+
"display_name_in_choices": "Specify an existing docker image",
57+
"description_in_choices": "Use a pre-existing docker image from a public docker registry",
58+
"kubespawner_override": {"image": "{value}"},
59+
},
60+
"choices": {
61+
"pangeo": {
62+
"display_name": "Pangeo Notebook Image",
63+
"description": "Python image with scientific, dask and geospatial tools",
64+
"kubespawner_override": {
65+
"image": "pangeo/pangeo-notebook:2023.09.11"
66+
},
67+
},
68+
"geospatial": {
69+
"display_name": "Rocker Geospatial",
70+
"description": "R image with RStudio, the tidyverse & Geospatial tools",
71+
"default": True,
72+
"slug": "geospatial",
73+
"kubespawner_override": {
74+
"image": "rocker/binder:4.3",
75+
"default_url": "/rstudio",
76+
"working_dir": "/home/rstudio",
77+
},
78+
},
79+
"scipy": {
80+
"display_name": "Jupyter SciPy Notebook",
81+
"slug": "scipy",
82+
"kubespawner_override": {
83+
"image": "jupyter/scipy-notebook:2023-06-26"
84+
},
85+
},
86+
},
9887
},
99-
"default": True
100-
},
101-
"mem_5_4": {
102-
"display_name": "5.4 GB RAM, upto 3.479 CPUs",
103-
"kubespawner_override": {
104-
"mem_guarantee":1024,
105-
"mem_limit": 5808902144,
106-
"cpu_guarantee": 0.1,
107-
"cpu_limit": 3.479,
108-
}
109-
},
110-
"mem_10_8": {
111-
"display_name": "10.8 GB RAM, upto 3.479 CPUs",
112-
"kubespawner_override": {
113-
"mem_guarantee": 1024,
114-
"mem_limit": 11617804288,
115-
"cpu_guarantee": 0.1,
116-
"cpu_limit": 3.479,
117-
}
118-
},
119-
"mem_21_6": {
120-
"display_name": "21.6 GB RAM, upto 3.479 CPUs",
121-
"description": "Large amount of RAM, might start slowly",
122-
"kubespawner_override": {
123-
"mem_guarantee": 1024,
124-
"mem_limit": 23235608576,
125-
"cpu_guarantee": 0.1,
126-
"cpu_limit": 3.479
88+
"resources": {
89+
"display_name": "Resource Allocation",
90+
"choices": {
91+
"mem_2_7": {
92+
"display_name": "2.7 GB RAM, upto 3.479 CPUs",
93+
"description": "Use this for the workshop on 2023 September",
94+
"kubespawner_override": {
95+
"mem_guarantee": 1024,
96+
"mem_limit": 2904451072,
97+
"cpu_guarantee": 0.1,
98+
"cpu_limit": 3.479,
99+
},
100+
"default": True,
101+
},
102+
"mem_5_4": {
103+
"display_name": "5.4 GB RAM, upto 3.479 CPUs",
104+
"kubespawner_override": {
105+
"mem_guarantee": 1024,
106+
"mem_limit": 5808902144,
107+
"cpu_guarantee": 0.1,
108+
"cpu_limit": 3.479,
109+
},
110+
},
111+
"mem_10_8": {
112+
"display_name": "10.8 GB RAM, upto 3.479 CPUs",
113+
"kubespawner_override": {
114+
"mem_guarantee": 1024,
115+
"mem_limit": 11617804288,
116+
"cpu_guarantee": 0.1,
117+
"cpu_limit": 3.479,
118+
},
119+
},
120+
"mem_21_6": {
121+
"display_name": "21.6 GB RAM, upto 3.479 CPUs",
122+
"description": "Large amount of RAM, might start slowly",
123+
"kubespawner_override": {
124+
"mem_guarantee": 1024,
125+
"mem_limit": 23235608576,
126+
"cpu_guarantee": 0.1,
127+
"cpu_limit": 3.479,
128+
},
129+
},
130+
},
127131
},
128-
}
129-
}
130-
}
132+
},
131133
}
132-
}
133134
]

src/ImageBuilder.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function ImageBuilder({ visible, unlistedInputName }) {
9494
const [builtImage, setBuiltImage] = useState(null);
9595

9696
// FIXME: Allow users to actually configure this
97-
const [ref, setRef] = useState("HEAD");
97+
const [ref, _] = useState("HEAD"); // eslint-disable-line no-unused-vars
9898
const [term, setTerm] = useState(null);
9999
const [fitAddon, setFitAddon] = useState(null);
100100

0 commit comments

Comments
 (0)