Skip to content

Commit

Permalink
Move ENV_CONFIG_PATH import back into _get_config_manager (#450)
Browse files Browse the repository at this point in the history
* 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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add back a comment

---------

Co-authored-by: Divyansh Choudhary <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Michał Krassowski <[email protected]>
  • Loading branch information
4 people authored Apr 23, 2024
1 parent 5846f21 commit 055a169
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jupyterlab_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -370,6 +370,9 @@ 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()
if level not in allowed:
msg = f"Page config level must be one of: {allowed}"
Expand Down

0 comments on commit 055a169

Please sign in to comment.