formelsammlung.venv_utils module

formelsammlung.venv_utils.get_venv_path()[source]

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

Raises

FileNotFoundError – when no calling venv can be detected.

Return type

Path

Returns

Return venv path

formelsammlung.venv_utils.get_venv_bin_dir(venv_path)[source]

Return path to bin/Scripts dir of given venv.

Parameters

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

Raises

FileNotFoundError – when no bin/Scripts dir can be found for given venv.

Return type

Path

Returns

Path to bin/Scripts dir

formelsammlung.venv_utils.get_venv_tmp_dir(venv_path)[source]

Return path to tmp/temp dir of given venv.

Parameters

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

Raises

FileNotFoundError – when no tmp/temp dir can be found for given venv.

Return type

Path

Returns

Path to tmp/temp dir

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

Raises

FileNotFoundError – when no site-packages dir can be found for given 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