Skip to content

ruamel.yaml doesn't support yaml.dump() #285

Open
@alexiswl

Description

@alexiswl

cwl-utils requirements uses less than <0.19

However yaml.dump was deprecated in version 0.18 and is not supported.

Steps to reproduce

# Install working

pip install cwl-utils==0.32
pip install ruamel.yaml==0.17.40

## Run GraphSplit
cwl-graph-split --outdir workflow/ pipeline.cwl.json 

## Install failing
pip install ruamel.yaml==0.18.0

## Run Graph Split
cwl-graph-split --outdir workflow/ pipeline.cwl.json 

Gives

Click to expand!
Traceback (most recent call last):
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 180, in rewrite
    return rewrite_schemadef(document)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 227, in rewrite_schemadef
    dump([entry], entry_handle, Dumper=RoundTripDumper)
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/ruamel/yaml/main.py", line 1229, in dump
    error_deprecation('dump', 'dump', arg="typ='unsafe', pure=True")
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/ruamel/yaml/main.py", line 1017, in error_deprecation
    sys.exit(1)
SystemExit: 1

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 182, in rewrite
    imports.update(rewrite(value, doc_id))
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 135, in rewrite
    imports.update(rewrite(entry, doc_id))
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 139, in rewrite
    with SourceLine(document, key, Exception):
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/schema_salad/sourceline.py", line 249, in __exit__
    raise self.makeError(str(exc_value)) from exc_value
Exception: pipeline.cwl.json:208:11: 1

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/media/UMCCR/Projects/202402/schema-testing/venv/bin/cwl-graph-split", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 65, in main
    sys.exit(run(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 73, in run
    graph_split(
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 113, in graph_split
    imports = rewrite(entry, entry_id)
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/cwl_utils/graph_split.py", line 139, in rewrite
    with SourceLine(document, key, Exception):
  File "/media/UMCCR/Projects/202402/schema-testing/venv/lib/python3.11/site-packages/schema_salad/sourceline.py", line 249, in __exit__
    raise self.makeError(str(exc_value)) from exc_value
Exception: pipeline.cwl.json:208:11: 1

pipeline.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions