Dump version for /custom/dumpsoftwareversions module itself (#764)

This commit is contained in:
Harshil Patel 2021-09-30 09:00:33 +01:00 committed by GitHub
parent 5a757b2981
commit 22ec5c6007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,10 +72,16 @@ process CUSTOM_DUMPSOFTWAREVERSIONS {
html.append("</table>") html.append("</table>")
return "\\n".join(html) return "\\n".join(html)
with open("$versions") as f: module_versions = {}
versions = yaml.safe_load(f) module_versions["${getProcessName(task.process)}"] = {
'python': platform.python_version(),
'yaml': yaml.__version__
}
versions["Workflow"] = { with open("$versions") as f:
workflow_versions = yaml.safe_load(f) | module_versions
workflow_versions["Workflow"] = {
"Nextflow": "$workflow.nextflow.version", "Nextflow": "$workflow.nextflow.version",
"$workflow.manifest.name": "$workflow.manifest.version" "$workflow.manifest.name": "$workflow.manifest.version"
} }
@ -86,20 +92,15 @@ process CUSTOM_DUMPSOFTWAREVERSIONS {
'section_href': 'https://github.com/${workflow.manifest.name}', 'section_href': 'https://github.com/${workflow.manifest.name}',
'plot_type': 'html', 'plot_type': 'html',
'description': 'are collected at run time from the software output.', 'description': 'are collected at run time from the software output.',
'data': _make_versions_html(versions) 'data': _make_versions_html(workflow_versions)
} }
with open("software_versions.yml", 'w') as f: with open("software_versions.yml", 'w') as f:
yaml.dump(versions, f, default_flow_style=False) yaml.dump(workflow_versions, f, default_flow_style=False)
with open("software_versions_mqc.yml", 'w') as f: with open("software_versions_mqc.yml", 'w') as f:
yaml.dump(versions_mqc, f, default_flow_style=False) yaml.dump(versions_mqc, f, default_flow_style=False)
yaml_version = {}
yaml_version["${getProcessName(task.process)}"] = {
'python': platform.python_version(),
'yaml': yaml.__version__
}
with open('versions.yml', 'w') as f: with open('versions.yml', 'w') as f:
yaml.dump(yaml_version, f, default_flow_style=False) yaml.dump(module_versions, f, default_flow_style=False)
""" """
} }