Skip to content

Commit

Permalink
Cleaning up (removing previous code on upgrade)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ausbeth committed Oct 23, 2024
1 parent eb61f9f commit be22d50
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 602 deletions.
34 changes: 1 addition & 33 deletions shpc/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,35 +332,6 @@ def get_parser():
action="store_true",
)

# Upgrade a software to its latest version
upgrade = subparsers.add_parser(
"upgrade",
description=help.upgrade_description,
formatter_class=argparse.RawTextHelpFormatter,
)
upgrade.add_argument(
"upgrade_recipe",
help="software to upgrade",
nargs="?",
)

upgrade.add_argument(
"--all",
"-a",
help="upgrade all installed software.",
dest="upgrade_all",
action="store_true",
)

upgrade.add_argument(
"--force",
"-f",
dest="force",
help="force upgrade without prompting for confirmation to uninstall current version(s) or install latest version to view(s).",
default=False,
action="store_true",
)

# Update gets latest tags from OCI registries
update = subparsers.add_parser(
"update",
Expand Down Expand Up @@ -414,7 +385,7 @@ def get_parser():
action="store_true",
)

for command in update, upgrade, install, sync:
for command in update, install, sync:
command.add_argument(
"--dry-run",
"-d",
Expand All @@ -437,7 +408,6 @@ def get_parser():
shell,
test,
uninstall,
upgrade,
view,
]:
command.add_argument(
Expand Down Expand Up @@ -585,8 +555,6 @@ def help(return_code=0):
from .uninstall import main
elif args.command == "update":
from .update import main
elif args.command == "upgrade":
from .upgrade import main
elif args.command == "sync-registry":
from .sync import sync_registry as main

Expand Down
33 changes: 0 additions & 33 deletions shpc/client/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,36 +253,3 @@
# Filter all modules to those with "python"
$ shpc show --filter python
"""

upgrade_description = """Upgrade software to the latest version.
# Upgrade a software to its latest version and give option to uninstall older versions or not.
# Do not include the version in the command
$ shpc upgrade quay.io/biocontainers/samtools
# Upgrade all software
$ shpc upgrade --all
OR
$ shpc upgrade -a
# Valid arguement combinations:
# Perform dry-run on a software to check if the latest is installed or not without upgrading it.
$ shpc upgrade quay.io/biocontainers/samtools --dry-run
OR
$ shpc upgrade quay.io/biocontainers/samtools -d
# Perform dry-run to show version details of all installed software, to check if the latest version is installed or not without upgrading them.
$ shpc upgrade --all --dry-run
OR
$ shpc upgrade -a -d
# Invalid arguement combinations:
$ shpc upgrade quay.io/biocontainers/samtools --all
OR
$ shpc upgrade quay.io/biocontainers/samtools -a
$ shpc upgrade quay.io/biocontainers/samtools --all --dry-run
OR
$ shpc upgrade quay.io/biocontainers/samtools -a -d
"""
190 changes: 0 additions & 190 deletions shpc/client/upgrade.py

This file was deleted.

10 changes: 0 additions & 10 deletions shpc/main/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ def install(self, name, tag=None, **kwargs):
"""
raise NotImplementedError

def upgrade(self, name, dryrun=False, force=False):
"""
Upgrade an outdated software
"""
from shpc.client.upgrade import upgrade

cli = self
args = {}
upgrade(name, cli, args, dryrun=dryrun, force=force)

def uninstall(self, name, tag=None):
"""
Uninstall must also implemented by the subclass (e.g., lmod)
Expand Down
Loading

0 comments on commit be22d50

Please sign in to comment.