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

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

Open
alexiswl opened this issue Feb 13, 2024 · 1 comment · May be fixed by #287
Open

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

alexiswl opened this issue Feb 13, 2024 · 1 comment · May be fixed by #287

Comments

@alexiswl
Copy link
Contributor

alexiswl commented Feb 13, 2024

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

@mr-c
Copy link
Member

mr-c commented Feb 13, 2024

Yep,

dump([entry], entry_handle, Dumper=RoundTripDumper)
should be changed to use the yaml_dump function or similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants