rabix / sbpack

Command line utility to pack and upload/download CWL to/from SB powered platform
Apache License 2.0
8 stars 5 forks source link

`cwlpack`: impossible to pack workflow with `$import` directive in inputs #62

Open npilshchikova opened 1 year ago

npilshchikova commented 1 year ago

When using cwlpack on workflow with $import directive like this:

inputs:

- $import: ./config.yml

an error occurs:


$ cwlpack test.cwl --json
Packing test.cwl
Traceback (most recent call last):
  File "/home/cwlpack-venv/bin/cwlpack", line 8, in <module>
    sys.exit(localpack())
  File "/home/cwlpack-venv/lib/python3.8/site-packages/sbpack/pack.py", line 426, in localpack
    _localpack(sys.argv[1:])
  File "/home/cwlpack-venv/lib/python3.8/site-packages/sbpack/pack.py", line 454, in _localpack
    cwl = pack(
  File "/home/cwlpack-venv/lib/python3.8/site-packages/sbpack/pack.py", line 369, in pack
    cwl = pack_process(cwl, full_url, cwl["cwlVersion"], add_ids=add_ids)
  File "/home/cwlpack-venv/lib/python3.8/site-packages/sbpack/pack.py", line 69, in pack_process
    cwl = resolve_schemadefs(cwl, base_url, user_defined_types)
  File "/home/cwlpack-venv/lib/python3.8/site-packages/sbpack/pack.py", line 168, in resolve_schemadefs
    cwl = schemadef.inline_types(cwl, "inputs", base_url, user_defined_types)
  File "/home/cwlpack-venv/lib/python3.8/site-packages/sbpack/schemadef.py", line 109, in inline_types
    cwl[port] = [_inline_type(v, base_url, user_defined_types) for v in defs]
  File "/home/cwlpack-venv/lib/python3.8/site-packages/sbpack/schemadef.py", line 109, in <listcomp>
    cwl[port] = [_inline_type(v, base_url, user_defined_types) for v in defs]
  File "/home/cwlpack-venv/lib/python3.8/site-packages/sbpack/schemadef.py", line 175, in _inline_type
    f"In file {base_url.geturl()}, type {_type.get('name')} is missing type name")
AttributeError: 'NoneType' object has no attribute 'get'