spack.cmd.modules package

Submodules

spack.cmd.modules.dotkit module

spack.cmd.modules.dotkit.add_command(parser, command_dict)

spack.cmd.modules.lmod module

spack.cmd.modules.lmod.add_command(parser, command_dict)
spack.cmd.modules.lmod.setdefault(module_type, specs, args)

Set the default module file, when multiple are present

spack.cmd.modules.tcl module

spack.cmd.modules.tcl.add_command(parser, command_dict)

Module contents

Implementation details of the spack module command.

exception spack.cmd.modules.MultipleSpecsMatch

Bases: Exception

Raised when multiple specs match a constraint, in a context where this is not allowed.

exception spack.cmd.modules.NoSpecMatches

Bases: Exception

Raised when no spec matches a constraint, in a context where this is not allowed.

spack.cmd.modules.add_loads_arguments(subparser)
spack.cmd.modules.callbacks = {'find': <function find at 0x7f3311cc0268>, 'loads': <function loads at 0x7f3311cc01e0>, 'refresh': <function refresh at 0x7f3311cc0378>, 'rm': <function rm at 0x7f3311cc02f0>}

Dictionary populated with the list of sub-commands. Each sub-command must be callable and accept 3 arguments:

  • module_type: the type of module it refers to
  • specs : the list of specs to be processed
  • args : namespace containing the parsed command line arguments
spack.cmd.modules.find(module_type, specs, args)

Returns the module file “use” name if there’s a single match. Raises error messages otherwise.

spack.cmd.modules.loads(module_type, specs, args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)

Prompt the list of modules associated with a list of specs

spack.cmd.modules.modules_cmd(parser, args, module_type, callbacks={'find': <function find at 0x7f3311cc0268>, 'loads': <function loads at 0x7f3311cc01e0>, 'refresh': <function refresh at 0x7f3311cc0378>, 'rm': <function rm at 0x7f3311cc02f0>})
spack.cmd.modules.one_spec_or_raise(specs)

Ensures exactly one spec has been selected, or raises the appropriate exception.

spack.cmd.modules.refresh(module_type, specs, args)

Regenerates the module files for every spec in specs and every module type in module types.

spack.cmd.modules.rm(module_type, specs, args)

Deletes the module files associated with every spec in specs, for every module type in module types.

spack.cmd.modules.setup_parser(subparser)