@@ -218,9 +218,10 @@ def validate_document(document_loader, # type: Loader
218218 if metadata and 'cwlVersion' in metadata :
219219 workflowobj ['cwlVersion' ] = metadata ['cwlVersion' ]
220220 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." )
224225
225226 if not isinstance (workflowobj ["cwlVersion" ], (str , Text )):
226227 raise Exception ("'cwlVersion' must be a string, got %s" % type (workflowobj ["cwlVersion" ]))
@@ -230,16 +231,14 @@ def validate_document(document_loader, # type: Loader
230231 workflowobj ["cwlVersion" ])
231232 if workflowobj ["cwlVersion" ] not in list (ALLUPDATES ):
232233 # 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 )
234239 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 )))
243242
244243 (sch_document_loader , avsc_names ) = \
245244 process .get_schema (workflowobj ["cwlVersion" ])[:2 ]
@@ -260,8 +259,6 @@ def validate_document(document_loader, # type: Loader
260259 raise ValidationException ("Workflow must be a dict or list." )
261260
262261 if not new_metadata :
263- if not isinstance (processobj , dict ):
264- raise ValidationException ("Draft-2 workflows must be a dict." )
265262 new_metadata = cast (CommentedMap , cmap (
266263 {"$namespaces" : processobj .get ("$namespaces" , {}),
267264 "$schemas" : processobj .get ("$schemas" , []),
0 commit comments