venvmod.modulefile module

Environment module modification/installation.

venvmod.modulefile.get_module_file_directory(virtual_env: Path) Path[source]

Gets the modulefiles directory

Parameters:

virtual_env (Path) – Path to virtual env

Returns:

virtual_env path + “/etc/modulefiles”

Return type:

Path

venvmod.modulefile.test_if_already_init(virtual_env: Path)[source]

checks if venv-modulefile is already initialized.

Parameters:

virtual_env (Path) – Path to virtual env

class venvmod.modulefile.ModuleInstaller(version_or_path: str, install_prefix: str, cache_directory: str)[source]

Bases: object

Class to install Environment Module.

Methods

run([verbose])

run installer

__init__(version_or_path: str, install_prefix: str, cache_directory: str) None[source]
run(verbose: bool = False)[source]

run installer

Parameters:

verbose (bool, optional) – True to enable verbosity, by default False

venvmod.modulefile.upgrade_modulefile(virtual_env: Path, module_prefix: Path)[source]

Upgrade modulefile in venv

Parameters:
  • virtual_env (Path) – Path to virtual env

  • module_prefix (Path) – Modulefile install prefix

venvmod.modulefile.create_modulefile(virtual_env: Path, module_name: str = 'venvmod', module_category: str = None, log_load: str = '')[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: 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.