Skip to content

Commit e56c1d7

Browse files
authored
Merge branch 'master' into release
2 parents e5e578d + 1aa1dd6 commit e56c1d7

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ mypy2: ${PYSOURCES}
160160
rm -Rf typeshed/2and3/schema_salad
161161
ln -s $(shell python -c 'from __future__ import print_function; import schema_salad; import os.path; print(os.path.dirname(schema_salad.__file__))') \
162162
typeshed/2and3/schema_salad
163-
MYPYPATH=$MYPYPATH:typeshed/2.7:typeshed/2and3 mypy --py2 --disallow-untyped-calls \
163+
MYPYPATH=$$MYPYPATH:typeshed/2.7:typeshed/2and3 mypy --py2 --disallow-untyped-calls \
164164
--warn-redundant-casts \
165165
cwltool
166166

@@ -171,7 +171,7 @@ mypy3: ${PYSOURCES}
171171
rm -Rf typeshed/2and3/schema_salad
172172
ln -s $(shell python3 -c 'from __future__ import print_function; import schema_salad; import os.path; print(os.path.dirname(schema_salad.__file__))') \
173173
typeshed/2and3/schema_salad
174-
MYPYPATH=$MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
174+
MYPYPATH=$$MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
175175
--warn-redundant-casts \
176176
cwltool
177177

cwltool/draft2tool.py

+22-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
from __future__ import absolute_import
22
import copy
33
import hashlib
4+
import locale
45
import json
56
import logging
67
import os
78
import re
89
import shutil
910
import tempfile
10-
from functools import partial
11-
from typing import Any, Callable, Dict, Generator, List, Optional, Set, Text, Union, cast
11+
from functools import partial, cmp_to_key
12+
from typing import (Any, Callable, Dict, Generator, List, Optional, Set, Text,
13+
Union, cast)
1214

1315
from six import string_types, u
1416

@@ -208,7 +210,7 @@ def makeJobRunner(self, use_container=True, **kwargs): # type: (Optional[bool],
208210
})
209211
dockerReq = self.requirements[0]
210212
if default_container == windows_default_container_id and use_container and onWindows():
211-
_logger.warning(DEFAULT_CONTAINER_MSG%(windows_default_container_id, windows_default_container_id))
213+
_logger.warning(DEFAULT_CONTAINER_MSG % (windows_default_container_id, windows_default_container_id))
212214

213215
if dockerReq and use_container:
214216
return DockerCommandLineJob()
@@ -523,8 +525,8 @@ def collect_output_ports(self, ports, builder, outdir, compute_checksum=True, jo
523525
for i, port in enumerate(ports):
524526
def makeWorkflowException(msg):
525527
return WorkflowException(
526-
u"Error collecting output for parameter '%s':\n%s"
527-
% (shortname(port["id"]), msg))
528+
u"Error collecting output for parameter '%s':\n%s"
529+
% (shortname(port["id"]), msg))
528530
with SourceLine(ports, i, makeWorkflowException, debug):
529531
fragment = shortname(port["id"])
530532
ret[fragment] = self.collect_output(port, builder, outdir, fs_access,
@@ -575,16 +577,25 @@ def collect_output(self, schema, builder, outdir, fs_access, compute_checksum=Tr
575577
elif gb == ".":
576578
gb = outdir
577579
elif gb.startswith("/"):
578-
raise WorkflowException("glob patterns must not start with '/'")
580+
raise WorkflowException(
581+
"glob patterns must not start with '/'")
579582
try:
580583
prefix = fs_access.glob(outdir)
581584
r.extend([{"location": g,
582-
"path": fs_access.join(builder.outdir, g[len(prefix[0])+1:]),
585+
"path": fs_access.join(builder.outdir,
586+
g[len(prefix[0])+1:]),
583587
"basename": os.path.basename(g),
584-
"nameroot": os.path.splitext(os.path.basename(g))[0],
585-
"nameext": os.path.splitext(os.path.basename(g))[1],
586-
"class": "File" if fs_access.isfile(g) else "Directory"}
587-
for g in fs_access.glob(fs_access.join(outdir, gb))])
588+
"nameroot": os.path.splitext(
589+
os.path.basename(g))[0],
590+
"nameext": os.path.splitext(
591+
os.path.basename(g))[1],
592+
"class": "File" if fs_access.isfile(g)
593+
else "Directory"}
594+
for g in sorted(fs_access.glob(
595+
fs_access.join(outdir, gb)),
596+
key=cmp_to_key(cast(
597+
Callable[[Text, Text],
598+
int], locale.strcoll)))])
588599
except (OSError, IOError) as e:
589600
_logger.warning(Text(e))
590601
except:

mypy.ini

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
[mypy]
2+
13
[mypy-ruamel.*]
24
ignore_errors = True

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ whitelist_externals =
3333
commands = make mypy2
3434
whitelist_externals = make
3535
deps =
36-
mypy==0.520
36+
mypy==0.560
3737
-rrequirements.txt
3838

3939
[testenv:py35-mypy3]
4040
commands = make mypy3
4141
whitelist_externals = make
4242
deps =
43-
mypy==0.520
43+
mypy==0.560
4444
-rrequirements.txt
4545

4646
[testenv:py27-pipconflictchecker]

0 commit comments

Comments
 (0)