Skip to content

Commit

Permalink
Check PIN_PKG_COMPILER once
Browse files Browse the repository at this point in the history
Lookup key with `get`. If it is not found, it will be `None`. If it is
found, it can be used without another lookup.
  • Loading branch information
jakirkham authored Aug 13, 2024
1 parent e42c36b commit 5aaf25e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions grayskull/strategy/py_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,10 @@ def clean_list_pkg(pkg, list_pkgs):
pkg_name_match = RE_DEPS_NAME.match(pkg)
if pkg_name_match:
pkg_name = pkg_name_match.group(0)
if pkg_name in PIN_PKG_COMPILER.keys():
pkg_pin = PIN_PKG_COMPILER.get(pkg_name)
if pkg_pin is not None:
requirements["run"] = clean_list_pkg(pkg_name, requirements["run"])
requirements["run"].append(PIN_PKG_COMPILER[pkg_name])
requirements["run"].append(pkg_pin)


def discover_license(metadata: dict) -> List[ShortLicense]:
Expand Down

0 comments on commit 5aaf25e

Please sign in to comment.