Skip to content

Commit

Permalink
Mark LoadListing as not in vocab so it must be fully qualified (#324)
Browse files Browse the repository at this point in the history
* Mark LoadListing as not in vocab so it must be fully qualified and not a
keyword.
  • Loading branch information
tetron authored Mar 8, 2017
1 parent db05d33 commit c088882
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions cwltool/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $graph:
- name: LoadListingRequirement
type: record
extends: cwl:ProcessRequirement
inVocab: false
fields:
class:
type: string
Expand Down
8 changes: 4 additions & 4 deletions cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"StepInputExpressionRequirement",
"ResourceRequirement",
"InitialWorkDirRequirement",
"LoadListingRequirement"]
"http://commonwl.org/cwltool#LoadListingRequirement"]

cwl_files = (
"Workflow.yml",
Expand Down Expand Up @@ -430,15 +430,15 @@ def __init__(self, toolpath_object, **kwargs):
self.outputs_record_schema["fields"].append(c)

try:
self.inputs_record_schema = schema_salad.schema.make_valid_avro(self.inputs_record_schema, {}, set())
self.inputs_record_schema = cast(Dict[unicode, Any], schema_salad.schema.make_valid_avro(self.inputs_record_schema, {}, set()))
avro.schema.make_avsc_object(self.inputs_record_schema, self.names)
except avro.schema.SchemaParseException as e:
raise validate.ValidationException(u"Got error `%s` while processing inputs of %s:\n%s" %
(Text(e), self.tool["id"],
json.dumps(self.inputs_record_schema, indent=4)))

try:
self.outputs_record_schema = schema_salad.schema.make_valid_avro(self.outputs_record_schema, {}, set())
self.outputs_record_schema = cast(Dict[unicode, Any], schema_salad.schema.make_valid_avro(self.outputs_record_schema, {}, set()))
avro.schema.make_avsc_object(self.outputs_record_schema, self.names)
except avro.schema.SchemaParseException as e:
raise validate.ValidationException(u"Got error `%s` while processing outputs of %s:\n%s" %
Expand Down Expand Up @@ -494,7 +494,7 @@ def _init_job(self, joborder, **kwargs):
builder.make_fs_access = kwargs.get("make_fs_access") or StdFsAccess
builder.fs_access = builder.make_fs_access(kwargs["basedir"])

loadListingReq, _ = self.get_requirement("LoadListingRequirement")
loadListingReq, _ = self.get_requirement("http://commonwl.org/cwltool#LoadListingRequirement")
if loadListingReq:
builder.loadListing = loadListingReq.get("loadListing")

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ ruamel.yaml==0.13.7
rdflib==4.2.1
rdflib-jsonld==0.4.0
shellescape==3.4.1
schema-salad>=2.3.20170302225134,<3
schema-salad>=2.4.20170308171942,<3
typing==3.5.2.2 ; python_version>="2.7"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
'ruamel.yaml >= 0.12.4',
'rdflib >= 4.2.2, < 4.3.0',
'shellescape >= 3.4.1, < 3.5',
'schema-salad >= 2.3.20170302225134, < 3',
'schema-salad >= 2.4.20170308171942, < 3',
'typing >= 3.5.2, < 3.6',
'six >= 1.10.0',

Expand Down
4 changes: 3 additions & 1 deletion tests/wf/listing_none.cwl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
class: CommandLineTool
cwlVersion: v1.0
$namespaces:
cwltool: http://commonwl.org/cwltool#
requirements:
LoadListingRequirement:
cwltool:LoadListingRequirement:
loadListing: null
inputs:
d: Directory
Expand Down
4 changes: 3 additions & 1 deletion tests/wf/listing_shallow.cwl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
class: CommandLineTool
cwlVersion: v1.0
$namespaces:
cwltool: http://commonwl.org/cwltool#
requirements:
LoadListingRequirement:
cwltool:LoadListingRequirement:
loadListing: shallow
inputs:
d: Directory
Expand Down

0 comments on commit c088882

Please sign in to comment.