From 0786f10510f5d5ebd027e49f0f2828200f63390b Mon Sep 17 00:00:00 2001 From: sukanka Date: Fri, 28 Apr 2023 22:25:42 +0800 Subject: [PATCH] fix archiving lilac.yaml for bioc --- updater/depends_updater.py | 7 ++++++- updater/pkg_archiver.py | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/updater/depends_updater.py b/updater/depends_updater.py index 2c13739..1306654 100755 --- a/updater/depends_updater.py +++ b/updater/depends_updater.py @@ -20,6 +20,8 @@ import re import requests # use | in lilac.yaml + + def str_presenter(dumper, data): """configures yaml for dumping multiline strings Ref: https://stackoverflow.com/questions/8640959/how-can-i-control-what-scalar-form-pyyaml-uses-for-my-data""" @@ -32,6 +34,7 @@ yaml.add_representer(str, str_presenter) yaml.representer.SafeRepresenter.add_representer( str, str_presenter) # to use with safe_dum + class PkgInfo: def __init__(self, pkgname=None, depends=None, optdepends=None, bioc_meta_mirror="https://bioconductor.org", @@ -315,7 +318,9 @@ class PkgInfo: if new_deps: docs['repo_depends'] = new_deps with open(yaml_file, 'w') as f: - yaml.dump(docs, f, sort_keys=False) + stream = yaml.dump(docs, sort_keys=False, + default_flow_style=False, indent=2) + f.write(stream) def create_temporary_copy(path): diff --git a/updater/pkg_archiver.py b/updater/pkg_archiver.py index aa5e0c5..206c645 100644 --- a/updater/pkg_archiver.py +++ b/updater/pkg_archiver.py @@ -58,7 +58,11 @@ def archive_pkg_yaml(bioconductor_version=3.15, yaml_file="lilac.yaml"): archive_url = f"https://cran.r-project.org/src/contrib/Archive/{pkg}" # Bioconductor ARCHIVE elif 'bioconductor.org' in url: - archive_url = url.replace('release', f"{bioconductor_version}") + # https://bioconductor.org/packages/AffyCompatible + # to + # https://bioconductor.org/packages/3.16/AffyCompatible + archive_url = url.replace( + 'packages', f"packages/{bioconductor_version}") if archive_url: docs['update_on'][url_idx]['url'] = archive_url with open(yaml_file, 'w') as f: