Skip to content

Commit 29303c9

Browse files
authored
Merge branch 'master' into node_fix
2 parents 8ff32c3 + d347005 commit 29303c9

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

cwltool/docker.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ def get_image(dockerRequirement, pull_image, dry_run=False):
2727
sp = dockerRequirement["dockerImageId"].split(":")
2828
if len(sp) == 1:
2929
sp.append("latest")
30+
elif len(sp) == 2:
31+
# if sp[1] doesn't match valid tag names, it is a part of repository
32+
if not re.match(r'[\w][\w.-]{0,127}', sp[1]):
33+
sp[0] = sp[0] + ":" + sp[1]
34+
sp[1] = "latest"
35+
elif len(sp) == 3:
36+
if re.match(r'[\w][\w.-]{0,127}', sp[2]):
37+
sp[0] = sp[0] + ":" + sp[1]
38+
sp[1] = sp[2]
39+
del sp[2]
40+
3041
# check for repository:tag match or image id match
3142
if ((sp[0] == m.group(1) and sp[1] == m.group(2)) or dockerRequirement["dockerImageId"] == m.group(3)):
3243
found = True

cwltool/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ def load_job_order(args, t, stdin, print_input_deps=False, relative_deps=False,
431431
if len(args.job_order) == 1 and args.job_order[0][0] != "-":
432432
job_order_file = args.job_order[0]
433433
elif len(args.job_order) == 1 and args.job_order[0] == "-":
434-
job_order_object = yaml.load(stdin)
435-
job_order_object, _ = loader.resolve_all(job_order_object, "")
434+
job_order_object = yaml.round_trip_load(stdin) # type: ignore
435+
job_order_object, _ = loader.resolve_all(job_order_object, file_uri(os.getcwd()) + "/")
436436
else:
437437
job_order_file = None
438438

setup.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
SETUP_DIR = os.path.dirname(__file__)
99
README = os.path.join(SETUP_DIR, 'README.rst')
1010

11+
# if python3 runtime and `setup.py install` is called
12+
if sys.version_info.major == 3 and sys.argv[1] == 'install':
13+
print("Aborting installation. CWL Tool doesn't support Python 3 currently.")
14+
print("Install using Python 2 pip.")
15+
exit(1)
16+
1117
try:
1218
import gittaggers
1319

@@ -64,4 +70,10 @@
6470
},
6571
zip_safe=True,
6672
cmdclass={'egg_info': tagger},
73+
classifiers=[
74+
'Development Status :: 5 - Production/Stable',
75+
'Operating System :: POSIX',
76+
'Operating System :: OS Independent',
77+
'Programming Language :: Python :: 2 :: Only',
78+
]
6779
)

0 commit comments

Comments
 (0)