From 5ca252dd49d6dbc72557a400ae677bfc33e2bf85 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 11 Nov 2020 14:08:10 +0000 Subject: [PATCH] Work around broken conda-forge packages, in particular https://github.com/conda-forge/ruamel.yaml-feedstock/issues/7 --- repo_helper/conda.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/repo_helper/conda.py b/repo_helper/conda.py index c60adb48..713e10cc 100644 --- a/repo_helper/conda.py +++ b/repo_helper/conda.py @@ -156,6 +156,12 @@ def validate_requirements( conda_packages.add(package) for requirement in requirements: + + # Check alias_mapping first + if requirement.name in alias_mapping: + requirement.name = alias_mapping[requirement.name] + continue + matches = difflib.get_close_matches(requirement.name, conda_packages) for match in matches: if normalize(match) == requirement.name: @@ -205,3 +211,10 @@ def make_recipe(repo_dir: PathLike, recipe_file: PathLike) -> None: # - {{ import_name }} = {{ import_name }}:main # skip_compile_pyc: # - "*/templates/*.py" # These should not (and cannot) be compiled + + +#: Mapping of normalised names to names on conda, if they differ for some reason +alias_mapping = { + "ruamel_yaml": "ruamel.yaml" + } +# Really just due to https://github.com/conda-forge/ruamel.yaml-feedstock/issues/7