Skip to content

Commit 641e0e8

Browse files
author
Anton Khodak
committed
Improve deprecated CWL versions reporting
1 parent d8a86b0 commit 641e0e8

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

cwltool/load_tool.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ def validate_document(document_loader, # type: Loader
215215
if metadata and 'cwlVersion' in metadata:
216216
workflowobj['cwlVersion'] = metadata['cwlVersion']
217217
else:
218-
raise ValidationException("No cwlVersion found."
219-
"Use the following syntax in your CWL document to declare "
220-
"the version: cwlVersion: <version>")
218+
raise ValidationException(
219+
"No cwlVersion found. "
220+
"Use the following syntax in your CWL document to declare the version: cwlVersion: <version>.\n"
221+
"Note: if this is a CWL draft-2 (pre v1.0) document then it will need to be upgraded first.")
221222

222223
if not isinstance(workflowobj["cwlVersion"], (str, Text)):
223224
raise Exception("'cwlVersion' must be a string, got %s" % type(workflowobj["cwlVersion"]))
@@ -227,9 +228,14 @@ def validate_document(document_loader, # type: Loader
227228
workflowobj["cwlVersion"])
228229
if workflowobj["cwlVersion"] not in list(ALLUPDATES):
229230
# print out all the Supported Versions of cwlVersion
230-
versions = list(ALLUPDATES) # ALLUPDATES is a dict
231+
versions = []
232+
for version in list(ALLUPDATES):
233+
if "dev" in version:
234+
version += " (with --enable-dev flag only)"
235+
versions.append(version)
231236
versions.sort()
232-
raise ValidationException("'cwlVersion' not valid. Supported CWL versions are: \n{}".format("\n".join(versions)))
237+
raise ValidationException("The CWL reference runner no longer supports pre CWL v1.0 documents. "
238+
"Supported versions are: \n{}".format("\n".join(versions)))
233239

234240
(sch_document_loader, avsc_names) = \
235241
process.get_schema(workflowobj["cwlVersion"])[:2]

cwltool/update.py

-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def v1_0to1_1_0dev1(doc, loader, baseuri):
120120
} # type: Dict[Text, Callable[[Any, Loader, Text], Tuple[Any, Text]]]
121121

122122
DEVUPDATES = {
123-
"v1.0.dev4": v1_0dev4to1_0,
124123
"v1.0": v1_0to1_1_0dev1,
125124
"v1.1.0-dev1": None
126125
} # type: Dict[Text, Callable[[Any, Loader, Text], Tuple[Any, Text]]]

0 commit comments

Comments
 (0)