Skip to content

Commit

Permalink
Merge pull request #1265 from mvdbeek/autoupdate_cmd_fixes
Browse files Browse the repository at this point in the history
Allow running autoupdate against external server
  • Loading branch information
nsoranzo committed Feb 22, 2023
2 parents ef68fb3 + 5a3d8be commit 53cbcbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion planemo/commands/cmd_autoupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def skip_requirements_option() -> Callable:
@test_option()
@skiplist_option()
@skip_requirements_option()
@options.serve_engine_option()
@options.test_options()
@options.galaxy_target_options()
@options.galaxy_config_options()
Expand All @@ -81,6 +82,7 @@ def skip_requirements_option() -> Callable:
@options.fail_level_option()
@options.galaxy_url_option()
@options.galaxy_user_key_option()
@options.galaxy_admin_key_option()
@command_function
def cli(ctx, paths, **kwds): # noqa C901
"""Auto-update tool requirements by checking against Conda and updating if newer versions are available."""
Expand Down Expand Up @@ -126,7 +128,7 @@ def cli(ctx, paths, **kwds): # noqa C901

if modified_workflows and not kwds.get("dry_run"):
assert is_galaxy_engine(**kwds)
if kwds.get("engine") != "external_galaxy":
if kwds.get("engine") != "external_galaxy" or kwds.get("galaxy_admin_key"):
kwds["install_most_recent_revision"] = True
kwds["install_resolver_dependencies"] = False
kwds["install_repository_dependencies"] = False
Expand Down
5 changes: 2 additions & 3 deletions tests/test_cmd_autoupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ def test_autoupdate_no_update_needed(self):
def test_autoupdate_workflow(self):
"""Test autoupdate command for a workflow is needed."""
with self._isolate_with_test_data("wf_repos/autoupdate_tests") as f:
wf_file = os.path.join(f, "diff-refactor-test.ga")
autoupdate_command = ["autoupdate", wf_file, "--galaxy_branch", "dev"] # need >= 21.05
wf_file = os.path.realpath(os.path.join(f, "diff-refactor-test.ga"))
autoupdate_command = ["autoupdate", wf_file]
result = self._runner.invoke(self._cli.planemo, autoupdate_command)

assert f"Auto-updating workflow {wf_file}" in result.output
with open(wf_file) as g:
wf = json.load(g)
Expand Down

0 comments on commit 53cbcbf

Please sign in to comment.