From 330d71d37ce7eaa60b5c8c20ae83aeb36fec4a6c Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 18 Jan 2017 10:17:16 -0500 Subject: [PATCH] Remove tool XML modifications for requirement specifications. Per discussion on #3117 - some people were in favor of the idea but some were opposed. I think it is still important to implement this for CWL tools and useful from a library perspective. This just removes changes to Galaxy tool XML. --- lib/galaxy/tools/deps/requirements.py | 29 +------------- lib/galaxy/tools/xsd/galaxy.xsd | 39 +++++++------------ .../tools/requirement_specification_1.xml | 18 --------- .../tools/requirement_specification_2.xml | 16 -------- 4 files changed, 17 insertions(+), 85 deletions(-) delete mode 100644 test/functional/tools/requirement_specification_1.xml delete mode 100644 test/functional/tools/requirement_specification_2.xml diff --git a/lib/galaxy/tools/deps/requirements.py b/lib/galaxy/tools/deps/requirements.py index 2b041fc0348..92ba382e74b 100644 --- a/lib/galaxy/tools/deps/requirements.py +++ b/lib/galaxy/tools/deps/requirements.py @@ -210,29 +210,10 @@ def parse_requirements_from_xml( xml_root ): requirements = ToolRequirements() for requirement_elem in requirement_elems: - if "name" in requirement_elem.attrib: - name = requirement_elem.get( "name" ) - spec_elems = requirement_elem.findall("specification") - specs = map(specification_from_element, spec_elems) - else: - name = xml_text( requirement_elem ) - spec_uris_raw = requirement_elem.attrib.get("specification_uris", "") - specs = [] - for spec_uri in spec_uris_raw.split(","): - if not spec_uri: - continue - version = None - if "@" in spec_uri: - uri, version = spec_uri.split("@", 1) - else: - uri = spec_uri - uri = uri.strip() - if version: - version = version.strip() - specs.append(RequirementSpecification(uri, version)) + name = xml_text( requirement_elem ) type = requirement_elem.get( "type", DEFAULT_REQUIREMENT_TYPE ) version = requirement_elem.get( "version", DEFAULT_REQUIREMENT_VERSION ) - requirement = ToolRequirement( name=name, type=type, version=version, specs=specs ) + requirement = ToolRequirement( name=name, type=type, version=version ) requirements.append( requirement ) container_elems = [] @@ -244,12 +225,6 @@ def parse_requirements_from_xml( xml_root ): return requirements, containers -def specification_from_element(specification_elem): - uri = specification_elem.get("uri", None) - version = specification_elem.get("version", None) - return RequirementSpecification(uri, version) - - def container_from_element(container_elem): identifier = xml_text(container_elem) type = container_elem.get("type", DEFAULT_CONTAINER_TYPE) diff --git a/lib/galaxy/tools/xsd/galaxy.xsd b/lib/galaxy/tools/xsd/galaxy.xsd index 6790c324a0c..5b589306ac3 100644 --- a/lib/galaxy/tools/xsd/galaxy.xsd +++ b/lib/galaxy/tools/xsd/galaxy.xsd @@ -227,7 +227,7 @@ complete descriptions of the runtime of a tool. - + - - - - - - This value defines the which type of the 3rd party module required by this tool. - - - - - For package type requirements this value defines a specific version of the tool dependency. - - - - - Name of requirement (if body of ``requirement`` element contains specification URIs). - - - - - URIs and versions of requirement specification. - - + + + + + This value defines the which type of the 3rd party module required by this tool. + + + + + For package type requirements this value defines a specific version of the tool dependency. + + + + diff --git a/test/functional/tools/requirement_specification_1.xml b/test/functional/tools/requirement_specification_1.xml deleted file mode 100644 index 00744e114f4..00000000000 --- a/test/functional/tools/requirement_specification_1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - $out_file1 ; - echo "Moo" >> $out_file1 ; - ]]> - - - - - - - - - - - - - diff --git a/test/functional/tools/requirement_specification_2.xml b/test/functional/tools/requirement_specification_2.xml deleted file mode 100644 index e3190f068cc..00000000000 --- a/test/functional/tools/requirement_specification_2.xml +++ /dev/null @@ -1,16 +0,0 @@ - - $out_file1 ; - echo "Moo" >> $out_file1 ; - ]]> - - - blast+ - - - - - - - -