update-python-libraries: fix updating packages without src.fetcher

This commit is contained in:
Kira Bruneau 2024-07-10 18:37:56 -04:00
parent 16e401f018
commit 5c85fb3ce1

View File

@ -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",