Skip to content

Commit 59f9f85

Browse files
author
Peter Amstutz
committed
Fix type hints
1 parent 4c39391 commit 59f9f85

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

cwltool/docker.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import datetime
1313
import requests
14-
from typing import (Dict, List, Text, Any, MutableMapping)
14+
from typing import (Dict, List, Text, Any, MutableMapping, Set)
1515
import threading
1616

1717
from .docker_id import docker_vm_id
@@ -23,14 +23,14 @@
2323

2424
_logger = logging.getLogger("cwltool")
2525

26-
found_images = set()
26+
found_images = set() # type: Set[Text]
2727
found_images_lock = threading.Lock()
2828

2929
class DockerCommandLineJob(ContainerCommandLineJob):
3030

3131
@staticmethod
3232
def get_image(dockerRequirement, pull_image, dry_run=False, force_pull=False):
33-
# type: (Dict[Text, Text], bool, bool) -> bool
33+
# type: (Dict[Text, Text], bool, bool, bool) -> bool
3434
found = False
3535

3636
if "dockerImageId" not in dockerRequirement and "dockerPull" in dockerRequirement:

cwltool/job.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ class ContainerCommandLineJob(JobBase):
337337
__metaclass__ = ABCMeta
338338

339339
@abstractmethod
340-
def get_from_requirements(self, r, req, pull_image, dry_run=False):
341-
# type: (Dict[Text, Text], bool, bool, bool) -> Text
340+
def get_from_requirements(self, r, req, pull_image, dry_run=False, force_pull=False):
341+
# type: (Dict[Text, Text], bool, bool, bool, bool) -> Text
342342
pass
343343

344344
@abstractmethod

cwltool/singularity.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@
2121

2222
class SingularityCommandLineJob(ContainerCommandLineJob):
2323
@staticmethod
24-
def get_image(dockerRequirement, pull_image, dry_run=False, force_pull=False):
24+
def get_image(dockerRequirement, pull_image, dry_run=False):
2525
# type: (Dict[Text, Text], bool, bool) -> bool
2626
found = False
2727

28-
if force_pull:
29-
_logger.warn("--force-docker-pull currently not supported for singularity")
30-
3128
if "dockerImageId" not in dockerRequirement and "dockerPull" in dockerRequirement:
3229
match = re.search(pattern=r'([a-z]*://)', string=dockerRequirement["dockerPull"])
3330
if match:
@@ -72,9 +69,13 @@ def get_image(dockerRequirement, pull_image, dry_run=False, force_pull=False):
7269

7370
return found
7471

75-
def get_from_requirements(self, r, req, pull_image, dry_run=False):
76-
# type: (Dict[Text, Text], bool, bool, bool) -> Text
72+
def get_from_requirements(self, r, req, pull_image, dry_run=False, force_pull=False):
73+
# type: (Dict[Text, Text], bool, bool, bool, bool) -> Text
7774
# returns the filename of the Singularity image (e.g. hello-world-latest.img)
75+
76+
if force_pull:
77+
_logger.warn("--force-docker-pull currently not supported for singularity")
78+
7879
if r:
7980
errmsg = None
8081
try:

0 commit comments

Comments
 (0)