mirror of
https://github.com/BioArchLinux/bioarchlinux-tools.git
synced 2025-03-09 22:53:31 +00:00
fix archiving lilac.yaml for bioc
This commit is contained in:
parent
f8506f1c45
commit
0786f10510
2 changed files with 11 additions and 2 deletions
|
@ -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):
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue