@@ -218,9 +218,10 @@ def validate_document(document_loader, # type: Loader
218
218
if metadata and 'cwlVersion' in metadata :
219
219
workflowobj ['cwlVersion' ] = metadata ['cwlVersion' ]
220
220
else :
221
- raise ValidationException ("No cwlVersion found."
222
- "Use the following syntax in your CWL document to declare "
223
- "the version: cwlVersion: <version>" )
221
+ raise ValidationException (
222
+ "No cwlVersion found. "
223
+ "Use the following syntax in your CWL document to declare the version: cwlVersion: <version>.\n "
224
+ "Note: if this is a CWL draft-2 (pre v1.0) document then it will need to be upgraded first." )
224
225
225
226
if not isinstance (workflowobj ["cwlVersion" ], (str , Text )):
226
227
raise Exception ("'cwlVersion' must be a string, got %s" % type (workflowobj ["cwlVersion" ]))
@@ -230,16 +231,14 @@ def validate_document(document_loader, # type: Loader
230
231
workflowobj ["cwlVersion" ])
231
232
if workflowobj ["cwlVersion" ] not in list (ALLUPDATES ):
232
233
# print out all the Supported Versions of cwlVersion
233
- versions = list (ALLUPDATES ) # ALLUPDATES is a dict
234
+ versions = []
235
+ for version in list (ALLUPDATES ):
236
+ if "dev" in version :
237
+ version += " (with --enable-dev flag only)"
238
+ versions .append (version )
234
239
versions .sort ()
235
- raise ValidationException ("'cwlVersion' not valid. Supported CWL versions are: \n {}" .format ("\n " .join (versions )))
236
-
237
- if workflowobj ["cwlVersion" ] == "draft-2" :
238
- workflowobj = cast (CommentedMap , cmap (update ._draft2toDraft3dev1 (
239
- workflowobj , document_loader , uri , update_steps = False )))
240
- if "@graph" in workflowobj :
241
- workflowobj ["$graph" ] = workflowobj ["@graph" ]
242
- del workflowobj ["@graph" ]
240
+ raise ValidationException ("The CWL reference runner no longer supports pre CWL v1.0 documents. "
241
+ "Supported versions are: \n {}" .format ("\n " .join (versions )))
243
242
244
243
(sch_document_loader , avsc_names ) = \
245
244
process .get_schema (workflowobj ["cwlVersion" ])[:2 ]
@@ -260,8 +259,6 @@ def validate_document(document_loader, # type: Loader
260
259
raise ValidationException ("Workflow must be a dict or list." )
261
260
262
261
if not new_metadata :
263
- if not isinstance (processobj , dict ):
264
- raise ValidationException ("Draft-2 workflows must be a dict." )
265
262
new_metadata = cast (CommentedMap , cmap (
266
263
{"$namespaces" : processobj .get ("$namespaces" , {}),
267
264
"$schemas" : processobj .get ("$schemas" , []),
0 commit comments