Skip to content
Snippets Groups Projects
Commit 904e1a73 authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

feat(spec): support `--test {None,all,root} for input specs

parent 06baf446
No related branches found
No related tags found
1 merge request!1Prepare for fetch cache
......@@ -70,6 +70,12 @@ def setup_parser(subparser):
subparser.add_argument(
"-t", "--types", action="store_true", default=False, help="show dependency types"
)
subparser.add_argument(
"--test",
default=None,
choices=["root", "all"],
help="concretize with test dependencies of only root packages or all packages",
)
arguments.add_common_arguments(subparser, ["specs"])
arguments.add_concretizer_args(subparser)
......@@ -98,9 +104,17 @@ def spec(parser, args):
# Use command line specified specs, otherwise try to use environment specs.
if args.specs:
input_specs = spack.cmd.parse_specs(args.specs)
concretized_specs = spack.cmd.parse_specs(args.specs, concretize=True)
if args.test == "all":
tests = True
elif args.test == "root":
tests = [spec.name for spec in input_specs]
else:
tests = False
concretized_specs = spack.cmd.parse_specs(args.specs, concretize=True, tests=tests)
specs = list(zip(input_specs, concretized_specs))
else:
if args.test is not None:
tty.die("spack spec for environments does not support test dependency selection")
env = ev.active_environment()
if env:
env.concretize()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment