Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop pack.py in favor of cwl_utils.pack #1730

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions cwltool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import coloredlogs
import pkg_resources # part of setuptools
import ruamel.yaml
from cwl_utils.pack import pack
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from ruamel.yaml.main import YAML
from schema_salad.exceptions import ValidationException
Expand Down Expand Up @@ -68,7 +69,6 @@
from .loghandler import _logger, configure_logging, defaultStreamHandler
from .mpi import MpiConfig
from .mutation import MutationManager
from .pack import pack
from .process import (
CWL_IANA,
Process,
Expand Down Expand Up @@ -629,16 +629,11 @@ def loadref(base: str, uri: str) -> Union[CommentedMap, CommentedSeq, str, None]


def print_pack(
loadingContext: LoadingContext,
uri: str,
) -> str:
"""Return a CWL serialization of the CWL document in JSON."""
packed = pack(loadingContext, uri)
if len(cast(Sized, packed["$graph"])) > 1:
return json_dumps(packed, indent=4, default=str)
return json_dumps(
cast(MutableSequence[CWLObjectType], packed["$graph"])[0], indent=4, default=str
)
packed = pack(uri)
return json_dumps(packed, indent=4, default=str)


def supported_cwl_versions(enable_dev: bool) -> List[str]:
Expand Down Expand Up @@ -1127,14 +1122,12 @@ def main(
processobj, metadata = loadingContext.loader.resolve_ref(uri)
processobj = cast(Union[CommentedMap, CommentedSeq], processobj)
if args.pack:
print(print_pack(loadingContext, uri), file=stdout)
print(print_pack(uri), file=stdout)
return 0

if args.provenance and runtimeContext.research_obj:
# Can't really be combined with args.pack at same time
runtimeContext.research_obj.packed_workflow(
print_pack(loadingContext, uri)
)
runtimeContext.research_obj.packed_workflow(print_pack(uri))

if args.print_pre:
print(
Expand Down
323 changes: 0 additions & 323 deletions cwltool/pack.py

This file was deleted.

1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
# "cwltool/__main__.py",
"cwltool/main.py",
"cwltool/mutation.py",
"cwltool/pack.py",
# "cwltool/pathmapper.py", # class PathMapper needs to be subclassable
"cwltool/process.py",
"cwltool/procgenerator.py",
Expand Down
Loading