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.
This commit is contained in:
John Chilton
2017-01-23 09:47:17 -05:00
parent cd2cf494fe
commit 330d71d37c
4 changed files with 17 additions and 85 deletions
+2 -27
View File
@@ -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)
+15 -24
View File
@@ -227,7 +227,7 @@ complete descriptions of the runtime of a tool.
</xs:sequence>
</xs:complexType>
<xs:complexType name="Requirement" mixed="true">
<xs:complexType name="Requirement">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
@@ -276,29 +276,20 @@ resolver.
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="specification" minOccurs="0" maxOccurs="unbounded" type="xs:anyType" />
</xs:sequence>
<xs:attribute name="type" type="RequirementType" use="required">
<xs:annotation>
<xs:documentation xml:lang="en"> This value defines the which type of the 3rd party module required by this tool. </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="version" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en"> For package type requirements this value defines a specific version of the tool dependency. </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Name of requirement (if body of ``requirement`` element contains specification URIs).</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="specification_uris" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">URIs and versions of requirement specification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="RequirementType" use="required">
<xs:annotation>
<xs:documentation xml:lang="en"> This value defines the which type of the 3rd party module required by this tool. </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="version" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en"> For package type requirements this value defines a specific version of the tool dependency. </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Container">
<xs:annotation>
@@ -1,18 +0,0 @@
<tool id="requirement_specification_1" name="requirement_specification_1" version="0.1.0" profile="16.10">
<command><![CDATA[
blastn -help > $out_file1 ;
echo "Moo" >> $out_file1 ;
]]></command>
<requirements>
<requirement type="package" version="2.2.31" name="blast+">
<specification uri="https://anaconda.org/bioconda/blast" />
<specification uri="https://packages.debian.org/sid/ncbi-blast+" version="2.2.31-3" />
</requirement>
</requirements>
<inputs>
<param name="input1" type="data" optional="true" />
</inputs>
<outputs>
<data name="out_file1" format="txt" />
</outputs>
</tool>
@@ -1,16 +0,0 @@
<tool id="requirement_specification_2" name="requirement_specification_2" version="0.1.0" profile="16.01">
<command><![CDATA[
blastn -help > $out_file1 ;
echo "Moo" >> $out_file1 ;
]]></command>
<requirements>
<!-- Demonstrate backward-compatible-ish specification_uri syntax. -->
<requirement type="package" version="2.2" specification_uris="https://anaconda.org/bioconda/blast@2.2.31,https://packages.debian.org/jessie/ncbi-blast+@2.2.29-3">blast+</requirement>
</requirements>
<inputs>
<param name="input1" type="data" optional="true" />
</inputs>
<outputs>
<data name="out_file1" format="txt" />
</outputs>
</tool>