Skip to content

Commit

Permalink
move --deprecated arg to concretizer args (spack#43177)
Browse files Browse the repository at this point in the history
  • Loading branch information
becker33 authored Mar 14, 2024
1 parent dc212d0 commit f549354
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 67 deletions.
8 changes: 8 additions & 0 deletions lib/spack/spack/cmd/common/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,14 @@ def add_concretizer_args(subparser):
default=None,
help="reuse installed dependencies only",
)
subgroup.add_argument(
"--deprecated",
action=ConfigSetAction,
dest="config:deprecated",
const=True,
default=None,
help="allow concretizer to select deprecated versions",
)


def add_connection_args(subparser, add_help):
Expand Down
7 changes: 1 addition & 6 deletions lib/spack/spack/cmd/dev_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def setup_parser(subparser):
arguments.add_common_arguments(subparser, ["jobs"])
arguments.add_common_arguments(subparser, ["jobs", "no_checksum", "spec"])
subparser.add_argument(
"-d",
"--source-path",
Expand All @@ -34,7 +34,6 @@ def setup_parser(subparser):
dest="ignore_deps",
help="do not try to install dependencies of requested packages",
)
arguments.add_common_arguments(subparser, ["no_checksum", "deprecated"])
subparser.add_argument(
"--keep-prefix",
action="store_true",
Expand Down Expand Up @@ -63,7 +62,6 @@ def setup_parser(subparser):
choices=["root", "all"],
help="run tests on only root packages or all packages",
)
arguments.add_common_arguments(subparser, ["spec"])

stop_group = subparser.add_mutually_exclusive_group()
stop_group.add_argument(
Expand Down Expand Up @@ -125,9 +123,6 @@ def dev_build(self, args):
if args.no_checksum:
spack.config.set("config:checksum", False, scope="command_line")

if args.deprecated:
spack.config.set("config:deprecated", True, scope="command_line")

tests = False
if args.test == "all":
tests = True
Expand Down
7 changes: 2 additions & 5 deletions lib/spack/spack/cmd/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


def setup_parser(subparser):
arguments.add_common_arguments(subparser, ["no_checksum", "deprecated"])
arguments.add_common_arguments(subparser, ["no_checksum", "specs"])
subparser.add_argument(
"-m",
"--missing",
Expand All @@ -28,7 +28,7 @@ def setup_parser(subparser):
subparser.add_argument(
"-D", "--dependencies", action="store_true", help="also fetch all dependencies"
)
arguments.add_common_arguments(subparser, ["specs"])
arguments.add_concretizer_args(subparser)
subparser.epilog = (
"With an active environment, the specs "
"parameter can be omitted. In this case all (uninstalled"
Expand All @@ -40,9 +40,6 @@ def fetch(parser, args):
if args.no_checksum:
spack.config.set("config:checksum", False, scope="command_line")

if args.deprecated:
spack.config.set("config:deprecated", True, scope="command_line")

if args.specs:
specs = spack.cmd.parse_specs(args.specs, concretize=True)
else:
Expand Down
5 changes: 1 addition & 4 deletions lib/spack/spack/cmd/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def setup_parser(subparser):
dest="install_source",
help="install source files in prefix",
)
arguments.add_common_arguments(subparser, ["no_checksum", "deprecated"])
arguments.add_common_arguments(subparser, ["no_checksum"])
subparser.add_argument(
"-v",
"--verbose",
Expand Down Expand Up @@ -326,9 +326,6 @@ def install(parser, args):
if args.no_checksum:
spack.config.set("config:checksum", False, scope="command_line")

if args.deprecated:
spack.config.set("config:deprecated", True, scope="command_line")

if args.log_file and not args.log_format:
msg = "the '--log-format' must be specified when using '--log-file'"
tty.die(msg)
Expand Down
6 changes: 2 additions & 4 deletions lib/spack/spack/cmd/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def setup_parser(subparser):
arguments.add_common_arguments(subparser, ["no_checksum", "deprecated"])
arguments.add_common_arguments(subparser, ["no_checksum"])

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

Expand Down Expand Up @@ -72,6 +72,7 @@ def setup_parser(subparser):
" retrieve all versions of each package",
)
arguments.add_common_arguments(create_parser, ["specs"])
arguments.add_concretizer_args(create_parser)

# Destroy
destroy_parser = sp.add_parser("destroy", help=mirror_destroy.__doc__)
Expand Down Expand Up @@ -549,7 +550,4 @@ def mirror(parser, args):
if args.no_checksum:
spack.config.set("config:checksum", False, scope="command_line")

if args.deprecated:
spack.config.set("config:deprecated", True, scope="command_line")

action[args.mirror_command](args)
5 changes: 1 addition & 4 deletions lib/spack/spack/cmd/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def setup_parser(subparser):
arguments.add_common_arguments(subparser, ["no_checksum", "deprecated", "specs"])
arguments.add_common_arguments(subparser, ["no_checksum", "specs"])
arguments.add_concretizer_args(subparser)


Expand All @@ -33,9 +33,6 @@ def patch(parser, args):
if args.no_checksum:
spack.config.set("config:checksum", False, scope="command_line")

if args.deprecated:
spack.config.set("config:deprecated", True, scope="command_line")

specs = spack.cmd.parse_specs(args.specs, concretize=False)
for spec in specs:
_patch(spack.cmd.matching_spec_from_env(spec).package)
Expand Down
5 changes: 1 addition & 4 deletions lib/spack/spack/cmd/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


def setup_parser(subparser):
arguments.add_common_arguments(subparser, ["no_checksum", "deprecated", "specs"])
arguments.add_common_arguments(subparser, ["no_checksum", "specs"])
subparser.add_argument(
"-p", "--path", dest="path", help="path to stage package, does not add to spack tree"
)
Expand All @@ -33,9 +33,6 @@ def stage(parser, args):
if args.no_checksum:
spack.config.set("config:checksum", False, scope="command_line")

if args.deprecated:
spack.config.set("config:deprecated", True, scope="command_line")

if not args.specs:
env = ev.active_environment()
if not env:
Expand Down
26 changes: 13 additions & 13 deletions share/spack/spack-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ _spack_bootstrap_mirror() {
_spack_build_env() {
if $list_options
then
SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --reuse-deps --dump --pickle"
SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --reuse-deps --deprecated --dump --pickle"
else
_all_packages
fi
Expand Down Expand Up @@ -812,11 +812,11 @@ _spack_compilers() {
}

_spack_concretize() {
SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse --reuse-deps -j --jobs"
SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse --reuse-deps --deprecated -j --jobs"
}

_spack_concretise() {
SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse --reuse-deps -j --jobs"
SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse --reuse-deps --deprecated -j --jobs"
}

_spack_config() {
Expand Down Expand Up @@ -990,7 +990,7 @@ _spack_deprecate() {
_spack_dev_build() {
if $list_options
then
SPACK_COMPREPLY="-h --help -j --jobs -d --source-path -i --ignore-dependencies -n --no-checksum --deprecated --keep-prefix --skip-patch -q --quiet --drop-in --test -b --before -u --until --clean --dirty -U --fresh --reuse --reuse-deps"
SPACK_COMPREPLY="-h --help -j --jobs -n --no-checksum -d --source-path -i --ignore-dependencies --keep-prefix --skip-patch -q --quiet --drop-in --test -b --before -u --until --clean --dirty -U --fresh --reuse --reuse-deps --deprecated"
else
_all_packages
fi
Expand Down Expand Up @@ -1170,7 +1170,7 @@ _spack_external_read_cray_manifest() {
_spack_fetch() {
if $list_options
then
SPACK_COMPREPLY="-h --help -n --no-checksum --deprecated -m --missing -D --dependencies"
SPACK_COMPREPLY="-h --help -n --no-checksum -m --missing -D --dependencies -U --fresh --reuse --reuse-deps --deprecated"
else
_all_packages
fi
Expand Down Expand Up @@ -1299,7 +1299,7 @@ _spack_info() {
_spack_install() {
if $list_options
then
SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --use-buildcache --include-build-deps --no-check-signature --show-log-on-error --source -n --no-checksum --deprecated -v --verbose --fake --only-concrete --add --no-add -f --file --clean --dirty --test --log-format --log-file --help-cdash --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp -y --yes-to-all -U --fresh --reuse --reuse-deps"
SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --use-buildcache --include-build-deps --no-check-signature --show-log-on-error --source -n --no-checksum -v --verbose --fake --only-concrete --add --no-add -f --file --clean --dirty --test --log-format --log-file --help-cdash --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp -y --yes-to-all -U --fresh --reuse --reuse-deps --deprecated"
else
_all_packages
fi
Expand Down Expand Up @@ -1401,7 +1401,7 @@ _spack_mark() {
_spack_mirror() {
if $list_options
then
SPACK_COMPREPLY="-h --help -n --no-checksum --deprecated"
SPACK_COMPREPLY="-h --help -n --no-checksum"
else
SPACK_COMPREPLY="create destroy add remove rm set-url set list"
fi
Expand All @@ -1410,7 +1410,7 @@ _spack_mirror() {
_spack_mirror_create() {
if $list_options
then
SPACK_COMPREPLY="-h --help -d --directory -a --all -f --file --exclude-file --exclude-specs --skip-unstable-versions -D --dependencies -n --versions-per-spec"
SPACK_COMPREPLY="-h --help -d --directory -a --all -f --file --exclude-file --exclude-specs --skip-unstable-versions -D --dependencies -n --versions-per-spec -U --fresh --reuse --reuse-deps --deprecated"
else
_all_packages
fi
Expand Down Expand Up @@ -1589,7 +1589,7 @@ _spack_module_tcl_setdefault() {
_spack_patch() {
if $list_options
then
SPACK_COMPREPLY="-h --help -n --no-checksum --deprecated -U --fresh --reuse --reuse-deps"
SPACK_COMPREPLY="-h --help -n --no-checksum -U --fresh --reuse --reuse-deps --deprecated"
else
_all_packages
fi
Expand Down Expand Up @@ -1817,7 +1817,7 @@ _spack_restage() {
_spack_solve() {
if $list_options
then
SPACK_COMPREPLY="-h --help --show -l --long -L --very-long -N --namespaces -I --install-status --no-install-status -y --yaml -j --json -c --cover -t --types --timers --stats -U --fresh --reuse --reuse-deps"
SPACK_COMPREPLY="-h --help --show -l --long -L --very-long -N --namespaces -I --install-status --no-install-status -y --yaml -j --json -c --cover -t --types --timers --stats -U --fresh --reuse --reuse-deps --deprecated"
else
_all_packages
fi
Expand All @@ -1826,7 +1826,7 @@ _spack_solve() {
_spack_spec() {
if $list_options
then
SPACK_COMPREPLY="-h --help -l --long -L --very-long -N --namespaces -I --install-status --no-install-status -y --yaml -j --json --format -c --cover -t --types -U --fresh --reuse --reuse-deps"
SPACK_COMPREPLY="-h --help -l --long -L --very-long -N --namespaces -I --install-status --no-install-status -y --yaml -j --json --format -c --cover -t --types -U --fresh --reuse --reuse-deps --deprecated"
else
_all_packages
fi
Expand All @@ -1835,7 +1835,7 @@ _spack_spec() {
_spack_stage() {
if $list_options
then
SPACK_COMPREPLY="-h --help -n --no-checksum --deprecated -p --path -U --fresh --reuse --reuse-deps"
SPACK_COMPREPLY="-h --help -n --no-checksum -p --path -U --fresh --reuse --reuse-deps --deprecated"
else
_all_packages
fi
Expand Down Expand Up @@ -1925,7 +1925,7 @@ _spack_test_remove() {
_spack_test_env() {
if $list_options
then
SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --reuse-deps --dump --pickle"
SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --reuse-deps --deprecated --dump --pickle"
else
_all_packages
fi
Expand Down
Loading

0 comments on commit f549354

Please sign in to comment.