From 5c85fb3ce12db4f562a480e1b9b71ef7a9c5c47b Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Wed, 10 Jul 2024 18:37:56 -0400 Subject: [PATCH] update-python-libraries: fix updating packages without src.fetcher --- .../update-python-libraries.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py index 555d15b8ca4d..57153383fc18 100755 --- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py +++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py @@ -275,16 +275,17 @@ def _get_latest_version_github(attr_path, package, extension, current_version, t release = next(filter(lambda x: strip_prefix(x["tag_name"]) == version, releases)) prefix = get_prefix(release["tag_name"]) - # some attributes require using the fetchgit - git_fetcher_args = [] - if _get_attr_value(f"{attr_path}.src.fetchSubmodules"): - git_fetcher_args.append("--fetch-submodules") - if _get_attr_value(f"{attr_path}.src.fetchLFS"): - git_fetcher_args.append("--fetch-lfs") - if _get_attr_value(f"{attr_path}.src.leaveDotGit"): - git_fetcher_args.append("--leave-dotGit") + fetcher = _get_attr_value(f"{attr_path}.src.fetcher") + if fetcher is not None and fetcher.endswith("nix-prefetch-git"): + # some attributes require using the fetchgit + git_fetcher_args = [] + if _get_attr_value(f"{attr_path}.src.fetchSubmodules"): + git_fetcher_args.append("--fetch-submodules") + if _get_attr_value(f"{attr_path}.src.fetchLFS"): + git_fetcher_args.append("--fetch-lfs") + if _get_attr_value(f"{attr_path}.src.leaveDotGit"): + git_fetcher_args.append("--leave-dotGit") - if git_fetcher_args or _get_attr_value(f"{attr_path}.src.fetcher").endswith("nix-prefetch-git"): algorithm = "sha256" cmd = [ "nix-prefetch-git",