Skip to content

manipulating PATH #2

Description

@rsgalloway

should sitecustomize manipulate the PATH value to add /bin directories automatically?

in this case, it would have to append to PATH (not replace it), so maybe a system-agnostic append_env function:

def append_env(key, path):
    """
    Appends a path to the specified environment variable.

    Parameters:
    key (str): The name of the environment variable (e.g., 'PATH').
    path (str): The path to append to the environment variable.
    """
    if key in os.environ:
        os.environ[key] = os.environ[key] + os.pathsep + path
    else:
        os.environ[key] = path

append_env("PATH", SEP.join([ROOT, PROD_ENV, "bin"]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions