Skip to content

environment

This module reads in environment variables.

reset_global_gitconfig()

Reset the global gitconfig using 'kvakk-git-tools' module.

This function attempts to configure the global gitconfig using the 'kvakk-git-tools' module. If the configuration fails, an error message is printed indicating the platform's support status.

Source code in ssb_project_cli/ssb_project/build/environment.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def reset_global_gitconfig() -> None:
    """Reset the global gitconfig using 'kvakk-git-tools' module.

    This function attempts to configure the global gitconfig using the 'kvakk-git-tools' module.
    If the configuration fails, an error message is printed indicating the platform's support status.
    """
    print("\nConfiguring git with 'kvakk-git-tools':")

    try:
        ssb_gitconfig.main(test=False)
    except SystemExit:
        platform = ssb_gitconfig.Platform()
        is_supported_bools = ("is", "is not")
        print(
            f"\n:x:\tYour global gitconfig was not fixed, your platform {is_supported_bools[platform.is_unsupported()]} supported."
        )

running_onprem(image_spec)

Are we running in Jupyter on-prem?

Parameters:

Name Type Description Default
image_spec str

Value of the JUPYTER_IMAGE_SPEC environment variable

required

Returns:

Type Description
bool

True if running on-prem, else False.

Source code in ssb_project_cli/ssb_project/build/environment.py
12
13
14
15
16
17
18
19
20
21
def running_onprem(image_spec: str) -> bool:
    """Are we running in Jupyter on-prem?

    Args:
        image_spec: Value of the JUPYTER_IMAGE_SPEC environment variable

    Returns:
        True if running on-prem, else False.
    """
    return "onprem" in image_spec