From 0dc288083e7bce9043a6aa3f02f537eb3ec4a86d Mon Sep 17 00:00:00 2001 From: Divyansh Choudhary Date: Tue, 23 Apr 2024 14:30:21 +0530 Subject: [PATCH 1/3] Move ENV_CONFIG_PATH import back into _get_config_manager We move the import for ENV_CONFIG_PATH back into the _get_config_manager function so that patches applied in jupyterlab tests are correctly reflected --- jupyterlab_server/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jupyterlab_server/config.py b/jupyterlab_server/config.py index faf57cd..9d591cc 100644 --- a/jupyterlab_server/config.py +++ b/jupyterlab_server/config.py @@ -13,7 +13,7 @@ from typing import Any import json5 -from jupyter_core.paths import ENV_CONFIG_PATH, SYSTEM_CONFIG_PATH, jupyter_config_dir, jupyter_path +from jupyter_core.paths import SYSTEM_CONFIG_PATH, jupyter_config_dir, jupyter_path from jupyter_server.services.config.manager import ConfigManager, recursive_update from jupyter_server.utils import url_path_join as ujoin from traitlets import Bool, HasTraits, List, Unicode, default @@ -370,6 +370,7 @@ def _get_config_manager(level: str, include_higher_levels: bool = False) -> Conf """Get the location of config files for the current context Returns the string to the environment """ + from jupyter_core.paths import ENV_CONFIG_PATH allowed = get_allowed_levels() if level not in allowed: msg = f"Page config level must be one of: {allowed}" From e0fb5248a616c657a40ebd297bd9cfbc71a88ce2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:03:36 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- jupyterlab_server/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jupyterlab_server/config.py b/jupyterlab_server/config.py index 9d591cc..aa5b64b 100644 --- a/jupyterlab_server/config.py +++ b/jupyterlab_server/config.py @@ -371,6 +371,7 @@ def _get_config_manager(level: str, include_higher_levels: bool = False) -> Conf Returns the string to the environment """ from jupyter_core.paths import ENV_CONFIG_PATH + allowed = get_allowed_levels() if level not in allowed: msg = f"Page config level must be one of: {allowed}" From 4781d7ac41016e69d165b128aa951fafa1c28a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krassowski?= <5832902+krassowski@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:40:47 +0100 Subject: [PATCH 3/3] Add back a comment --- jupyterlab_server/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jupyterlab_server/config.py b/jupyterlab_server/config.py index aa5b64b..d58c8a4 100644 --- a/jupyterlab_server/config.py +++ b/jupyterlab_server/config.py @@ -370,6 +370,7 @@ def _get_config_manager(level: str, include_higher_levels: bool = False) -> Conf """Get the location of config files for the current context Returns the string to the environment """ + # Delayed import since this gets monkey-patched in tests from jupyter_core.paths import ENV_CONFIG_PATH allowed = get_allowed_levels()