From 74b0ba0e4784275ec61e3008099bbf3292612963 Mon Sep 17 00:00:00 2001 From: Simon Bray Date: Fri, 27 May 2022 13:00:12 +0200 Subject: [PATCH] fix bad merge and run black and isort --- planemo/engine/galaxy.py | 2 +- planemo/engine/test.py | 10 +++++----- planemo/options.py | 4 +++- planemo/runnable.py | 2 +- tests/test_cmd_serve.py | 8 +++++--- tests/test_galaxy_config.py | 5 ----- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/planemo/engine/galaxy.py b/planemo/engine/galaxy.py index 6b571b27b..8d72fb869 100644 --- a/planemo/engine/galaxy.py +++ b/planemo/engine/galaxy.py @@ -80,7 +80,7 @@ def _register_job_data(job_data): interactor.VERBOSE_GALAXY_ERRORS = True # on an external Galaxy it makes sense to keep test histories - no_history_cleanup = config._kwds.get('engine') == 'external_galaxy' + no_history_cleanup = config._kwds.get("engine") == "external_galaxy" interactor.verify_tool( tool_id, diff --git a/planemo/engine/test.py b/planemo/engine/test.py index d8a721081..034235af9 100644 --- a/planemo/engine/test.py +++ b/planemo/engine/test.py @@ -1,11 +1,11 @@ import os from planemo.engine import engine_context -from planemo.galaxy import galaxy_config -from planemo.galaxy import galaxy_serve -from planemo.galaxy.api import ( - DEFAULT_ADMIN_API_KEY +from planemo.galaxy import ( + galaxy_config, + galaxy_serve, ) +from planemo.galaxy.api import DEFAULT_ADMIN_API_KEY from planemo.galaxy.config import _find_test_data from planemo.galaxy.ephemeris_sleep import sleep from planemo.galaxy.test import ( @@ -24,7 +24,7 @@ def test_runnables(ctx, runnables, original_paths=None, **kwds): if kwds.get("serve"): if "galaxy" not in kwds["engine"]: raise ValueError("The serve option is only supported by Galaxy-based engines.") - kwds["galaxy_url"] = kwds["galaxy_url"] or ''.join(("http://", kwds["host"], ":", str(kwds["port"]))) + kwds["galaxy_url"] = kwds["galaxy_url"] or "".join(("http://", kwds["host"], ":", str(kwds["port"]))) kwds["galaxy_admin_key"] = kwds["galaxy_admin_key"] or DEFAULT_ADMIN_API_KEY pid = os.fork() if pid == 0: diff --git a/planemo/options.py b/planemo/options.py index 7142b9dcc..9d72f3251 100644 --- a/planemo/options.py +++ b/planemo/options.py @@ -887,7 +887,9 @@ def serve_option(): "--serve", is_flag=True, default=False, - help=("Continue serving Galaxy instance after testing. Like the serve command itself, this is only compatible with Galaxy-based engines.") + help=( + "Continue serving Galaxy instance after testing. Like the serve command itself, this is only compatible with Galaxy-based engines." + ), ) diff --git a/planemo/runnable.py b/planemo/runnable.py index 523d6afb4..1b52a73b9 100644 --- a/planemo/runnable.py +++ b/planemo/runnable.py @@ -494,7 +494,7 @@ def flatten_to_single_artifacts(runnables): if runnable.type.is_single_artifact: single_runnables.append(runnable) else: - paths = glob.glob(f'{runnable.path}/*') + paths = glob.glob(f"{runnable.path}/*") for path in paths: if os.path.isdir(path): continue diff --git a/tests/test_cmd_serve.py b/tests/test_cmd_serve.py index e90faba15..3bb7a0527 100644 --- a/tests/test_cmd_serve.py +++ b/tests/test_cmd_serve.py @@ -173,9 +173,11 @@ def test_workflow_test_with_serve(self): extra_args = [ "--serve", test_artifact, - "--port", str(self._port), + "--port", + str(self._port), "--no_dependency_resolution", - "--extra_tools", cat, + "--extra_tools", + cat, ] self._launch_thread_and_wait(self._run_test, extra_args) time.sleep(30) @@ -184,7 +186,7 @@ def test_workflow_test_with_serve(self): user_gi = self._user_gi workflows = user_gi.workflows.get_workflows() assert len(workflows) == 1 - assert workflows[0]['name'] == 'TestWorkflow1' + assert workflows[0]["name"] == "TestWorkflow1" histories = user_gi.histories.get_histories(name="CWL Target History") assert len(histories) == 1 diff --git a/tests/test_galaxy_config.py b/tests/test_galaxy_config.py index 505300f75..c8cf7442f 100644 --- a/tests/test_galaxy_config.py +++ b/tests/test_galaxy_config.py @@ -48,13 +48,8 @@ def test_refgenie_config_version(): version_path = os.path.join(galaxy_lib_path, "version.py") with open(version_path, "w") as version_fh: version_fh.write('VERSION_MAJOR = "21.05"') -<<<<<<< HEAD - refgenie_config = get_refgenie_config(galaxy_root=tdc.temp_directory, refgenie_dir='/') - assert yaml.load(refgenie_config, Loader=yaml.SafeLoader)['config_version'] == 0.3 -======= refgenie_config = get_refgenie_config(galaxy_root=tdc.temp_directory, refgenie_dir="/") assert yaml.load(refgenie_config, Loader=yaml.SafeLoader)["config_version"] == 0.3 ->>>>>>> upstream/master def _assert_property_is(config, prop, value):