venvmod.modulefile module

venvmod.modulefile.get_module_file_directory(venv_name: str) pathlib.Path[source]
venvmod.modulefile.add_command(filename: pathlib.Path, line: str)[source]
venvmod.modulefile.get_version() str[source]
venvmod.modulefile.get_version_list(index: int = 0) List[int][source]
class venvmod.modulefile.ModuleInstaller(version_or_path: str, install_prefix: str, cache_directory: str)[source]

Bases: object

Class to install Environment Module.

Methods

run

__init__(version_or_path: str, install_prefix: str, cache_directory: str) None[source]
run(verbose: bool = False, do_raise: bool = True)[source]
venvmod.modulefile.upgrade_modulefile(virtual_env: pathlib.Path, module_prefix: pathlib.Path)[source]
venvmod.modulefile.create_modulefile(virtual_env: pathlib.Path, module_name: str = 'venvmod', module_category: Optional[str] = None, log_load: str = '') int[source]

Creates a modulefile.

Parameters
  • module_name (str) – Name of the module to create

  • module_directory (Path) – Module directory

  • module_category (str, optional) – Module category, by default None

  • log_load (str, optional) – Loag edited at load, by default “”

venvmod.modulefile.upgrade_venv(virtual_env: pathlib.Path)[source]

Ugrade virtual env with modulefile at activate and deactivate.

Parameters

env_prefix (Path) – Path to environment.

Raises
  • AssertionError – If the activate script is not found.

  • AssertionError – If the module is already loaded frome the script but from another modulefile directory.