File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ MODULE=cwl-upgrader
2626# `SHELL=bash` Will break Titus's laptop, so don't use BASH-isms like
2727# `[[` conditional expressions.
2828PYSOURCES =$(wildcard ${MODULE}/** .py tests/* .py) setup.py
29- DEVPKGS =pep8 diff_cover autopep8 pylint coverage pep257
29+ DEVPKGS =pep8 diff_cover autopep8 pylint coverage pep257 flake8
3030MYPYPATH =typeshed/2or3
3131MYPYFLAGS =--disallow-untyped-calls --disallow-untyped-defs \
3232 --warn-incomplete-stub --warn-redundant-casts
@@ -45,7 +45,7 @@ install-dep: install-dependencies
4545
4646install-dependencies :
4747 pip install --upgrade $(DEVPKGS )
48- pip install -r requirements.txt
48+ # pip install -r requirements.txt
4949
5050# # install : install the ${MODULE} module and schema-salad-tool
5151install : FORCE
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ Common workflow language standalone document upgrader
55This is a standalone upgrader for Common Workflow Language documents from
66version "draft-3" to "v1.0".
77
8+ It does not check for correctness of the input document, for that one can use
9+ the CWL reference implementation.
10+
811This is written and tested for Python 2.7, 3.4, and 3.5.
912
1013Install
Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ def main(): # type: () -> int
1111 for path in sys .argv [1 :]:
1212 with open (path ) as entry :
1313 document = ruamel .yaml .round_trip_load (entry )
14- draft3_to_v1_0 (document )
14+ if ('cwlVersion' in document
15+ and document ['cwlVersion' ] == 'cwl:draft-3' ):
16+ draft3_to_v1_0 (document )
17+ else :
18+ print ("Skipping non draft-3 CWL document" , file = sys .stderr )
1519 print (ruamel .yaml .round_trip_dump (document ))
1620 return 0
1721
@@ -45,7 +49,7 @@ def _draft3_to_v1_0(document):
4549 for i , sf in enumerate (document ["secondaryFiles" ]):
4650 if "$(" in sf or "${" in sf :
4751 document ["secondaryFiles" ][i ] = sf .replace (
48- '"path"' , '"location"' ).replace (".path" , ".location" )
52+ '"path"' , '"location"' ).replace (".path" , ".location" )
4953
5054 if "description" in document :
5155 document ["doc" ] = document ["description" ]
@@ -92,4 +96,3 @@ def shortenType(typeObj):
9296
9397if __name__ == "__main__" :
9498 sys .exit (main ())
95-
You can’t perform that action at this time.
0 commit comments