System Tools#
wellies.tools.Tool(name, depends=[], load='', unload='', setup='', options={})
#
A tool is a software that can be loaded/unloaded in the task script. The tool can be a module, a package, a virtual environment, etc. A tool provides three scripts: - load: script to load the tool - unload: script to unload the tool - setup: script to install the tool (in the deploy family)
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
wellies.tools.ModuleTool(name, module_name, version, depends=[], options={})
#
Bases: Tool
A module tool is a tool that can be loaded/unloaded using the module system.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
wellies.tools.PrivateModuleTool(name, module_name, version, modulefiles, depends=[], options={})
#
Bases: Tool
Extension of the ModuleTool class to load a module from a custom modulefile path.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
wellies.tools.EnvVarTool(name, var, value, setup=None, depends=[], options={})
#
Bases: Tool
Environment variable tool. When loading, it set the environment variable to the given value. If the value contains the string PATH (for instance PATH or PYTHONPATH), then the value is added to the environment variable. For instance: export PATH=/this/his/the/path:$PATH
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
Installables#
wellies.tools.PackageTool(name, lib_dir, options)
#
Bases: Tool
Package tool that installs a user package in an environment. The package is downloaded in the lib_dir/build directory and the user must provide a script to install the package in the environment.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
Environments#
wellies.tools.FolderTool(name, lib_dir, depends=[], options={})
#
Bases: EnvVarTool
Folder tool extending the environment variable tool. It updates the PATH environment variable to include the folder located in lib_dir/name.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
wellies.tools.VirtualEnvTool(name, lib_dir, venv_options='', extra_packages=[], depends=[], options={})
#
Bases: Tool
A tool that creates a python virtual environment and sets the right scripts to load it, unload it and install it.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
wellies.tools.SystemEnvTool(name, lib_dir, venv_options='', extra_packages=[], depends=[], options={})
#
Bases: VirtualEnvTool
An extension of the VirtualEnvTool class that creates a python virtual environment that extends the current environment, i.e. with the --system-site-packages option.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
wellies.tools.CondaEnvTool(name, environment, setup=None, depends=[], conda_activate_cmd='conda', options={})
#
Bases: Tool
An environment tool that can load and unload a conda environment.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
wellies.tools.FileCondaEnvTool(name, lib_dir, env_file, depends=[], conda_cmd='conda', conda_activate_cmd='conda', options={})
#
Bases: CondaEnvTool
An extension of the CondaEnvTool class that also creates a conda environment in the lib directory. The conda environment is created from a conda environment file. The path to the environment file is specified as a dictionary following the StaticData options format, for instance:
my_env:
env_file:
type: copy
source: /path/to/environment.yml
my_env2:
env_file:
type: git
source: git@github.com:myrepo.git
branch: master
files: myenvironment.yml
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
wellies.tools.SimpleCondaEnvTool(name, lib_dir, packages, depends=[], conda_cmd='conda', conda_activate_cmd='conda', options={})
#
Bases: CondaEnvTool
An extension of the CondaEnvTool class that also creates a conda environment in the lib directory. The conda environment is created from a list of conda packages.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
Tool Store#
wellies.tools.ToolStore(lib_dir, options)
#
The ToolStore class is a container for all the tools of a suite. The constructor parses the options and creates the tools.
| Parameters: |
|
|---|
Source code in wellies/tools.py
Methods:#
add_tool(toolname, tool)
#
Adds a tool to the tool store.
| Parameters: |
|
|---|
Source code in wellies/tools.py
depends(toolname)
#
Returns the dependencies of a tool.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wellies/tools.py
load(tools)
#
Returns the load script of one or multiple tools.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wellies/tools.py
setup(toolname)
#
Returns the setup script of the tool.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wellies/tools.py
tool_script(script_type, toolname)
#
Returns the script of a tool and its dependencies.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wellies/tools.py
unload(tools)
#
Returns the unload script of one or multiple tools. In this case we reverse the dependency order to unload the tools.
| Parameters: |
|
|---|
| Returns: |
|
|---|