Skip to content

Commit

Permalink
Fix static mapping not always appearing in the grayskull style mappin…
Browse files Browse the repository at this point in the history
…g file (#1891)

* Fix static mapping not always appearing in the grayskull style mapping file

* Discard changes to environment.yml

* Discard changes to .gitignore

---------

Co-authored-by: regro-cf-autotick-bot <36490558+regro-cf-autotick-bot@users.noreply.github.com>
  • Loading branch information
mariusvniekerk and regro-cf-autotick-bot committed Oct 20, 2023
1 parent f48ca08 commit 5de9ce0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion conda_forge_tick/pypi_name_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def convert_to_grayskull_style_yaml(
def add_missing_pypi_names(
pypi_mapping: Dict[PypiName, Mapping],
mappings: List[Mapping],
overrides: List[Mapping],
) -> Dict[PypiName, Mapping]:
"""Add missing PyPI names to the Grayskull mapping.
Expand All @@ -221,6 +222,11 @@ def add_missing_pypi_names(
pypi_name = mapping["pypi_name"]
if pypi_name not in unsorted_mapping:
missing_mappings_by_pypi_name[mapping["pypi_name"]].append(mapping)
# Always add in the overrides
for mapping in overrides:
pypi_name = mapping["pypi_name"]
missing_mappings_by_pypi_name[mapping["pypi_name"]].append(mapping)

for pypi_name, candidates in missing_mappings_by_pypi_name.items():
unsorted_mapping[pypi_name] = resolve_collisions(candidates)
return dict(sorted(unsorted_mapping.items()))
Expand Down Expand Up @@ -404,7 +410,8 @@ def main(args) -> None:
grayskull_style_from_imports = convert_to_grayskull_style_yaml(best_imports)
grayskull_style = add_missing_pypi_names(
grayskull_style_from_imports,
pypi_package_mappings + static_packager_mappings,
pypi_package_mappings,
static_packager_mappings,
)

dirname = pathlib.Path(".") / "mappings" / "pypi"
Expand Down

0 comments on commit 5de9ce0

Please sign in to comment.