Skip to content

Commit 8af88ce

Browse files
committed
drop pack.py in favor of cwl_utils.pack
Only 7 test failures!
1 parent 2a2216b commit 8af88ce

File tree

4 files changed

+14
-424
lines changed

4 files changed

+14
-424
lines changed

cwltool/main.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import coloredlogs
3838
import pkg_resources # part of setuptools
3939
import ruamel.yaml
40+
from cwl_utils.pack import pack
4041
from ruamel.yaml.comments import CommentedMap, CommentedSeq
4142
from ruamel.yaml.main import YAML
4243
from schema_salad.exceptions import ValidationException
@@ -68,7 +69,6 @@
6869
from .loghandler import _logger, configure_logging, defaultStreamHandler
6970
from .mpi import MpiConfig
7071
from .mutation import MutationManager
71-
from .pack import pack
7272
from .process import (
7373
CWL_IANA,
7474
Process,
@@ -629,16 +629,11 @@ def loadref(base: str, uri: str) -> Union[CommentedMap, CommentedSeq, str, None]
629629

630630

631631
def print_pack(
632-
loadingContext: LoadingContext,
633632
uri: str,
634633
) -> str:
635634
"""Return a CWL serialization of the CWL document in JSON."""
636-
packed = pack(loadingContext, uri)
637-
if len(cast(Sized, packed["$graph"])) > 1:
638-
return json_dumps(packed, indent=4, default=str)
639-
return json_dumps(
640-
cast(MutableSequence[CWLObjectType], packed["$graph"])[0], indent=4, default=str
641-
)
635+
packed = pack(uri)
636+
return json_dumps(packed, indent=4, default=str)
642637

643638

644639
def supported_cwl_versions(enable_dev: bool) -> List[str]:
@@ -1127,14 +1122,12 @@ def main(
11271122
processobj, metadata = loadingContext.loader.resolve_ref(uri)
11281123
processobj = cast(Union[CommentedMap, CommentedSeq], processobj)
11291124
if args.pack:
1130-
print(print_pack(loadingContext, uri), file=stdout)
1125+
print(print_pack(uri), file=stdout)
11311126
return 0
11321127

11331128
if args.provenance and runtimeContext.research_obj:
11341129
# Can't really be combined with args.pack at same time
1135-
runtimeContext.research_obj.packed_workflow(
1136-
print_pack(loadingContext, uri)
1137-
)
1130+
runtimeContext.research_obj.packed_workflow(print_pack(uri))
11381131

11391132
if args.print_pre:
11401133
print(

cwltool/pack.py

Lines changed: 0 additions & 323 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
# "cwltool/__main__.py",
6363
"cwltool/main.py",
6464
"cwltool/mutation.py",
65-
"cwltool/pack.py",
6665
# "cwltool/pathmapper.py", # class PathMapper needs to be subclassable
6766
"cwltool/process.py",
6867
"cwltool/procgenerator.py",

0 commit comments

Comments
 (0)