cran_skeleton

This module cleans up conda CRAN skeletons to make it compliant with conda-forge requirements.

Functions

add_maintainers(lines)

Append the contents of “maintainers.yaml” to the end of a YAML file.

clean_bld_file(package, no_windows)

Cleans bld.bat file created by conda skeleton cran to be compatible with conda-forge.

clean_build_file(package[, no_windows])

Cleans build.sh file created by conda skeleton cran to be compatible with conda-forge.

clean_skeleton_files(package[, no_windows])

Cleans output files created by conda skeleton cran to make them conda-forge compatible.

clean_yaml_file(package, no_windows)

Cleans the YAML file output by conda skeleton cran to make it conda-forge compatible.

filter_lines_regex(lines, regex, substitute)

Substitutes substitute for every match to regex in each line of lines.

main()

Adding support for arguments here

remove_empty_lines(lines)

Removes consecutive empty lines in lines.

write_recipe(package[, recipe_dir, …])

Call out to to conda skeleton cran.

Documentation

bioconda_utils.cran_skeleton.add_maintainers(lines)[source]

Append the contents of “maintainers.yaml” to the end of a YAML file.

bioconda_utils.cran_skeleton.clean_bld_file(package, no_windows)[source]

Cleans bld.bat file created by conda skeleton cran to be compatible with conda-forge.

Parameters
  • package (str) – Must be sanitized “r-pkgname” package name.

  • no_windows (bool) – If True, then the bld.bat file will be removed.

bioconda_utils.cran_skeleton.clean_build_file(package, no_windows=False)[source]

Cleans build.sh file created by conda skeleton cran to be compatible with conda-forge.

Parameters
  • package (str) – Must be sanitized “r-pkgname” package name.

  • no_windows (bool) – Included for consistency with other clean_* functions; does not have any effect for this function.

bioconda_utils.cran_skeleton.clean_skeleton_files(package, no_windows=True)[source]

Cleans output files created by conda skeleton cran to make them conda-forge compatible.

Parameters
  • package (str) – Package name. Can be case-sensitive CRAN name, or sanitized “r-pkgname” conda package name.

  • no_windows (bool) – If True, no bld.bat will be created and no [win] preprocess selectors will be added to the yaml

bioconda_utils.cran_skeleton.clean_yaml_file(package, no_windows)[source]

Cleans the YAML file output by conda skeleton cran to make it conda-forge compatible.

Parameters
  • package (str) – Must be sanitized “r-pkgname” package name.

  • no_windows (bool) – If True, then adds a “build: skip: True # [win32]” line to skip Windows builds.

bioconda_utils.cran_skeleton.filter_lines_regex(lines, regex, substitute)[source]

Substitutes substitute for every match to regex in each line of lines.

Parameters
  • lines (iterable of strings) –

  • substitute (regex,) –

bioconda_utils.cran_skeleton.main()[source]

Adding support for arguments here

bioconda_utils.cran_skeleton.remove_empty_lines(lines)[source]

Removes consecutive empty lines in lines.

Parameters

lines (iterable of strings) –

bioconda_utils.cran_skeleton.write_recipe(package, recipe_dir='.', recursive=False, force=False, no_windows=False, **kwargs)[source]

Call out to to conda skeleton cran.

Kwargs are accepted for uniformity with bioconductor_skeleton.write_recipe; the only one handled here is recursive.

Parameters
  • package (str) – Package name. Can be case-sensitive CRAN name, or sanitized “r-pkgname” conda package name.

  • recipe_dir (str) – Recipe will be created as a subdirectory in recipe_dir

  • recursive (bool) – Add the --recursive argument to conda skeleton cran to recursively build CRAN recipes.

  • force (bool) – If True, then remove the directory <recipe_dir>/<pkgname>, where <pkgname> the sanitized conda version of the package name, regardless of which format was provided as package.

  • no_windows (bool) – If True, then after creating the skeleton the files are then cleaned of any Windows-related lines and the bld.bat file is removed from the recipe.