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

pack: add $namespaces to the (effective) root only #1506

Merged
merged 2 commits into from
Sep 4, 2021

Conversation

mr-c
Copy link
Member

@mr-c mr-c commented Sep 4, 2021

@codecov
Copy link

codecov bot commented Sep 4, 2021

Codecov Report

Merging #1506 (62e3d40) into main (5a1488b) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1506      +/-   ##
==========================================
- Coverage   65.67%   65.63%   -0.05%     
==========================================
  Files          89       89              
  Lines       15902    15906       +4     
  Branches     4027     4029       +2     
==========================================
- Hits        10444    10440       -4     
- Misses       4329     4337       +8     
  Partials     1129     1129              
Impacted Files Coverage Δ
cwltool/pack.py 86.74% <100.00%> (+0.14%) ⬆️
job.py 61.49% <0.00%> (-0.81%) ⬇️
cwltool/job.py 77.66% <0.00%> (-0.41%) ⬇️
pack.py 9.39% <0.00%> (-0.11%) ⬇️

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 5a1488b...62e3d40. Read the comment docs.

@mr-c mr-c changed the title pack: add $namespaces to the (efffective) root only pack: add $namespaces to the (effective) root only Sep 4, 2021
@mr-c mr-c enabled auto-merge (squash) September 4, 2021 15:18
@mr-c mr-c disabled auto-merge September 4, 2021 15:18
@mr-c mr-c enabled auto-merge (squash) September 4, 2021 15:19
@mr-c mr-c merged commit cd9fde3 into main Sep 4, 2021
@mr-c mr-c deleted the pack_namespaces_in_main branch September 4, 2021 15:52
@simleo
Copy link
Contributor

simleo commented May 26, 2022

If anyone has an old packed workflow that you can't read with cwl-utils due to this, here's a workaround:

import json
from pathlib import Path
from cwl_utils.parser import load_document_by_yaml

wf_path = Path("packed.cwl")
with open(wf_path, "rt") as f:
    json_wf = json.load(f)
graph = json_wf.get("$graph", [json_wf])  # support single tool
for n in graph:
    ns = n.pop("$namespaces", {})
    if ns:
        json_wf.setdefault("$namespaces", {}).update(ns)
doc = load_document_by_yaml(json_wf, wf_path.absolute().as_uri())

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

Successfully merging this pull request may close these issues.

2 participants