From 5e166970fac0a159723bf6a3a349c8c6a247b075 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 23 Jan 2024 15:21:13 +0100 Subject: [PATCH] easier linting in jupyterhub_config noqa get_import satisfies most linters --- demo-image/jupyterhub_config.py | 2 +- examples/bootstrap-script/jupyterhub_config.py | 2 +- examples/external-oauth/jupyterhub_config.py | 1 + examples/service-announcement/jupyterhub_config.py | 2 +- examples/service-fastapi/jupyterhub_config.py | 2 ++ examples/service-notebook/external/jupyterhub_config.py | 2 ++ examples/service-notebook/managed/jupyterhub_config.py | 2 ++ examples/service-whoami-flask/jupyterhub_config.py | 2 ++ examples/service-whoami/jupyterhub_config.py | 2 ++ examples/spawn-form/jupyterhub_config.py | 1 + 10 files changed, 15 insertions(+), 3 deletions(-) diff --git a/demo-image/jupyterhub_config.py b/demo-image/jupyterhub_config.py index 312df765..ba87bbe0 100644 --- a/demo-image/jupyterhub_config.py +++ b/demo-image/jupyterhub_config.py @@ -1,6 +1,6 @@ # Configuration file for jupyterhub-demo -c = get_config() +c = get_config() # noqa # Use DummyAuthenticator and SimpleSpawner c.JupyterHub.spawner_class = "simple" diff --git a/examples/bootstrap-script/jupyterhub_config.py b/examples/bootstrap-script/jupyterhub_config.py index 5fd02287..ab55ef0b 100644 --- a/examples/bootstrap-script/jupyterhub_config.py +++ b/examples/bootstrap-script/jupyterhub_config.py @@ -27,9 +27,9 @@ def clean_dir_hook(spawner): if os.path.exists(temp_path) and os.path.isdir(temp_path): shutil.rmtree(temp_path) +c = get_config() # noqa # attach the hook functions to the spawner -# pylint: disable=undefined-variable c.Spawner.pre_spawn_hook = create_dir_hook c.Spawner.post_stop_hook = clean_dir_hook diff --git a/examples/external-oauth/jupyterhub_config.py b/examples/external-oauth/jupyterhub_config.py index 8877c774..6082dad7 100644 --- a/examples/external-oauth/jupyterhub_config.py +++ b/examples/external-oauth/jupyterhub_config.py @@ -8,6 +8,7 @@ if not api_token: "Make sure to `export JUPYTERHUB_API_TOKEN=$(openssl rand -hex 32)`" ) +c = get_config() # noqa # tell JupyterHub to register the service as an external oauth client c.JupyterHub.services = [ { diff --git a/examples/service-announcement/jupyterhub_config.py b/examples/service-announcement/jupyterhub_config.py index 07a9fe76..446900ea 100644 --- a/examples/service-announcement/jupyterhub_config.py +++ b/examples/service-announcement/jupyterhub_config.py @@ -1,6 +1,6 @@ import sys -c = get_config() +c = get_config() # noqa # To run the announcement service managed by the hub, add this. diff --git a/examples/service-fastapi/jupyterhub_config.py b/examples/service-fastapi/jupyterhub_config.py index f8f9e864..61c7a096 100644 --- a/examples/service-fastapi/jupyterhub_config.py +++ b/examples/service-fastapi/jupyterhub_config.py @@ -19,6 +19,8 @@ else: service_name = "fastapi" oauth_redirect_uri = f"{public_host}/services/{service_name}/oauth_callback" + +c = get_config() # noqa c.JupyterHub.services = [ { "name": service_name, diff --git a/examples/service-notebook/external/jupyterhub_config.py b/examples/service-notebook/external/jupyterhub_config.py index e6371389..59c807b7 100644 --- a/examples/service-notebook/external/jupyterhub_config.py +++ b/examples/service-notebook/external/jupyterhub_config.py @@ -1,3 +1,5 @@ +c = get_config() # noqa + # our user list c.Authenticator.allowed_users = ['minrk', 'ellisonbg', 'willingc'] diff --git a/examples/service-notebook/managed/jupyterhub_config.py b/examples/service-notebook/managed/jupyterhub_config.py index 1102dda9..01d212fb 100644 --- a/examples/service-notebook/managed/jupyterhub_config.py +++ b/examples/service-notebook/managed/jupyterhub_config.py @@ -1,3 +1,5 @@ +c = get_config() # noqa + # our user list c.Authenticator.allowed_users = ['minrk', 'ellisonbg', 'willingc'] diff --git a/examples/service-whoami-flask/jupyterhub_config.py b/examples/service-whoami-flask/jupyterhub_config.py index 8ed30f48..e4265ddb 100644 --- a/examples/service-whoami-flask/jupyterhub_config.py +++ b/examples/service-whoami-flask/jupyterhub_config.py @@ -1,3 +1,5 @@ +c = get_config() # noqa + c.JupyterHub.services = [ { 'name': 'whoami', diff --git a/examples/service-whoami/jupyterhub_config.py b/examples/service-whoami/jupyterhub_config.py index ec435a1d..1140732c 100644 --- a/examples/service-whoami/jupyterhub_config.py +++ b/examples/service-whoami/jupyterhub_config.py @@ -1,5 +1,7 @@ import sys +c = get_config() # noqa + c.JupyterHub.services = [ { 'name': 'whoami-api', diff --git a/examples/spawn-form/jupyterhub_config.py b/examples/spawn-form/jupyterhub_config.py index 5f58e9d8..b0ada62e 100644 --- a/examples/spawn-form/jupyterhub_config.py +++ b/examples/spawn-form/jupyterhub_config.py @@ -6,6 +6,7 @@ import shlex from jupyterhub.spawner import LocalProcessSpawner +c = get_config() # noqa class DemoFormSpawner(LocalProcessSpawner): def _options_form_default(self):