venvmod.commands.create_module module

Commands to create a modulefile.

venvmod.commands.create_module.initialize(virtual_env: Optional[pathlib.Path] = None, version_or_path: str = '5.4.0', read_env: bool = False) int[source]

Initialize a venv-modulefile environment

Parameters
  • virtual_env (Path, optional) – If None, arguments are read from venvmod.commands.get_parser() function, else the path to the virtual env, by default None

  • version_or_path (str, optional) – Modulefile version to use if not found or version < 4.6. It can be a source directory to avoid donloading, by default “5.4.0”

  • read_env (bool, optional) – Read environment variables associated to the appli, by default False

Returns

return code

Return type

int

venvmod.commands.create_module.add_appli(virtual_env: Optional[pathlib.Path] = None, applis: Optional[List[str]] = None, read_env: bool = False, disconnect: bool = False) int[source]

Add application modulefiles to the environment.

This call also use the venvmod.commands.append_module.read_env() function for each appli.

Parameters
  • virtual_env (Path, optional) – If None, arguments are read from venvmod.commands.get_parser() function, else the path to the virtual env, by default None

  • applis (List[str], optional) – List of module file to create in addition to those given through cli, by default None

  • read_env (bool, optional) – Read environment variables associated to the appli, by default False

  • disconnect (bool, optional) – True to avoid loading appli when virtual env is loaded, by default False