Skip to content

Commit e881ba5

Browse files
committed
Rename draft2tool.py -> cltool.py
This is intended to deprate `draft-2 and draft-3` and thus, the rename. Also, remove `draft-2` checking condition when validating `cwlVersion`
1 parent 1275466 commit e881ba5

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed
File renamed without changes.

cwltool/load_tool.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,6 @@ def validate_document(document_loader, # type: Loader
175175
raise ValidationException("No cwlVersion found."
176176
"Use the following syntax in your CWL workflow to declare version: cwlVersion: <version>")
177177

178-
if workflowobj["cwlVersion"] == "draft-2":
179-
workflowobj = cast(CommentedMap, cmap(update._draft2toDraft3dev1(
180-
workflowobj, document_loader, uri, update_steps=False)))
181-
if "@graph" in workflowobj:
182-
workflowobj["$graph"] = workflowobj["@graph"]
183-
del workflowobj["@graph"]
184-
185178
(sch_document_loader, avsc_names) = \
186179
process.get_schema(workflowobj["cwlVersion"])[:2]
187180

cwltool/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from schema_salad.ref_resolver import Fetcher, Loader, file_uri, uri_file_path
2424
from schema_salad.sourceline import strip_dup_lineno
2525

26-
from . import draft2tool, workflow
26+
from . import cltool, workflow
2727
from .builder import Builder
2828
from .cwlrdf import printdot, printrdf
2929
from .errors import UnsupportedRequirement, WorkflowException
@@ -776,7 +776,7 @@ def main(argsl=None, # type: List[str]
776776
arg_parser().print_help()
777777
return 1
778778
if args.relax_path_checks:
779-
draft2tool.ACCEPTLIST_RE = draft2tool.ACCEPTLIST_EN_RELAXED_RE
779+
cltool.ACCEPTLIST_RE = cltool.ACCEPTLIST_EN_RELAXED_RE
780780

781781
if args.ga4gh_tool_registries:
782782
ga4gh_tool_registries[:] = args.ga4gh_tool_registries

cwltool/workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from ruamel.yaml.comments import CommentedMap, CommentedSeq
1313
from schema_salad.sourceline import SourceLine, cmap
1414

15-
from . import draft2tool, expression
15+
from . import cltool, expression
1616
from .errors import WorkflowException
1717
from .load_tool import load_tool
1818
from .process import Process, shortname, uniquename
@@ -33,9 +33,9 @@ def defaultMakeTool(toolpath_object, # type: Dict[Text, Any]
3333
raise WorkflowException(u"Not a dict: `%s`" % toolpath_object)
3434
if "class" in toolpath_object:
3535
if toolpath_object["class"] == "CommandLineTool":
36-
return draft2tool.CommandLineTool(toolpath_object, **kwargs)
36+
return cltool.CommandLineTool(toolpath_object, **kwargs)
3737
elif toolpath_object["class"] == "ExpressionTool":
38-
return draft2tool.ExpressionTool(toolpath_object, **kwargs)
38+
return cltool.ExpressionTool(toolpath_object, **kwargs)
3939
elif toolpath_object["class"] == "Workflow":
4040
return Workflow(toolpath_object, **kwargs)
4141

tests/test_docker_warning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import unittest
33
from mock import mock
44
from cwltool.utils import windows_default_container_id
5-
from cwltool.draft2tool import DEFAULT_CONTAINER_MSG, CommandLineTool
5+
from cwltool.tool import DEFAULT_CONTAINER_MSG, CommandLineTool
66

77

88
class TestDefaultDockerWarning(unittest.TestCase):

0 commit comments

Comments
 (0)