formelsammlung.venv_utils module

formelsammlung.venv_utils.get_venv_path()[source]

Get path to the venv from where the python executable runs.

Return type

Optional[str]

Returns

Return venv path or None if python is not called from a venv.

formelsammlung.venv_utils.get_venv_site_packages_dir(venv_path)[source]

Return path to site-packages dir of given venv.

Parameters

venv_path (Union[str, Path]) – Path to venv

Return type

Path

Returns

Path to site-packages dir

formelsammlung.venv_utils.where_installed(program)[source]

Find installation locations for given program.

Return exit code and locations based on found installation places. Search in current venv and globally.

Exit codes:

  • 0 = nowhere

  • 1 = venv

  • 2 = global

  • 3 = both

Parameters

program (str) – Program to search

Return type

Tuple[int, Optional[str], Optional[str]]

Returns

Exit code, venv executable path, glob executable path