Ejemplo n.º 1
0
def setup_parser(subparser):
    subparser.epilog = """\
for further documentation regarding the spec syntax, see:
    spack help --spec
"""
    arguments.add_common_arguments(
        subparser, ['long', 'very_long', 'install_status'])
    subparser.add_argument(
        '-y', '--yaml', action='store_const', dest='format', default=None,
        const='yaml', help='print concrete spec as YAML')
    subparser.add_argument(
        '-j', '--json', action='store_const', dest='format', default=None,
        const='json', help='print concrete spec as JSON')
    subparser.add_argument(
        '-c', '--cover', action='store',
        default='nodes', choices=['nodes', 'edges', 'paths'],
        help='how extensively to traverse the DAG (default: nodes)')
    subparser.add_argument(
        '-N', '--namespaces', action='store_true', default=False,
        help='show fully qualified package names')
    subparser.add_argument(
        '--hash-type', default="build_hash",
        choices=['build_hash', 'full_hash', 'dag_hash'],
        help='generate spec with a particular hash type.')
    subparser.add_argument(
        '-t', '--types', action='store_true', default=False,
        help='show dependency types')
    arguments.add_common_arguments(subparser, ['specs'])
Ejemplo n.º 2
0
def setup_parser(subparser):
    subparser.epilog = 'If called without argument returns ' \
                       'the list of all valid extendable packages'
    arguments.add_common_arguments(subparser, ['long', 'very_long'])
    subparser.add_argument('-d',
                           '--deps',
                           action='store_true',
                           help='output dependencies along with found specs')

    subparser.add_argument('-p',
                           '--paths',
                           action='store_true',
                           help='show paths to package install directories')
    subparser.add_argument('-s',
                           '--show',
                           action='store',
                           default='all',
                           choices=("packages", "installed", "activated",
                                    "all"),
                           help="show only part of output")
    subparser.add_argument('-v',
                           '--view',
                           metavar='VIEW',
                           type=str,
                           help="the view to operate on")

    subparser.add_argument('spec',
                           nargs=argparse.REMAINDER,
                           help='spec of package to list extensions for',
                           metavar='extendable')
Ejemplo n.º 3
0
def setup_parser(subparser):
    setup_parser.parser = subparser

    method = subparser.add_mutually_exclusive_group()
    method.add_argument('-a',
                        '--ascii',
                        action='store_true',
                        help="draw graph as ascii to stdout (default)")
    method.add_argument(
        '-d',
        '--dot',
        action='store_true',
        help="generate graph in dot format and print to stdout")

    subparser.add_argument(
        '-s',
        '--static',
        action='store_true',
        help="graph static (possible) deps, don't concretize (implies --dot)")

    subparser.add_argument(
        '-i',
        '--installed',
        action='store_true',
        help="graph all installed specs in dot format (implies --dot)")

    arguments.add_common_arguments(subparser, ['deptype', 'specs'])
Ejemplo n.º 4
0
def setup_parser(subparser):
    subparser.add_argument(
        '-i',
        '--ignore-dependencies',
        action='store_true',
        dest='ignore_deps',
        help="do not try to install dependencies of requested packages")
    arguments.add_common_arguments(subparser, ['no_checksum', 'spec'])
    subparser.add_argument(
        '-v',
        '--verbose',
        action='store_true',
        dest='verbose',
        help="display verbose build output while installing")
    subparser.add_argument(
        '--shebang',
        action='store',
        dest='shebang',
        help="Command used to execute the script. "
        "If set to special string \"env\", "
        "then the python interpreter found in PATH is used. "
        "Default value is the python interpreter used by spack",
        default=None)

    cd_group = subparser.add_mutually_exclusive_group()
    arguments.add_common_arguments(cd_group, ['clean', 'dirty'])
    subparser.epilog = 'DEPRECATED: use `spack dev-build` instead'
Ejemplo n.º 5
0
def setup_parser(subparser):
    """Parser is only constructed so that this prints a nice help
       message with -h. """
    arguments.add_common_arguments(subparser, ['installed_specs'])

    shells = subparser.add_mutually_exclusive_group()
    shells.add_argument('--sh',
                        action='store_const',
                        dest='shell',
                        const='sh',
                        help="print sh commands to activate the environment")
    shells.add_argument('--csh',
                        action='store_const',
                        dest='shell',
                        const='csh',
                        help="print csh commands to activate the environment")
    shells.add_argument('--fish',
                        action='store_const',
                        dest='shell',
                        const='fish',
                        help="print fish commands to load the package")

    subparser.add_argument('-a',
                           '--all',
                           action='store_true',
                           help='unload all loaded Spack packages.')
Ejemplo n.º 6
0
def setup_parser(subparser):
    subparser.add_argument('-s',
                           '--stage',
                           action='store_true',
                           help="remove all temporary build stages (default)")
    subparser.add_argument('-d',
                           '--downloads',
                           action='store_true',
                           help="remove cached downloads")
    subparser.add_argument(
        '-m',
        '--misc-cache',
        action='store_true',
        help="remove long-lived caches, like the virtual package index")
    subparser.add_argument(
        '-p',
        '--python-cache',
        action='store_true',
        help="remove .pyc, .pyo files and __pycache__ folders")
    subparser.add_argument('-a',
                           '--all',
                           action=AllClean,
                           help="equivalent to -sdmp",
                           nargs=0)
    arguments.add_common_arguments(subparser, ['specs'])
Ejemplo n.º 7
0
Archivo: load.py Proyecto: slddd/spack
def setup_parser(subparser):
    """Parser is only constructed so that this prints a nice help
       message with -h. """
    arguments.add_common_arguments(
        subparser, ['recurse_dependencies', 'installed_specs'])

    shells = subparser.add_mutually_exclusive_group()
    shells.add_argument(
        '--sh', action='store_const', dest='shell', const='sh',
        help="print sh commands to load the package")
    shells.add_argument(
        '--csh', action='store_const', dest='shell', const='csh',
        help="print csh commands to load the package")
    shells.add_argument(
        '--fish', action='store_const', dest='shell', const='fish',
        help="print fish commands to load the package")

    subparser.add_argument(
        '--first',
        action='store_true',
        default=False,
        dest='load_first',
        help="load the first match if multiple packages match the spec"
    )

    subparser.add_argument(
        '--only',
        default='package,dependencies',
        dest='things_to_load',
        choices=['package', 'dependencies'],
        help="""select whether to load the package and its dependencies
the default is to load the package and all dependencies
alternatively one can decide to load only the package or only
the dependencies"""
    )
Ejemplo n.º 8
0
def add_common_arguments(subparser):
    subparser.add_argument(
        '-f', '--force', action='store_true', dest='force',
        help="remove regardless of whether other packages or environments "
        "depend on this one")
    arguments.add_common_arguments(
        subparser, ['recurse_dependents', 'yes_to_all'])
Ejemplo n.º 9
0
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ["jobs", "spec"])

    subparser.add_argument("--no_specyaml",
                           action="store_true",
                           help="Ignore spec.yaml")
    subparser.add_argument(
        "--test",
        choices=['root', 'dycore', 'all'],
        dest="things_to_test",
        help="""If root is chosen, run COSMO testsuite before installation 
        (but skip tests for dependencies). If dycore is chosen, 
        run test for Dycore and COSMO testsuite.
        If all is chosen, 
        run package tests during installation for all packages.""")
    subparser.add_argument("-c",
                           "--clean_build",
                           action="store_true",
                           help="Clean dev-build")

    subparser.add_argument(
        '--dont-restage',
        action='store_false',
        dest="restage",
        help="if a partial install is detected, don’t delete prior state")

    subparser.add_argument(
        '-u',
        '--until',
        dest='until',
        default=None,
        help="phase to stop after when installing (only applies to COSMO)")
Ejemplo n.º 10
0
def setup_parser(subparser):
    subparser.add_argument(
        '--keep-stage',
        action='store_true',
        default=False,
        help="don't clean up staging area when command completes")
    sp = subparser.add_mutually_exclusive_group()
    sp.add_argument('-b',
                    '--batch',
                    action='store_true',
                    default=False,
                    help="don't ask which versions to checksum")
    sp.add_argument('-l',
                    '--latest',
                    action='store_true',
                    default=False,
                    help="checksum the latest available version only")
    sp.add_argument('-p',
                    '--preferred',
                    action='store_true',
                    default=False,
                    help="checksum the preferred version only")
    arguments.add_common_arguments(subparser, ['package'])
    subparser.add_argument('versions',
                           nargs=argparse.REMAINDER,
                           help='versions to generate checksums for')
Ejemplo n.º 11
0
def setup_parser(subparser):
    subparser.add_argument('-l',
                           '--list-name',
                           dest='list_name',
                           default='specs',
                           help="name of the list to add specs to")
    arguments.add_common_arguments(subparser, ['specs'])
Ejemplo n.º 12
0
def parser():
    p = argparse.ArgumentParser()
    arguments.add_common_arguments(p, ['jobs'])
    yield p
    # Cleanup the command line scope if it was set during tests
    if 'command_line' in spack.config.config.scopes:
        spack.config.config.scopes['command_line'].clear()
Ejemplo n.º 13
0
def add_common_arguments(subparser):
    subparser.add_argument(
        '-f', '--force', action='store_true', dest='force',
        help="remove regardless of whether other packages or environments "
        "depend on this one")
    arguments.add_common_arguments(
        subparser, ['recurse_dependents', 'yes_to_all'])
Ejemplo n.º 14
0
Archivo: diy.py Proyecto: zepx/spack
def setup_parser(subparser):
    subparser.add_argument(
        '-i',
        '--ignore-dependencies',
        action='store_true',
        dest='ignore_deps',
        help="Do not try to install dependencies of requested packages.")
    subparser.add_argument(
        '--keep-prefix',
        action='store_true',
        help="Don't remove the install prefix if installation fails.")
    subparser.add_argument('--skip-patch',
                           action='store_true',
                           help="Skip patching for the DIY build.")
    subparser.add_argument(
        '-q',
        '--quiet',
        action='store_true',
        dest='quiet',
        help="Do not display verbose build output while installing.")
    subparser.add_argument(
        'spec',
        nargs=argparse.REMAINDER,
        help="specs to use for install.  Must contain package AND version.")

    cd_group = subparser.add_mutually_exclusive_group()
    arguments.add_common_arguments(cd_group, ['clean', 'dirty'])
Ejemplo n.º 15
0
def setup_parser(subparser):
    """Parser is only constructed so that this prints a nice help
       message with -h. """
    subparser.add_argument('spec',
                           nargs=argparse.REMAINDER,
                           help="spec of package to load with modules ")
    arguments.add_common_arguments(subparser, ['recurse_dependencies'])
Ejemplo n.º 16
0
def setup_parser(sp):
    setup_parser.parser = sp

    arguments.add_common_arguments(sp, ['yes_to_all'])

    deps = sp.add_mutually_exclusive_group()
    deps.add_argument('-d', '--dependencies', action='store_true',
                      default=True, dest='dependencies',
                      help='Deprecate dependencies (default)')
    deps.add_argument('-D', '--no-dependencies', action='store_false',
                      default=True, dest='dependencies',
                      help='Do not deprecate dependencies')

    install = sp.add_mutually_exclusive_group()
    install.add_argument('-i', '--install-deprecator', action='store_true',
                         default=False, dest='install',
                         help='Concretize and install deprecator spec')
    install.add_argument('-I', '--no-install-deprecator',
                         action='store_false', default=False, dest='install',
                         help='Deprecator spec must already be installed (default)')  # noqa 501

    sp.add_argument('-l', '--link-type', type=str,
                    default='soft', choices=['soft', 'hard'],
                    help="Type of filesystem link to use for deprecation (default soft)")  # noqa 501

    sp.add_argument('specs', nargs=argparse.REMAINDER,
                    help="spec to deprecate and spec to use as deprecator")
Ejemplo n.º 17
0
def setup_parser(subparser):
    subparser.add_argument(
        '-v', '--verbose',
        action='store_true',
        help="print additional output during builds"
    )
    arguments.add_common_arguments(subparser, ['spec'])
Ejemplo n.º 18
0
def setup_parser(subparser):
    sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='analyze_command')

    sp.add_parser('list-analyzers',
                  description="list available analyzers",
                  help="show list of analyzers that are available to run.")

    # This adds the monitor group to the subparser
    spack.monitor.get_monitor_group(subparser)

    # Run Parser
    run_parser = sp.add_parser('run', description="run an analyzer",
                               help="provide the name of the analyzer to run.")

    run_parser.add_argument(
        '--overwrite', action='store_true',
        help="re-analyze even if the output file already exists.")
    run_parser.add_argument(
        '-p', '--path', default=None,
        dest='path',
        help="write output to a different directory than ~/.spack/analyzers")
    run_parser.add_argument(
        '-a', '--analyzers', default=None,
        dest="analyzers", action="append",
        help="add an analyzer (defaults to all available)")
    arguments.add_common_arguments(run_parser, ['spec'])
Ejemplo n.º 19
0
def setup_parser(subparser):
    subparser.add_argument(
        '-j',
        '--jobs',
        action='store',
        type=int,
        help="explicitly set number of make jobs (default: #cpus)")
    subparser.add_argument(
        '--keep-prefix',
        action='store_true',
        dest='keep_prefix',
        help="don't remove the install prefix if installation fails")
    subparser.add_argument(
        '--keep-stage',
        action='store_true',
        dest='keep_stage',
        help="don't remove the build stage if installation succeeds")
    arguments.add_common_arguments(subparser, ['no_checksum'])
    subparser.add_argument(
        '-v',
        '--verbose',
        action='store_true',
        dest='verbose',
        help="display verbose build output while installing")

    cd_group = subparser.add_mutually_exclusive_group()
    arguments.add_common_arguments(cd_group, ['clean', 'dirty'])
Ejemplo n.º 20
0
def setup_parser(subparser):
    epilog_msg = ("Specs to be uninstalled are specified using the spec syntax"
                  " (`spack help --spec`) and can be identified by their "
                  "hashes. To remove packages that are needed only at build "
                  "time and were not explicitly installed see `spack gc -h`."
                  "\n\nWhen using the --all option ALL packages matching the "
                  "supplied specs will be uninstalled. For instance, "
                  "`spack uninstall --all libelf` uninstalls all the versions "
                  "of `libelf` currently present in Spack's store. If no spec "
                  "is supplied, all installed packages will be uninstalled. "
                  "If used in an environment, all packages in the environment "
                  "will be uninstalled.")
    subparser.epilog = epilog_msg
    subparser.add_argument(
        '-f',
        '--force',
        action='store_true',
        dest='force',
        help="remove regardless of whether other packages or environments "
        "depend on this one")
    arguments.add_common_arguments(
        subparser, ['recurse_dependents', 'yes_to_all', 'installed_specs'])
    subparser.add_argument(
        '-a',
        '--all',
        action='store_true',
        dest='all',
        help="remove ALL installed packages that match each supplied spec")
Ejemplo n.º 21
0
def setup_parser(subparser):
    subparser.add_argument('-s',
                           '--stage',
                           action='store_true',
                           help="remove all temporary build stages (default)")
    subparser.add_argument('-d',
                           '--downloads',
                           action='store_true',
                           help="remove cached downloads")
    subparser.add_argument(
        '-f',
        '--failures',
        action='store_true',
        help="force removal of all install failure tracking markers")
    subparser.add_argument(
        '-m',
        '--misc-cache',
        action='store_true',
        help="remove long-lived caches, like the virtual package index")
    subparser.add_argument(
        '-p',
        '--python-cache',
        action='store_true',
        help="remove .pyc, .pyo files and __pycache__ folders")
    subparser.add_argument('-b',
                           '--bootstrap',
                           action='store_true',
                           help="remove software needed to bootstrap Spack")
    subparser.add_argument('-a',
                           '--all',
                           action=AllClean,
                           help="equivalent to -sdfmpb",
                           nargs=0)
    arguments.add_common_arguments(subparser, ['specs'])
Ejemplo n.º 22
0
def setup_parser(subparser):
    subparser.add_argument(
        '-a',
        '--all',
        action='store_true',
        help="remove all specs from (clear) the environment")
    arguments.add_common_arguments(subparser, ['specs'])
Ejemplo n.º 23
0
def env_remove_setup_parser(subparser):
    """remove an existing environment"""
    subparser.add_argument('rm_env',
                           metavar='env',
                           nargs='+',
                           help='environment(s) to remove')
    arguments.add_common_arguments(subparser, ['yes_to_all'])
Ejemplo n.º 24
0
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ['long', 'very_long'])
    subparser.add_argument('-y',
                           '--yaml',
                           action='store_true',
                           default=False,
                           help='print concrete spec as YAML')
    subparser.add_argument(
        '-c',
        '--cover',
        action='store',
        default='nodes',
        choices=['nodes', 'edges', 'paths'],
        help='how extensively to traverse the DAG (default: nodes)')
    subparser.add_argument('-N',
                           '--namespaces',
                           action='store_true',
                           default=False,
                           help='show fully qualified package names')
    subparser.add_argument(
        '-I',
        '--install-status',
        action='store_true',
        default=False,
        help='show install status of packages. packages can be: '
        'installed [+], missing and needed by an installed package [-], '
        'or not installed (no annotation)')
    subparser.add_argument('-t',
                           '--types',
                           action='store_true',
                           default=False,
                           help='show dependency types')
    subparser.add_argument('specs',
                           nargs=argparse.REMAINDER,
                           help="specs of packages")
Ejemplo n.º 25
0
Archivo: use.py Proyecto: matzke1/spack
def setup_parser(subparser):
    """Parser is only constructed so that this prints a nice help
       message with -h. """
    subparser.add_argument(
        'spec', nargs=argparse.REMAINDER,
        help='spec of package to use with dotkit')
    arguments.add_common_arguments(subparser, ['recurse_dependencies'])
Ejemplo n.º 26
0
def setup_parser(subparser):
    output = subparser.add_mutually_exclusive_group()
    output.add_argument('-s',
                        '--safe',
                        action='store_true',
                        help='only list safe versions of the package')
    output.add_argument('--safe-only',
                        action='store_true',
                        help='[deprecated] only list safe versions '
                        'of the package')
    output.add_argument('-r',
                        '--remote',
                        action='store_true',
                        help='only list remote versions of the package')
    output.add_argument('-n',
                        '--new',
                        action='store_true',
                        help='only list remote versions newer than '
                        'the latest checksummed version')
    subparser.add_argument('-c',
                           '--concurrency',
                           default=32,
                           type=int,
                           help='number of concurrent requests')
    arguments.add_common_arguments(subparser, ['package'])
Ejemplo n.º 27
0
def setup_parser(subparser):
    arguments.add_common_arguments(subparser,
                                   ['long', 'very_long', 'install_status'])
    subparser.add_argument('-y',
                           '--yaml',
                           action='store_true',
                           default=False,
                           help='print concrete spec as YAML')
    subparser.add_argument(
        '-c',
        '--cover',
        action='store',
        default='nodes',
        choices=['nodes', 'edges', 'paths'],
        help='how extensively to traverse the DAG (default: nodes)')
    subparser.add_argument('-N',
                           '--namespaces',
                           action='store_true',
                           default=False,
                           help='show fully qualified package names')

    subparser.add_argument('-t',
                           '--types',
                           action='store_true',
                           default=False,
                           help='show dependency types')
    subparser.add_argument('specs',
                           nargs=argparse.REMAINDER,
                           help="specs of packages")
Ejemplo n.º 28
0
Archivo: list.py Proyecto: eic/spack
def setup_parser(subparser):
    subparser.add_argument(
        'filter',
        nargs=argparse.REMAINDER,
        help='optional case-insensitive glob patterns to filter results')
    subparser.add_argument(
        '-d',
        '--search-description',
        action='store_true',
        default=False,
        help='filtering will also search the description for a match')
    subparser.add_argument(
        '--format',
        default='name_only',
        choices=formatters,
        help='format to be used to print the output [default: name_only]')
    subparser.add_argument(
        '--update',
        metavar='FILE',
        default=None,
        action='store',
        help='write output to the specified file, if any package is newer')
    subparser.add_argument('-v',
                           '--virtuals',
                           action='store_true',
                           default=False,
                           help='include virtual packages in list')

    arguments.add_common_arguments(subparser, ['tags'])
Ejemplo n.º 29
0
def setup_parser(sp):
    scopes = spack.config.scopes()
    sp.add_argument('-f', '--format',
                    help="specify format for path/module keys",
                    metavar="FMT", default='$_$@')
    sp.add_argument('-d', '--dependencies',
                    help="add selected dependencies to the specs",
                    action='store_true')
    sp.add_argument('-m', '--module',
                    choices=spack.modules.module_types.keys(),
                    default=None,
                    help="point to modules generated for MOD",
                    metavar="MOD")
    sp.add_argument("--scope", choices=scopes,
                    default=spack.config.default_modify_scope(),
                    help="configuration scope to modify.")
    sp.add_argument("-v", "--variants", choices=('all', 'changed'),
                    default='all',
                    help="which variant flags to store: only changed ones or all (default)")
    arguments.add_common_arguments(sp, ['tags', 'constraint'])
    sp.add_argument('--exclude', action='append', default=[],
                    help="exclude packages with names matching the given regex pattern")
    sp.add_argument('--explicit',
                    help='export specs that were installed explicitly',
                    default=None,
                    action='store_true')
Ejemplo n.º 30
0
def setup_parser(subparser):
    global directories
    directories = subparser.add_mutually_exclusive_group()

    directories.add_argument(
        '-m', '--module-dir', action='store_true',
        help="spack python module directory")
    directories.add_argument(
        '-r', '--spack-root', action='store_true',
        help="spack installation root")

    directories.add_argument(
        '-i', '--install-dir', action='store_true',
        help="install prefix for spec (spec need not be installed)")
    directories.add_argument(
        '-p', '--package-dir', action='store_true',
        help="directory enclosing a spec's package.py file")
    directories.add_argument(
        '-P', '--packages', action='store_true',
        help="top-level packages directory for Spack")
    directories.add_argument(
        '-s', '--stage-dir', action='store_true',
        help="stage directory for a spec")
    directories.add_argument(
        '-S', '--stages', action='store_true',
        help="top level stage directory")
    directories.add_argument(
        '-b', '--build-dir', action='store_true',
        help="checked out or expanded source directory for a spec "
             "(requires it to be staged first)")
    directories.add_argument(
        '-e', '--env', action='store',
        help="location of an environment managed by spack")

    arguments.add_common_arguments(subparser, ['spec'])
Ejemplo n.º 31
0
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ['no_checksum'])

    sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='mirror_command')

    # Create
    create_parser = sp.add_parser('create', help=mirror_create.__doc__)
    create_parser.add_argument('-d',
                               '--directory',
                               default=None,
                               help="directory in which to create mirror")
    create_parser.add_argument('specs',
                               nargs=argparse.REMAINDER,
                               help="specs of packages to put in mirror")
    create_parser.add_argument(
        '-f', '--file', help="file with specs of packages to put in mirror")
    create_parser.add_argument('-D',
                               '--dependencies',
                               action='store_true',
                               help="also fetch all dependencies")
    create_parser.add_argument(
        '-n',
        '--versions-per-spec',
        type=int,
        default=1,
        help="the number of versions to fetch for each spec")

    # used to construct scope arguments below
    scopes = spack.config.scopes()
    scopes_metavar = spack.config.scopes_metavar

    # Add
    add_parser = sp.add_parser('add', help=mirror_add.__doc__)
    add_parser.add_argument('name', help="mnemonic name for mirror")
    add_parser.add_argument(
        'url', help="url of mirror directory from 'spack mirror create'")
    add_parser.add_argument('--scope',
                            choices=scopes,
                            metavar=scopes_metavar,
                            default=spack.config.default_modify_scope(),
                            help="configuration scope to modify")

    # Remove
    remove_parser = sp.add_parser('remove',
                                  aliases=['rm'],
                                  help=mirror_remove.__doc__)
    remove_parser.add_argument('name')
    remove_parser.add_argument('--scope',
                               choices=scopes,
                               metavar=scopes_metavar,
                               default=spack.config.default_modify_scope(),
                               help="configuration scope to modify")

    # List
    list_parser = sp.add_parser('list', help=mirror_list.__doc__)
    list_parser.add_argument('--scope',
                             choices=scopes,
                             metavar=scopes_metavar,
                             default=spack.config.default_list_scope(),
                             help="configuration scope to read from")
Ejemplo n.º 32
0
def setup_parser(subparser):
    format_group = subparser.add_mutually_exclusive_group()
    format_group.add_argument('-s', '--short',
                              action='store_const',
                              dest='mode',
                              const='short',
                              default='short',
                              help='show only specs (default)')
    format_group.add_argument('-p', '--paths',
                              action='store_const',
                              dest='mode',
                              const='paths',
                              help='show paths to package install directories')
    format_group.add_argument(
        '-d', '--deps',
        action='store_const',
        dest='mode',
        const='deps',
        help='show full dependency DAG of installed packages')

    arguments.add_common_arguments(subparser, ['long', 'very_long'])

    subparser.add_argument('-f', '--show-flags',
                           action='store_true',
                           dest='show_flags',
                           help='show spec compiler flags')
    implicit_explicit = subparser.add_mutually_exclusive_group()
    implicit_explicit.add_argument(
        '-e', '--explicit',
        action='store_true',
        help='show only specs that were installed explicitly')
    implicit_explicit.add_argument(
        '-E', '--implicit',
        action='store_true',
        help='show only specs that were installed as dependencies')
    subparser.add_argument(
        '-u', '--unknown',
        action='store_true',
        dest='unknown',
        help='show only specs Spack does not have a package for')
    subparser.add_argument(
        '-m', '--missing',
        action='store_true',
        dest='missing',
        help='show missing dependencies as well as installed specs')
    subparser.add_argument(
        '-v', '--variants',
        action='store_true',
        dest='variants',
        help='show variants in output (can be long)')
    subparser.add_argument('-M', '--only-missing',
                           action='store_true',
                           dest='only_missing',
                           help='show only missing dependencies')
    subparser.add_argument('-N', '--namespace',
                           action='store_true',
                           help='show fully qualified package names')

    arguments.add_common_arguments(subparser, ['constraint'])
Ejemplo n.º 33
0
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ['no_checksum'])
    subparser.add_argument(
        '-p', '--path', dest='path',
        help="path to stage package, does not add to spack tree")

    subparser.add_argument(
        'specs', nargs=argparse.REMAINDER, help="specs of packages to stage")
Ejemplo n.º 34
0
Archivo: fetch.py Proyecto: LLNL/spack
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ['no_checksum'])
    subparser.add_argument(
        '-m', '--missing', action='store_true',
        help="fetch only missing (not yet installed) dependencies")
    subparser.add_argument(
        '-D', '--dependencies', action='store_true',
        help="also fetch all dependencies")
    subparser.add_argument(
        'packages', nargs=argparse.REMAINDER,
        help="specs of packages to fetch")
Ejemplo n.º 35
0
Archivo: list.py Proyecto: LLNL/spack
def setup_parser(subparser):
    subparser.add_argument(
        'filter', nargs=argparse.REMAINDER,
        help='optional case-insensitive glob patterns to filter results')
    subparser.add_argument(
        '-d', '--search-description', action='store_true', default=False,
        help='filtering will also search the description for a match')
    subparser.add_argument(
        '--format', default='name_only', choices=formatters,
        help='format to be used to print the output [default: name_only]')

    arguments.add_common_arguments(subparser, ['tags'])
Ejemplo n.º 36
0
def setup_parser(subparser):
    subparser.add_argument(
        '--only',
        default='package,dependencies',
        dest='things_to_install',
        choices=['package', 'dependencies'],
        help="""select the mode of installation.
the default is to install the package along with all its dependencies.
alternatively one can decide to install only the package or only
the dependencies"""
    )
    subparser.add_argument(
        '-j', '--jobs', action='store', type=int,
        help="explicitly set number of make jobs. default is #cpus")
    subparser.add_argument(
        '--keep-prefix', action='store_true', dest='keep_prefix',
        help="don't remove the install prefix if installation fails")
    subparser.add_argument(
        '--keep-stage', action='store_true', dest='keep_stage',
        help="don't remove the build stage if installation succeeds")
    subparser.add_argument(
        '-n', '--no-checksum', action='store_true', dest='no_checksum',
        help="do not check packages against checksum")
    subparser.add_argument(
        '-v', '--verbose', action='store_true', dest='verbose',
        help="display verbose build output while installing")
    subparser.add_argument(
        '--fake', action='store_true', dest='fake',
        help="fake install. just remove prefix and create a fake file")

    cd_group = subparser.add_mutually_exclusive_group()
    arguments.add_common_arguments(cd_group, ['clean', 'dirty'])

    subparser.add_argument(
        'package',
        nargs=argparse.REMAINDER,
        help="spec of the package to install"
    )
    subparser.add_argument(
        '--run-tests', action='store_true', dest='run_tests',
        help="run package level tests during installation"
    )
    subparser.add_argument(
        '--log-format',
        default=None,
        choices=['junit'],
        help="format to be used for log files"
    )
    subparser.add_argument(
        '--log-file',
        default=None,
        help="filename for the log file. if not passed a default will be used"
    )
Ejemplo n.º 37
0
Archivo: mirror.py Proyecto: LLNL/spack
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ['no_checksum'])

    sp = subparser.add_subparsers(
        metavar='SUBCOMMAND', dest='mirror_command')

    # Create
    create_parser = sp.add_parser('create', help=mirror_create.__doc__)
    create_parser.add_argument('-d', '--directory', default=None,
                               help="directory in which to create mirror")
    create_parser.add_argument(
        'specs', nargs=argparse.REMAINDER,
        help="specs of packages to put in mirror")
    create_parser.add_argument(
        '-f', '--file', help="file with specs of packages to put in mirror")
    create_parser.add_argument(
        '-D', '--dependencies', action='store_true',
        help="also fetch all dependencies")
    create_parser.add_argument(
        '-o', '--one-version-per-spec', action='store_const',
        const=1, default=0,
        help="only fetch one 'preferred' version per spec, not all known")

    # used to construct scope arguments below
    scopes = spack.config.scopes()
    scopes_metavar = spack.config.scopes_metavar

    # Add
    add_parser = sp.add_parser('add', help=mirror_add.__doc__)
    add_parser.add_argument('name', help="mnemonic name for mirror")
    add_parser.add_argument(
        'url', help="url of mirror directory from 'spack mirror create'")
    add_parser.add_argument(
        '--scope', choices=scopes, metavar=scopes_metavar,
        default=spack.config.default_modify_scope(),
        help="configuration scope to modify")

    # Remove
    remove_parser = sp.add_parser('remove', aliases=['rm'],
                                  help=mirror_remove.__doc__)
    remove_parser.add_argument('name')
    remove_parser.add_argument(
        '--scope', choices=scopes, metavar=scopes_metavar,
        default=spack.config.default_modify_scope(),
        help="configuration scope to modify")

    # List
    list_parser = sp.add_parser('list', help=mirror_list.__doc__)
    list_parser.add_argument(
        '--scope', choices=scopes, metavar=scopes_metavar,
        default=spack.config.default_list_scope(),
        help="configuration scope to read from")
Ejemplo n.º 38
0
def setup_parser(subparser):
    subparser.add_argument(
        '-i', '--ignore-dependencies', action='store_true', dest='ignore_deps',
        help="Do not try to install dependencies of requested packages.")
    subparser.add_argument(
        '-v', '--verbose', action='store_true', dest='verbose',
        help="Display verbose build output while installing.")
    subparser.add_argument(
        'spec', nargs=argparse.REMAINDER,
        help="specs to use for install.  Must contain package AND version.")

    cd_group = subparser.add_mutually_exclusive_group()
    arguments.add_common_arguments(cd_group, ['clean', 'dirty'])
Ejemplo n.º 39
0
def add_loads_arguments(subparser):
    subparser.add_argument(
        '--input-only', action='store_false', dest='shell',
        help='generate input for module command (instead of a shell script)'
    )
    subparser.add_argument(
        '-p', '--prefix', dest='prefix', default='',
        help='prepend to module names when issuing module load commands'
    )
    subparser.add_argument(
        '-x', '--exclude', dest='exclude', action='append', default=[],
        help="exclude package from output; may be specified multiple times"
    )
    arguments.add_common_arguments(
        subparser, ['recurse_dependencies']
    )
Ejemplo n.º 40
0
def setup_parser(subparser):
    subparser.add_argument(
        '-j', '--jobs', action='store', type=int,
        help="explicitly set number of make jobs (default: #cpus)")
    subparser.add_argument(
        '--keep-prefix', action='store_true', dest='keep_prefix',
        help="don't remove the install prefix if installation fails")
    subparser.add_argument(
        '--keep-stage', action='store_true', dest='keep_stage',
        help="don't remove the build stage if installation succeeds")
    arguments.add_common_arguments(subparser, ['no_checksum'])
    subparser.add_argument(
        '-v', '--verbose', action='store_true', dest='verbose',
        help="display verbose build output while installing")

    cd_group = subparser.add_mutually_exclusive_group()
    arguments.add_common_arguments(cd_group, ['clean', 'dirty'])
Ejemplo n.º 41
0
def setup_parser(subparser):
    subparser.add_argument(
        '-i', '--ignore-dependencies', action='store_true', dest='ignore_deps',
        help="don't try to install dependencies of requested packages")
    subparser.add_argument(
        '--keep-prefix', action='store_true',
        help="do not remove the install prefix if installation fails")
    subparser.add_argument(
        '--skip-patch', action='store_true',
        help="skip patching for the DIY build")
    subparser.add_argument(
        '-q', '--quiet', action='store_true', dest='quiet',
        help="do not display verbose build output while installing")
    subparser.add_argument(
        'spec', nargs=argparse.REMAINDER,
        help="specs to use for install. must contain package AND version")

    cd_group = subparser.add_mutually_exclusive_group()
    arguments.add_common_arguments(cd_group, ['clean', 'dirty'])
Ejemplo n.º 42
0
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ['long', 'very_long'])
    subparser.add_argument(
        '-y', '--yaml', action='store_true', default=False,
        help='print concrete spec as YAML')
    subparser.add_argument(
        '-c', '--cover', action='store',
        default='nodes', choices=['nodes', 'edges', 'paths'],
        help='how extensively to traverse the DAG (default: nodes)')
    subparser.add_argument(
        '-N', '--namespaces', action='store_true', default=False,
        help='show fully qualified package names')
    subparser.add_argument(
        '-I', '--install-status', action='store_true', default=False,
        help='show install status of packages. packages can be: '
             'installed [+], missing and needed by an installed package [-], '
             'or not installed (no annotation)')
    subparser.add_argument(
        '-t', '--types', action='store_true', default=False,
        help='show dependency types')
    subparser.add_argument(
        'specs', nargs=argparse.REMAINDER, help="specs of packages")
Ejemplo n.º 43
0
def setup_parser(subparser):
    sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='subparser_name')

    refresh_parser = sp.add_parser('refresh', help='regenerate module files')
    refresh_parser.add_argument(
        '--delete-tree',
        help='delete the module file tree before refresh',
        action='store_true'
    )
    arguments.add_common_arguments(
        refresh_parser, ['constraint', 'yes_to_all']
    )

    find_parser = sp.add_parser('find', help='find module files for packages')
    find_parser.add_argument(
        '--full-path',
        help='display full path to module file',
        action='store_true'
    )
    arguments.add_common_arguments(
        find_parser, ['constraint', 'recurse_dependencies']
    )

    rm_parser = sp.add_parser('rm', help='remove module files')
    arguments.add_common_arguments(
        rm_parser, ['constraint', 'yes_to_all']
    )

    loads_parser = sp.add_parser(
        'loads',
        help='prompt the list of modules associated with a constraint'
    )
    loads_parser.add_argument(
        '--input-only', action='store_false', dest='shell',
        help='generate input for module command (instead of a shell script)'
    )
    loads_parser.add_argument(
        '-p', '--prefix', dest='prefix', default='',
        help='prepend to module names when issuing module load commands'
    )
    loads_parser.add_argument(
        '-x', '--exclude', dest='exclude', action='append', default=[],
        help="exclude package from output; may be specified multiple times"
    )
    arguments.add_common_arguments(
        loads_parser, ['constraint', 'recurse_dependencies']
    )
    return sp
Ejemplo n.º 44
0
def setup_parser(subparser):
    sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='subparser_name')

    refresh_parser = sp.add_parser('refresh', help='regenerate module files')
    refresh_parser.add_argument(
        '--delete-tree',
        help='delete the module file tree before refresh',
        action='store_true'
    )
    arguments.add_common_arguments(
        refresh_parser, ['constraint', 'yes_to_all']
    )

    find_parser = sp.add_parser('find', help='find module files for packages')
    find_parser.add_argument(
        '--full-path',
        help='display full path to module file',
        action='store_true'
    )
    arguments.add_common_arguments(
        find_parser, ['constraint', 'recurse_dependencies']
    )

    rm_parser = sp.add_parser('rm', help='remove module files')
    arguments.add_common_arguments(
        rm_parser, ['constraint', 'yes_to_all']
    )

    loads_parser = sp.add_parser(
        'loads',
        help='prompt the list of modules associated with a constraint'
    )
    add_loads_arguments(loads_parser)
    arguments.add_common_arguments(loads_parser, ['constraint'])

    return sp
Ejemplo n.º 45
0
Archivo: patch.py Proyecto: LLNL/spack
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ['no_checksum'])
    subparser.add_argument(
        'packages', nargs=argparse.REMAINDER,
        help="specs of packages to stage")
Ejemplo n.º 46
0
def setup_parser(subparser):
    subparser.add_argument(
        '--only',
        default='package,dependencies',
        dest='things_to_install',
        choices=['package', 'dependencies'],
        help="""select the mode of installation.
the default is to install the package along with all its dependencies.
alternatively one can decide to install only the package or only
the dependencies"""
    )
    arguments.add_common_arguments(subparser, ['jobs', 'install_status'])
    subparser.add_argument(
        '--overwrite', action='store_true',
        help="reinstall an existing spec, even if it has dependents")
    subparser.add_argument(
        '--keep-prefix', action='store_true',
        help="don't remove the install prefix if installation fails")
    subparser.add_argument(
        '--keep-stage', action='store_true',
        help="don't remove the build stage if installation succeeds")
    subparser.add_argument(
        '--dont-restage', action='store_true',
        help="if a partial install is detected, don't delete prior state")

    cache_group = subparser.add_mutually_exclusive_group()
    cache_group.add_argument(
        '--use-cache', action='store_true', dest='use_cache', default=True,
        help="check for pre-built Spack packages in mirrors (default)")
    cache_group.add_argument(
        '--no-cache', action='store_false', dest='use_cache', default=True,
        help="do not check for pre-built Spack packages in mirrors")

    subparser.add_argument(
        '--show-log-on-error', action='store_true',
        help="print full build log to stderr if build fails")
    subparser.add_argument(
        '--source', action='store_true', dest='install_source',
        help="install source files in prefix")
    arguments.add_common_arguments(subparser, ['no_checksum'])
    subparser.add_argument(
        '-v', '--verbose', action='store_true',
        help="display verbose build output while installing")
    subparser.add_argument(
        '--fake', action='store_true',
        help="fake install for debug purposes.")
    subparser.add_argument(
        '--only-concrete', action='store_true', default=False,
        help='(with environment) only install already concretized specs')
    subparser.add_argument(
        '-f', '--file', action='append', default=[],
        dest='specfiles', metavar='SPEC_YAML_FILE',
        help="install from file. Read specs to install from .yaml files")

    cd_group = subparser.add_mutually_exclusive_group()
    arguments.add_common_arguments(cd_group, ['clean', 'dirty'])

    subparser.add_argument(
        'package',
        nargs=argparse.REMAINDER,
        help="spec of the package to install"
    )
    testing = subparser.add_mutually_exclusive_group()
    testing.add_argument(
        '--test', default=None,
        choices=['root', 'all'],
        help="""If 'root' is chosen, run package tests during
installation for top-level packages (but skip tests for dependencies).
if 'all' is chosen, run package tests during installation for all
packages. If neither are chosen, don't run tests for any packages."""
    )
    testing.add_argument(
        '--run-tests', action='store_true',
        help='run package tests during installation (same as --test=all)'
    )
    subparser.add_argument(
        '--log-format',
        default=None,
        choices=spack.report.valid_formats,
        help="format to be used for log files"
    )
    subparser.add_argument(
        '--log-file',
        default=None,
        help="filename for the log file. if not passed a default will be used"
    )
    subparser.add_argument(
        '--cdash-upload-url',
        default=None,
        help="CDash URL where reports will be uploaded"
    )
    arguments.add_common_arguments(subparser, ['yes_to_all'])
Ejemplo n.º 47
0
def setup_parser(subparser):
    arguments.add_common_arguments(subparser, ['clean', 'dirty'])
    subparser.add_argument(
        'spec', nargs=argparse.REMAINDER,
        help="specs of package environment to emulate")
Ejemplo n.º 48
0
Archivo: env.py Proyecto: LLNL/spack
def env_remove_setup_parser(subparser):
    """remove an existing environment"""
    subparser.add_argument(
        'rm_env', metavar='ENV', nargs='+',
        help='environment(s) to remove')
    arguments.add_common_arguments(subparser, ['yes_to_all'])