spack.cmd package¶
Submodules¶
spack.cmd.activate module¶
-
spack.cmd.activate.activate(parser, args)¶
-
spack.cmd.activate.setup_parser(subparser)¶
spack.cmd.bootstrap module¶
-
spack.cmd.bootstrap.bootstrap(parser, args)¶
-
spack.cmd.bootstrap.get_origin_info(remote)¶
-
spack.cmd.bootstrap.setup_parser(subparser)¶
spack.cmd.build module¶
-
spack.cmd.build.build(parser, args)¶
-
spack.cmd.build.setup_parser(subparser)¶
spack.cmd.cd module¶
-
spack.cmd.cd.cd(parser, args)¶
-
spack.cmd.cd.setup_parser(subparser)¶ This is for decoration – spack cd is used through spack’s shell support. This allows spack cd to print a descriptive help message when called with -h.
spack.cmd.checksum module¶
-
spack.cmd.checksum.checksum(parser, args)¶
-
spack.cmd.checksum.get_checksums(versions, urls, **kwargs)¶
-
spack.cmd.checksum.setup_parser(subparser)¶
spack.cmd.clean module¶
-
spack.cmd.clean.clean(parser, args)¶
-
spack.cmd.clean.setup_parser(subparser)¶
spack.cmd.compiler module¶
-
spack.cmd.compiler.compiler(parser, args)¶
-
spack.cmd.compiler.compiler_find(args)¶ Search either $PATH or a list of paths OR MODULES for compilers and add them to Spack’s configuration.
-
spack.cmd.compiler.compiler_info(args)¶ Print info about all compilers matching a spec.
-
spack.cmd.compiler.compiler_list(args)¶
-
spack.cmd.compiler.compiler_remove(args)¶
-
spack.cmd.compiler.setup_parser(subparser)¶
spack.cmd.compilers module¶
-
spack.cmd.compilers.compilers(parser, args)¶
-
spack.cmd.compilers.setup_parser(subparser)¶
spack.cmd.config module¶
-
spack.cmd.config.config(parser, args)¶
-
spack.cmd.config.config_edit(args)¶
-
spack.cmd.config.config_get(args)¶
-
spack.cmd.config.setup_parser(subparser)¶
spack.cmd.configure module¶
-
spack.cmd.configure.configure(parser, args)¶
-
spack.cmd.configure.setup_parser(subparser)¶
spack.cmd.create module¶
-
class
spack.cmd.create.AutotoolsGuess(name, url, version_hash_tuples)¶ Bases:
spack.cmd.create.DefaultGuessProvides appropriate overrides for autotools-based packages
-
base_class_name= 'AutotoolsPackage'¶
-
body= ' def configure_args(self):\n # FIXME: Add arguments other than --prefix\n # FIXME: If not needed delete the function\n args = []\n return args'¶
-
dependencies= " # FIXME: Add dependencies if required.\n # depends_on('m4', type='build')\n # depends_on('autoconf', type='build')\n # depends_on('automake', type='build')\n # depends_on('libtool', type='build')\n # depends_on('foo')"¶
-
-
class
spack.cmd.create.BazelGuess(name, url, version_hash_tuples)¶ Bases:
spack.cmd.create.DefaultGuessProvides appropriate overrides for bazel-based packages
-
body= ' def install(self, spec, prefix):\n # FIXME: Add logic to build and install here.\n bazel()'¶
-
dependencies= " # FIXME: Add additional dependencies if required.\n depends_on('bazel', type='build')"¶
-
-
class
spack.cmd.create.CMakeGuess(name, url, version_hash_tuples)¶ Bases:
spack.cmd.create.DefaultGuessProvides appropriate overrides for cmake-based packages
-
base_class_name= 'CMakePackage'¶
-
body= ' def cmake_args(self):\n # FIXME: Add arguments other than\n # FIXME: CMAKE_INSTALL_PREFIX and CMAKE_BUILD_TYPE\n # FIXME: If not needed delete the function\n args = []\n return args'¶
-
dependencies= " # FIXME: Add additional dependencies if required.\n depends_on('cmake', type='build')"¶
-
-
class
spack.cmd.create.DefaultGuess(name, url, version_hash_tuples)¶ Bases:
objectProvides the default values to be used for the package file template
-
base_class_name= 'Package'¶
-
body= " def install(self, spec, prefix):\n # FIXME: Unknown build system\n make()\n make('install')"¶
-
dependencies= " # FIXME: Add dependencies if required.\n # depends_on('foo')"¶
-
versions¶ Adds a version() call to the package for each version found.
-
-
class
spack.cmd.create.OctaveGuess(name, *args)¶ Bases:
spack.cmd.create.DefaultGuessProvides appropriate overrides for octave packages
-
body= " def install(self, spec, prefix):\n # FIXME: Add logic to build and install here.\n octave('--quiet', '--norc',\n '--built-in-docstrings-file=/dev/null',\n '--texi-macros-file=/dev/null',\n '--eval', 'pkg prefix {0}; pkg install {1}'.format(\n prefix, self.stage.archive_file))"¶
-
dependencies= " extends('octave')\n\n # FIXME: Add additional dependencies if required.\n # depends_on('octave-foo', type=nolink)"¶
-
-
class
spack.cmd.create.PythonGuess(name, *args)¶ Bases:
spack.cmd.create.DefaultGuessProvides appropriate overrides for python extensions
-
body= " def install(self, spec, prefix):\n # FIXME: Add logic to build and install here.\n setup_py('install', '--prefix={0}'.format(prefix))"¶
-
dependencies= " extends('python')\n\n # FIXME: Add additional dependencies if required.\n # depends_on('py-setuptools', type='build')\n # depends_on('py-foo', type=nolink)"¶
-
-
class
spack.cmd.create.RGuess(name, *args)¶ Bases:
spack.cmd.create.DefaultGuessProvides appropriate overrides for R extensions
-
body= " def install(self, spec, prefix):\n # FIXME: Add logic to build and install here.\n R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),\n self.stage.source_path)"¶
-
dependencies= " extends('R')\n\n # FIXME: Add additional dependencies if required.\n # depends_on('r-foo', type=nolink)"¶
-
-
class
spack.cmd.create.SconsGuess(name, url, version_hash_tuples)¶ Bases:
spack.cmd.create.DefaultGuessProvides appropriate overrides for scons-based packages
-
body= " def install(self, spec, prefix):\n # FIXME: Add logic to build and install here.\n scons('prefix={0}'.format(prefix))\n scons('install')"¶
-
dependencies= " # FIXME: Add additional dependencies if required.\n depends_on('scons', type='build')"¶
-
-
spack.cmd.create.create(parser, args)¶
-
spack.cmd.create.fetch_tarballs(url, name, version)¶ Try to find versions of the supplied archive by scraping the web. Prompts the user to select how many to download if many are found.
-
spack.cmd.create.find_repository(spec, args)¶
-
spack.cmd.create.guess_name_and_version(url, args)¶
-
spack.cmd.create.setup_parser(subparser)¶
spack.cmd.deactivate module¶
-
spack.cmd.deactivate.deactivate(parser, args)¶
-
spack.cmd.deactivate.setup_parser(subparser)¶
spack.cmd.debug module¶
-
spack.cmd.debug.create_db_tarball(args)¶
-
spack.cmd.debug.debug(parser, args)¶
-
spack.cmd.debug.setup_parser(subparser)¶
spack.cmd.dependents module¶
-
spack.cmd.dependents.dependents(parser, args)¶
-
spack.cmd.dependents.setup_parser(subparser)¶
spack.cmd.edit module¶
-
spack.cmd.edit.edit(parser, args)¶
-
spack.cmd.edit.edit_package(name, repo_path, namespace, force=False)¶
-
spack.cmd.edit.setup_parser(subparser)¶
spack.cmd.extensions module¶
-
spack.cmd.extensions.extensions(parser, args)¶
-
spack.cmd.extensions.setup_parser(subparser)¶
spack.cmd.fetch module¶
-
spack.cmd.fetch.fetch(parser, args)¶
-
spack.cmd.fetch.setup_parser(subparser)¶
spack.cmd.find module¶
-
spack.cmd.find.find(parser, args)¶
-
spack.cmd.find.query_arguments(args)¶
-
spack.cmd.find.setup_parser(subparser)¶
spack.cmd.flake8 module¶
-
spack.cmd.flake8.changed_files()¶ Get list of changed files in the Spack repository.
-
spack.cmd.flake8.exclude_directories= ['/home/docs/checkouts/readthedocs.org/user_builds/nersc-spack/checkouts/nersc_tutorial/lib/spack/external']¶ - This is a dict that maps:
- filename pattern ->
- a flake8 exemption code ->
- list of patterns, for which matching lines should have codes applied.
-
spack.cmd.flake8.filter_file(source, dest, output=False)¶ Filter a single file through all the patterns in exemptions.
-
spack.cmd.flake8.flake8(parser, args)¶
-
spack.cmd.flake8.include_untracked= True¶ List of directories to exclude from checks.
-
spack.cmd.flake8.setup_parser(subparser)¶
spack.cmd.graph module¶
-
spack.cmd.graph.graph(parser, args)¶
-
spack.cmd.graph.setup_parser(subparser)¶
spack.cmd.info module¶
-
spack.cmd.info.info(parser, args)¶
-
spack.cmd.info.padder(str_list, extra=0)¶ Return a function to pad elements of a list.
-
spack.cmd.info.print_text_info(pkg)¶ Print out a plain text description of a package.
-
spack.cmd.info.setup_parser(subparser)¶
spack.cmd.install module¶
-
class
spack.cmd.install.TestCase(classname, name)¶ Bases:
object-
results= {0: None, 1: 'failure', 2: 'skipped', 3: 'error'}¶
-
set_duration(duration)¶
-
set_result(result_type, message=None, error_type=None, text=None)¶
-
-
spack.cmd.install.default_log_file(spec)¶ Computes the default filename for the log file and creates the corresponding directory if not present
-
spack.cmd.install.fetch_text(path)¶
-
spack.cmd.install.install(parser, args, **kwargs)¶
-
spack.cmd.install.junit_output(spec, test_suite)¶
-
spack.cmd.install.setup_parser(subparser)¶
spack.cmd.list module¶
-
spack.cmd.list.filter_by_name(pkgs, args)¶ Filters the sequence of packages according to user prescriptions
- Args:
- pkgs: sequence of packages args: parsed command line arguments
- Returns:
- filtered and sorted list of packages
-
spack.cmd.list.formatter(func)¶ Decorator used to register formatters
-
spack.cmd.list.list(parser, args)¶
-
spack.cmd.list.name_only(pkgs)¶
-
spack.cmd.list.rst(pkgs)¶ Print out information on all packages in restructured text.
-
spack.cmd.list.setup_parser(subparser)¶
spack.cmd.load module¶
-
spack.cmd.load.load(parser, args)¶
-
spack.cmd.load.setup_parser(subparser)¶ Parser is only constructed so that this prints a nice help message with -h.
spack.cmd.location module¶
-
spack.cmd.location.location(parser, args)¶
-
spack.cmd.location.setup_parser(subparser)¶
spack.cmd.md5 module¶
-
spack.cmd.md5.compute_md5_checksum(url)¶
-
spack.cmd.md5.md5(parser, args)¶
-
spack.cmd.md5.normalized(files)¶
-
spack.cmd.md5.setup_parser(subparser)¶
spack.cmd.mirror module¶
-
spack.cmd.mirror.mirror(parser, args)¶
-
spack.cmd.mirror.mirror_add(args)¶ Add a mirror to Spack.
-
spack.cmd.mirror.mirror_create(args)¶ Create a directory to be used as a spack mirror, and fill it with package archives.
-
spack.cmd.mirror.mirror_list(args)¶ Print out available mirrors to the console.
-
spack.cmd.mirror.mirror_remove(args)¶ Remove a mirror by name.
-
spack.cmd.mirror.setup_parser(subparser)¶
spack.cmd.module module¶
-
exception
spack.cmd.module.MultipleMatches¶ Bases:
exceptions.Exception
-
exception
spack.cmd.module.NoMatch¶ Bases:
exceptions.Exception
-
spack.cmd.module.find(mtype, specs, args)¶ Look at all installed packages and see if the spec provided matches any. If it does, check whether there is a module file of type <mtype> there, and print out the name that the user should type to use that package’s module.
-
spack.cmd.module.loads(mtype, specs, args)¶ Prompt the list of modules associated with a list of specs
-
spack.cmd.module.module(parser, args)¶
-
spack.cmd.module.refresh(mtype, specs, args)¶ Regenerate module files for item in specs
-
spack.cmd.module.rm(mtype, specs, args)¶ Deletes module files associated with items in specs
-
spack.cmd.module.setup_parser(subparser)¶
-
spack.cmd.module.subcommand(subparser_name)¶ Registers a function in the callbacks dictionary
spack.cmd.patch module¶
-
spack.cmd.patch.patch(parser, args)¶
-
spack.cmd.patch.setup_parser(subparser)¶
spack.cmd.pkg module¶
-
spack.cmd.pkg.diff_packages(rev1, rev2)¶
-
spack.cmd.pkg.get_git()¶
-
spack.cmd.pkg.list_packages(rev)¶
-
spack.cmd.pkg.pkg(parser, args)¶
-
spack.cmd.pkg.pkg_add(args)¶
-
spack.cmd.pkg.pkg_added(args)¶ Show packages added since a commit.
-
spack.cmd.pkg.pkg_diff(args)¶ Compare packages available in two different git revisions.
-
spack.cmd.pkg.pkg_list(args)¶ List packages associated with a particular spack git revision.
-
spack.cmd.pkg.pkg_removed(args)¶ Show packages removed since a commit.
-
spack.cmd.pkg.setup_parser(subparser)¶
spack.cmd.providers module¶
-
spack.cmd.providers.providers(parser, args)¶
-
spack.cmd.providers.setup_parser(subparser)¶
spack.cmd.purge module¶
-
spack.cmd.purge.purge(parser, args)¶
-
spack.cmd.purge.setup_parser(subparser)¶
spack.cmd.python module¶
-
spack.cmd.python.python(parser, args)¶
-
spack.cmd.python.setup_parser(subparser)¶
spack.cmd.repo module¶
-
spack.cmd.repo.repo(parser, args)¶
-
spack.cmd.repo.repo_add(args)¶ Add a package source to Spack’s configuration.
-
spack.cmd.repo.repo_create(args)¶ Create a new package repository.
-
spack.cmd.repo.repo_list(args)¶ Show registered repositories and their namespaces.
-
spack.cmd.repo.repo_remove(args)¶ Remove a repository from Spack’s configuration.
-
spack.cmd.repo.setup_parser(subparser)¶
spack.cmd.restage module¶
-
spack.cmd.restage.restage(parser, args)¶
-
spack.cmd.restage.setup_parser(subparser)¶
spack.cmd.setup module¶
-
spack.cmd.setup.setup(self, args)¶
-
spack.cmd.setup.setup_parser(subparser)¶
-
spack.cmd.setup.spack_transitive_include_path()¶
-
spack.cmd.setup.write_spconfig(package)¶
spack.cmd.stage module¶
-
spack.cmd.stage.setup_parser(subparser)¶
-
spack.cmd.stage.stage(parser, args)¶
spack.cmd.test module¶
-
spack.cmd.test.do_list(args, unknown_args)¶ Print a lists of tests than what pytest offers.
-
spack.cmd.test.setup_parser(subparser)¶
-
spack.cmd.test.test(parser, args, unknown_args)¶
spack.cmd.uninstall module¶
-
spack.cmd.uninstall.concretize_specs(specs, allow_multiple_matches=False, force=False)¶ Returns a list of specs matching the non necessarily concretized specs given from cli
- Args:
- specs: list of specs to be matched against installed packages allow_multiple_matches : if True multiple matches are admitted
- Return:
- list of specs
-
spack.cmd.uninstall.do_uninstall(specs, force)¶ Uninstalls all the specs in a list.
- Args:
- specs: list of specs to be uninstalled force: force uninstallation (boolean)
-
spack.cmd.uninstall.get_uninstall_list(args)¶
-
spack.cmd.uninstall.installed_dependents(specs)¶ Returns a dictionary that maps a spec with a list of its installed dependents
- Args:
- specs: list of specs to be checked for dependents
- Returns:
- dictionary of installed dependents
-
spack.cmd.uninstall.setup_parser(subparser)¶
-
spack.cmd.uninstall.uninstall(parser, args)¶
spack.cmd.unload module¶
-
spack.cmd.unload.setup_parser(subparser)¶ Parser is only constructed so that this prints a nice help message with -h.
-
spack.cmd.unload.unload(parser, args)¶
spack.cmd.unuse module¶
-
spack.cmd.unuse.setup_parser(subparser)¶ Parser is only constructed so that this prints a nice help message with -h.
-
spack.cmd.unuse.unuse(parser, args)¶
spack.cmd.url_parse module¶
-
spack.cmd.url_parse.print_name_and_version(url)¶
-
spack.cmd.url_parse.setup_parser(subparser)¶
-
spack.cmd.url_parse.url_parse(parser, args)¶
spack.cmd.use module¶
-
spack.cmd.use.setup_parser(subparser)¶ Parser is only constructed so that this prints a nice help message with -h.
-
spack.cmd.use.use(parser, args)¶
spack.cmd.versions module¶
-
spack.cmd.versions.setup_parser(subparser)¶
-
spack.cmd.versions.versions(parser, args)¶
spack.cmd.view module¶
Produce a “view” of a Spack DAG.
A “view” is file hierarchy representing the union of a number of Spack-installed package file hierarchies. The union is formed from:
- specs resolved from the package names given by the user (the seeds)
- all depenencies of the seeds unless user specifies –no-depenencies
- less any specs with names matching the regular expressions given by –exclude
The view can be built and tore down via a number of methods (the “actions”):
- symlink :: a file system view which is a directory hierarchy that is the union of the hierarchies of the installed packages in the DAG where installed files are referenced via symlinks.
- hardlink :: like the symlink view but hardlinks are used.
- statlink :: a view producing a status report of a symlink or hardlink view.
The file system view concept is imspired by Nix, implemented by brett.viren@gmail.com ca 2016.
-
spack.cmd.view.assuredir(path)¶ Assure path exists as a directory
-
spack.cmd.view.check_one(spec, path, verbose=False)¶ Check status of view in path against spec
-
spack.cmd.view.filter_exclude(specs, exclude)¶ Filter specs given sequence of exclude regex
-
spack.cmd.view.flatten(seeds, descend=True)¶ Normalize and flattend seed specs and descend hiearchy
-
spack.cmd.view.link_one(spec, path, link=<built-in function symlink>, verbose=False)¶ Link all files in spec into directory path.
-
spack.cmd.view.purge_empty_directories(path)¶ Ascend up from the leaves accessible from path and remove empty directories.
-
spack.cmd.view.relative_to(prefix, path)¶ Return end of path relative to prefix
-
spack.cmd.view.remove_one(spec, path, verbose=False)¶ Remove any files found in spec from path and purge empty directories.
-
spack.cmd.view.setup_parser(sp)¶
-
spack.cmd.view.transform_path(spec, path, prefix=None)¶ Return the a relative path corresponding to given path spec.prefix
-
spack.cmd.view.view(parser, args)¶ Produce a view of a set of packages.
-
spack.cmd.view.visitor_add(specs, args)¶ Symlink all files found in specs
-
spack.cmd.view.visitor_check(specs, args)¶ Give status of view in args.path relative to specs
-
spack.cmd.view.visitor_hard(specs, args)¶ Hardlink all files found in specs
-
spack.cmd.view.visitor_hardlink(specs, args)¶ Hardlink all files found in specs
-
spack.cmd.view.visitor_remove(specs, args)¶ Remove all files and directories found in specs from args.path
-
spack.cmd.view.visitor_rm(specs, args)¶ Remove all files and directories found in specs from args.path
-
spack.cmd.view.visitor_soft(specs, args)¶ Symlink all files found in specs
-
spack.cmd.view.visitor_statlink(specs, args)¶ Give status of view in args.path relative to specs
-
spack.cmd.view.visitor_status(specs, args)¶ Give status of view in args.path relative to specs
-
spack.cmd.view.visitor_symlink(specs, args)¶ Symlink all files found in specs
Module contents¶
-
spack.cmd.ask_for_confirmation(message)¶
-
spack.cmd.disambiguate_spec(spec)¶
-
spack.cmd.display_specs(specs, **kwargs)¶
-
spack.cmd.elide_list(line_list, max_num=10)¶ Takes a long list and limits it to a smaller number of elements, replacing intervening elements with ‘...’. For example:
elide_list([1,2,3,4,5,6], 4)
gives:
[1, 2, 3, '...', 6]
-
spack.cmd.get_cmd_function_name(name)¶
-
spack.cmd.get_command(name)¶ Imports the command’s function from a module and returns it.
-
spack.cmd.get_module(name)¶ Imports the module for a particular command name and returns it.
-
spack.cmd.gray_hash(spec, length)¶
-
spack.cmd.parse_specs(args, **kwargs)¶ Convenience function for parsing arguments from specs. Handles common exceptions and dies if there are errors.
-
spack.cmd.remove_options(parser, *options)¶ Remove some options from a parser.