Skip to content

Commit

Permalink
Work around broken conda-forge packages, in particular conda-forge/ru…
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Nov 11, 2020
1 parent e6aa2ec commit 5ca252d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions repo_helper/conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 5ca252d

Please sign in to comment.