From b806367aa7c83199ba51e98a75bcfea5120f5216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Tue, 31 Oct 2023 13:08:38 +0100 Subject: [PATCH] Fix linting --- bin/extract_galaxy_tools.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/bin/extract_galaxy_tools.py b/bin/extract_galaxy_tools.py index e28449ac..e0656f5c 100644 --- a/bin/extract_galaxy_tools.py +++ b/bin/extract_galaxy_tools.py @@ -135,7 +135,7 @@ def check_categories(ts_categories, ts_cat): :param ts_cat: list of ToolShed categories to keep in the extraction """ if ts_categories is not None and len(ts_cat) > 0: - ts_cats = ts_categories.split(', ') + ts_cats = ts_categories.split(", ") to_keep = False for cat in ts_cats: if cat in ts_cat: @@ -145,12 +145,10 @@ def check_categories(ts_categories, ts_cat): def get_tool_metadata(tool, repo): - """" - Get tool information - - Check the `.shed.yaml` file - - Extract metadata from the `.shed.yaml` - - Extract the requirements in the macros or xml file to get tool version supported in Galaxy - - Extract bio.tools information if available in the macros or xml + """" " + Get tool metadata from the .shed.yaml, requirements in the macros or xml + file, bio.tools information if available in the macros or xml, EDAM + annotations using bio.tools API, recent conda version using conda API :param tool: GitHub ContentFile object :param repo: GitHub Repository object @@ -174,7 +172,7 @@ def get_tool_metadata(tool, repo): "Galaxy wrapper source": None, "Galaxy wrapper version": None, "Conda id": None, - "Conda version": None + "Conda version": None, } # extract .shed.yml information and check macros.xml try: @@ -368,7 +366,9 @@ def filter_tools(tools, ts_cat, excluded_tools, keep_tools): if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Extract Galaxy tools from GitHub repositories together with biotools and conda metadata") + parser = argparse.ArgumentParser( + description="Extract Galaxy tools from GitHub repositories together with biotools and conda metadata" + ) subparser = parser.add_subparsers(dest="command") # Extract tools extractools = subparser.add_parser("extractools", help="Extract tools") @@ -376,10 +376,19 @@ def filter_tools(tools, ts_cat, excluded_tools, keep_tools): extractools.add_argument("--all_tools", "-o", required=True, help="Filepath to CSV with all extracted tools") # Filter tools filtertools = subparser.add_parser("filtertools", help="Filter tools") - filtertools.add_argument("--tools", "-t", required=True, help="Filepath to CSV with all extracted tools, generated by extractools command") + filtertools.add_argument( + "--tools", + "-t", + required=True, + help="Filepath to CSV with all extracted tools, generated by extractools command", + ) filtertools.add_argument("--filtered_tools", "-f", required=True, help="Filepath to CSV with filtered tools") - filtertools.add_argument("--categories", "-c", help="Path to a file with ToolShed category to keep in the extraction (one per line)") - filtertools.add_argument("--exclude", "-e", help="Path to a file with ToolShed ids of tools to exclude (one per line)") + filtertools.add_argument( + "--categories", "-c", help="Path to a file with ToolShed category to keep in the extraction (one per line)" + ) + filtertools.add_argument( + "--exclude", "-e", help="Path to a file with ToolShed ids of tools to exclude (one per line)" + ) filtertools.add_argument("--keep", "-k", help="Path to a file with ToolShed ids of tools to keep (one per line)") args = parser.parse_args()