common-workflow-lab / python-cwlgen

Generation of CWL programmatically. Available types: CommandLineTool and DockerRequirement
https://github.com/common-workflow-language/cwl-utils
MIT License
29 stars 13 forks source link

Add parsing of Requirements for Workflow / CommandLineTool #26

Closed illusional closed 4 years ago

illusional commented 5 years ago

Fixes #25

Adds explicit parsing of the Requirements field for Workflow / CommandLineTool.

It's doesn't work yet for InputRecordSchemaDef due to the way the parsing handles subtypes. In theory, you should be able to change L219 of utils.py to read (remove the _generic for function):

return T.parse_dict(value) if not isinstance(value, list) else [T.parse_dict(vv) for vv in value]

But I'm getting a parse_dict() missing 1 required positional argument: 'd' or if I add the param I get a too many args exception.

codecov[bot] commented 5 years ago

Codecov Report

Merging #26 into master will decrease coverage by 1.13%. The diff coverage is 77.88%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #26      +/-   ##
=======================================
- Coverage   83.13%   82%   -1.14%     
=======================================
  Files          10    10              
  Lines         593   678      +85     
=======================================
+ Hits          493   556      +63     
- Misses        100   122      +22
Impacted Files Coverage Δ
cwlgen/import_cwl.py 95.23% <100%> (+0.79%) :arrow_up:
cwlgen/commandlinetool.py 89.01% <100%> (+1.66%) :arrow_up:
cwlgen/workflow.py 93.22% <100%> (+1.38%) :arrow_up:
cwlgen/requirements.py 75.69% <63.33%> (-2.09%) :arrow_down:
cwlgen/utils.py 77.62% <72.09%> (-5.11%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e88fa2d...c5cbb1f. Read the comment docs.

illusional commented 5 years ago

I disabled the typed parsing of SchemaDefRequirement.types and logged it in the README as a known issue in c5cbb1f (it still parses as a simple dict).

illusional commented 4 years ago

I'm going to merge this. Because of a backwards incompatible rename (to closer align to spec), this card should trigger a major release (to v0.4.0).

This merge closes #25