Skip to content

Commit fcd80f9

Browse files
author
Anton Khodak
authored
Merge pull request #520 from common-workflow-language/deprecate_drafts
remove draft-2 and draft-3 support
2 parents 32fd7cb + 441ebf4 commit fcd80f9

File tree

7 files changed

+723
-1097
lines changed

7 files changed

+723
-1097
lines changed

cwltool/command_line_tool.py

+700
Large diffs are not rendered by default.

cwltool/draft2tool.py

+4-699
Large diffs are not rendered by default.

cwltool/load_tool.py

+11-14
Original file line numberDiff line numberDiff line change
@@ -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", []),

cwltool/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from schema_salad.ref_resolver import Loader, file_uri, uri_file_path
2222
from schema_salad.sourceline import strip_dup_lineno
2323

24-
from . import draft2tool, workflow
24+
from . import command_line_tool, workflow
2525
from .argparser import arg_parser, generate_parser, DEFAULT_TMP_PREFIX
2626
from .cwlrdf import printdot, printrdf
2727
from .errors import UnsupportedRequirement, WorkflowException
@@ -418,7 +418,7 @@ def main(argsl=None, # type: List[str]
418418
arg_parser().print_help()
419419
return 1
420420
if args.relax_path_checks:
421-
draft2tool.ACCEPTLIST_RE = draft2tool.ACCEPTLIST_EN_RELAXED_RE
421+
command_line_tool.ACCEPTLIST_RE = command_line_tool.ACCEPTLIST_EN_RELAXED_RE
422422

423423
if args.ga4gh_tool_registries:
424424
ga4gh_tool_registries[:] = args.ga4gh_tool_registries

0 commit comments

Comments
 (0)