Skip to content

Commit dc75356

Browse files
authored
Fix checking the cwd for singularity images (#755)
with setuptools upgrade on appveyor
1 parent 90ae2af commit dc75356

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ environment:
2626

2727
install:
2828
- "%PYTHON%\\python.exe -m pip install -U wheel pytest mock"
29+
- "%PYTHON%\\python.exe -m pip show setuptools"
30+
- "%PYTHON%\\python.exe -m pip install -U setuptools^>=20.3"
31+
# Note the use of a `^` to escape the `>`
2932
#- "%PYTHON%\\python.exe -m pip install -U wheel pytest pytest-xdist mock"
3033

3134
build_script:

cwltool/singularity.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,18 @@ def get_image(dockerRequirement, # type: Dict[Text, Text]
7676
candidates.append(_normalizeImageId(dockerRequirement['dockerImageId']))
7777

7878
# check if Singularity image is available in $SINGULARITY_CACHEDIR
79-
for target in ("SINGULARITY_CACHEDIR", "SINGULARITY_PULLFOLDER",
80-
os.getcwd()):
81-
if target in os.environ:
82-
for candidate in candidates:
83-
path = os.path.join(os.environ[target], candidate)
84-
if os.path.isfile(path):
85-
_logger.info("Using local copy of Singularity image "
86-
"found in {}".format(target))
87-
dockerRequirement["dockerImageId"] = path
88-
found = True
79+
targets = [os.getcwd()]
80+
for env in ("SINGULARITY_CACHEDIR", "SINGULARITY_PULLFOLDER"):
81+
if env in os.environ:
82+
targets.append(os.environ[env])
83+
for target in targets:
84+
for candidate in candidates:
85+
path = os.path.join(target, candidate)
86+
if os.path.isfile(path):
87+
_logger.info("Using local copy of Singularity image "
88+
"found in {}".format(target))
89+
dockerRequirement["dockerImageId"] = path
90+
found = True
8991

9092
if (force_pull or not found) and pull_image:
9193
cmd = [] # type: List[Text]

0 commit comments

Comments
 (0)