Skip to content

utils

get_absolute_venv_path_v1(venv_path)

If a path is not absolute, make it a relative path of FRACTAL_TASKS_DIR.

As of v2.7.0, we rename this to v1 since it is only to be used in v1.

Source code in fractal_server/tasks/utils.py
12
13
14
15
16
17
18
19
20
21
22
23
def get_absolute_venv_path_v1(venv_path: Path) -> Path:
    """
    If a path is not absolute, make it a relative path of FRACTAL_TASKS_DIR.

    As of v2.7.0, we rename this to v1 since it is only to be used in v1.
    """
    if venv_path.is_absolute():
        package_path = venv_path
    else:
        settings = Inject(get_settings)
        package_path = settings.FRACTAL_TASKS_DIR / venv_path
    return package_path