Skip to content

Commit b73b2b5

Browse files
committed
Merge branch 'master' into rm-intermediates
2 parents ca50633 + 83851db commit b73b2b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+412
-366
lines changed

cwltool/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Default entrypoint for the cwltool module."""
12
from __future__ import absolute_import
23

34
from . import main

cwltool/argparser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
"""Command line argument parsing for cwltool."""
12
from __future__ import absolute_import, print_function
23

34
import argparse
45
import os
5-
from typing import (Any, AnyStr, Dict, List, Optional, Sequence,
6-
Union, cast, MutableMapping, MutableSequence)
6+
from typing import (Any, AnyStr, Dict, List, MutableMapping, MutableSequence,
7+
Optional, Sequence, Union, cast)
78

9+
from schema_salad.ref_resolver import file_uri
810
from typing_extensions import Text # pylint: disable=unused-import
911
# move to a regular typing import when Python 3.3-3.6 is no longer supported
1012

11-
from schema_salad.ref_resolver import file_uri
12-
1313
from .loghandler import _logger
1414
from .process import Process, shortname # pylint: disable=unused-import
1515
from .resolver import ga4gh_tool_registries

cwltool/builder.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@
22

33
import copy
44
import logging
5-
from typing import (Any, Callable, Dict, List, Optional, Set, Union,
6-
Tuple, MutableMapping, MutableSequence)
7-
from typing_extensions import Text, Type, TYPE_CHECKING # pylint: disable=unused-import
8-
# move to a regular typing import when Python 3.3-3.6 is no longer supported
5+
from typing import (Any, Callable, Dict, List, MutableMapping, MutableSequence,
6+
Optional, Set, Tuple, Union)
97

108
from rdflib import Graph, URIRef # pylint: disable=unused-import
119
from rdflib.namespace import OWL, RDFS
1210
from ruamel.yaml.comments import CommentedMap
13-
import schema_salad.schema # pylint: disable=unused-import
1411
from schema_salad import validate
15-
from schema_salad.schema import AvroSchemaFromJSONData
12+
from schema_salad.schema import AvroSchemaFromJSONData, Names
1613
from schema_salad.sourceline import SourceLine
1714
from six import iteritems, string_types
15+
from typing_extensions import (TYPE_CHECKING, # pylint: disable=unused-import
16+
Text, Type)
17+
# move to a regular typing import when Python 3.3-3.6 is no longer supported
1818

1919
from . import expression
2020
from .errors import WorkflowException
2121
from .loghandler import _logger
2222
from .mutation import MutationManager # pylint: disable=unused-import
23-
from .pathmapper import (PathMapper, # pylint: disable=unused-import
24-
get_listing, normalizeFilesDirs, visit_class)
23+
from .pathmapper import PathMapper # pylint: disable=unused-import
24+
from .pathmapper import get_listing, normalizeFilesDirs, visit_class
2525
from .stdfsaccess import StdFsAccess # pylint: disable=unused-import
26-
from .utils import (aslist, docker_windows_path_adjust,
27-
json_dumps, onWindows)
26+
from .utils import aslist, docker_windows_path_adjust, json_dumps, onWindows
27+
28+
29+
2830
if TYPE_CHECKING:
2931
from .provenance import CreateProvProfile # pylint: disable=unused-import
3032
CONTENT_LIMIT = 64 * 1024
@@ -111,7 +113,7 @@ def __init__(self,
111113
files=None, # type: List[Dict[Text, Text]]
112114
bindings=None, # type: List[Dict[Text, Any]]
113115
schemaDefs=None, # type: Dict[Text, Dict[Text, Any]]
114-
names=None, # type: schema_salad.schema.Names
116+
names=None, # type: Names
115117
requirements=None, # type: List[Dict[Text, Any]]
116118
hints=None, # type: List[Dict[Text, Any]]
117119
timeout=None, # type: float
@@ -131,7 +133,7 @@ def __init__(self,
131133
): # type: (...) -> None
132134

133135
if names is None:
134-
self.names = schema_salad.schema.Names()
136+
self.names = Names()
135137
else:
136138
self.names = names
137139

cwltool/checker.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
"""Static checking of CWL workflow connectivity."""
12
from collections import namedtuple
2-
from typing import Any, Dict, List, Optional, MutableMapping, MutableSequence
3-
from typing_extensions import Text # pylint: disable=unused-import
4-
# move to a regular typing import when Python 3.3-3.6 is no longer supported
3+
from typing import Any, Dict, List, MutableMapping, MutableSequence, Optional
54

5+
import six
66
from schema_salad import validate
77
from schema_salad.sourceline import SourceLine, bullets, strip_dup_lineno
8-
import six
8+
from typing_extensions import Text # pylint: disable=unused-import
9+
# move to a regular typing import when Python 3.3-3.6 is no longer supported
910

1011
from .errors import WorkflowException
1112
from .loghandler import _logger
@@ -79,24 +80,22 @@ def can_assign_src_to_sink(src, sink, strict=False): # type: (Any, Any, bool) -
7980
return False
8081
return True
8182
return can_assign_src_to_sink(src["type"], sink["type"], strict)
82-
elif isinstance(src, MutableSequence):
83+
if isinstance(src, MutableSequence):
8384
if strict:
84-
for t in src:
85-
if not can_assign_src_to_sink(t, sink):
85+
for this_src in src:
86+
if not can_assign_src_to_sink(this_src, sink):
8687
return False
8788
return True
88-
else:
89-
for t in src:
90-
if can_assign_src_to_sink(t, sink):
91-
return True
92-
return False
93-
elif isinstance(sink, MutableSequence):
94-
for t in sink:
95-
if can_assign_src_to_sink(src, t):
89+
for this_src in src:
90+
if can_assign_src_to_sink(this_src, sink):
91+
return True
92+
return False
93+
if isinstance(sink, MutableSequence):
94+
for this_sink in sink:
95+
if can_assign_src_to_sink(src, this_sink):
9696
return True
9797
return False
98-
else:
99-
return src == sink
98+
return src == sink
10099

101100

102101
def _compare_records(src, sink, strict=False):

cwltool/command_line_tool.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Implementation of CommandLineTool."""
12
from __future__ import absolute_import
23

34
import copy
@@ -11,20 +12,24 @@
1112
import tempfile
1213
import threading
1314
from functools import cmp_to_key, partial
14-
from typing import (Any, Callable, Dict, Generator, List, Optional, Set, Union,
15-
cast, MutableMapping, MutableSequence)
16-
from typing_extensions import Text, Type, TYPE_CHECKING # pylint: disable=unused-import
17-
# move to a regular typing import when Python 3.3-3.6 is no longer supported
15+
from typing import (Any, Callable, Dict, Generator, List, MutableMapping,
16+
MutableSequence, Optional, Set, Union, cast)
1817

18+
import shellescape
1919
from schema_salad import validate
2020
from schema_salad.ref_resolver import file_uri, uri_file_path
2121
from schema_salad.sourceline import SourceLine
22-
import shellescape
2322
from six import string_types
23+
2424
from six.moves import map, urllib
25+
from typing_extensions import (TYPE_CHECKING, # pylint: disable=unused-import
26+
Text, Type)
27+
# move to a regular typing import when Python 3.3-3.6 is no longer supported
2528

2629
from .builder import (CONTENT_LIMIT, Builder, # pylint: disable=unused-import
2730
substitute)
31+
from .context import LoadingContext # pylint: disable=unused-import
32+
from .context import RuntimeContext, getdefault
2833
from .docker import DockerCommandLineJob
2934
from .errors import WorkflowException
3035
from .flatten import flatten
@@ -43,8 +48,6 @@
4348
from .utils import (aslist, convert_pathsep_to_unix,
4449
docker_windows_path_adjust, json_dumps, onWindows,
4550
windows_default_container_id)
46-
from .context import (LoadingContext, # pylint: disable=unused-import
47-
RuntimeContext, getdefault)
4851
if TYPE_CHECKING:
4952
from .provenance import CreateProvProfile # pylint: disable=unused-import
5053

cwltool/context.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
"""Shared context objects that replace use of kwargs."""
12
import copy
23
import threading # pylint: disable=unused-import
3-
from typing import Any, Callable, Dict, Iterable, List, MutableMapping, Optional
4-
from typing_extensions import Text, TYPE_CHECKING # pylint: disable=unused-import
5-
# move to a regular typing import when Python 3.3-3.6 is no longer supported
6-
from schema_salad.ref_resolver import ( # pylint: disable=unused-import
7-
ContextType, Fetcher, Loader)
8-
from schema_salad import schema
4+
from typing import (Any, Callable, Dict, Iterable, List, MutableMapping,
5+
Optional)
96

10-
from .utils import DEFAULT_TMP_PREFIX
11-
from .stdfsaccess import StdFsAccess
7+
from schema_salad import schema
8+
from schema_salad.ref_resolver import (ContextType, # pylint: disable=unused-import
9+
Fetcher, Loader)
10+
from typing_extensions import (TYPE_CHECKING, # pylint: disable=unused-import
11+
Text)
12+
# move to a regular typing import when Python 3.3-3.6 is no longer supported
1213
from .builder import Builder, HasReqsHints
1314
from .mutation import MutationManager
14-
from .software_requirements import DependenciesConfiguration
15-
from .secrets import SecretStore
1615
from .pathmapper import PathMapper
16+
from .secrets import SecretStore
17+
from .software_requirements import DependenciesConfiguration
18+
from .stdfsaccess import StdFsAccess
19+
from .utils import DEFAULT_TMP_PREFIX
1720

1821
if TYPE_CHECKING:
1922
from .process import Process

cwltool/cwlrdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from __future__ import absolute_import
22

33
from typing import IO, Any, Dict
4-
from typing_extensions import Text # pylint: disable=unused-import
5-
# move to a regular typing import when Python 3.3-3.6 is no longer supported
64

75
from rdflib import Graph
86
from schema_salad.jsonld_context import makerdf
97
from schema_salad.ref_resolver import ContextType
108
from six.moves import urllib
9+
from typing_extensions import Text # pylint: disable=unused-import
10+
# move to a regular typing import when Python 3.3-3.6 is no longer supported
1111

1212
from .process import Process
1313

cwltool/docker.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Enables Docker software containers via the {dx-,u,}docker runtimes."""
12
from __future__ import absolute_import
23

34
import datetime
@@ -9,21 +10,22 @@
910
import threading
1011
from io import open # pylint: disable=redefined-builtin
1112
from typing import Dict, List, MutableMapping, Optional, Set
12-
from typing_extensions import Text # pylint: disable=unused-import
13-
# move to a regular typing import when Python 3.3-3.6 is no longer supported
1413

1514
import requests
15+
from typing_extensions import Text # pylint: disable=unused-import
16+
# move to a regular typing import when Python 3.3-3.6 is no longer supported
1617

18+
from .context import RuntimeContext # pylint: disable=unused-import
1719
from .docker_id import docker_vm_id
1820
from .errors import WorkflowException
1921
from .job import ContainerCommandLineJob
2022
from .loghandler import _logger
21-
from .pathmapper import (PathMapper, # pylint: disable=unused-import
22-
ensure_writable)
23+
from .pathmapper import PathMapper # pylint: disable=unused-import
24+
from .pathmapper import ensure_writable
2325
from .secrets import SecretStore # pylint: disable=unused-import
2426
from .utils import (DEFAULT_TMP_PREFIX, docker_windows_path_adjust, onWindows,
2527
subprocess)
26-
from .context import RuntimeContext # pylint: disable=unused-import
28+
2729

2830
_IMAGES = set() # type: Set[Text]
2931
_IMAGES_LOCK = threading.Lock()

cwltool/docker_id.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
"""Helper functions for docker."""
12
from __future__ import absolute_import, print_function
23

34
from typing import List, Optional, Tuple # pylint: disable=unused-import
5+
46
from typing_extensions import Text # pylint: disable=unused-import
57
# move to a regular typing import when Python 3.3-3.6 is no longer supported
68

cwltool/draft2tool.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)