0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-12 05:16:25 +03:00

update-python-libraries: don't error out on nix-prefetch-url errors

$ nix-prefetch-url --type sha256 --unpack https://api.github.com/repos/pkgw/pwkit/tarball/pwkit@1.2.0
error: store path 'rb2j54laxa71152bsqayw4h5hni2nshj-pwkit@1.2.0' contains illegal character '@'
This commit is contained in:
Martin Weinelt 2024-06-19 04:47:17 +02:00
parent f4b46cf524
commit 06922865e8

View file

@ -319,6 +319,7 @@ def _get_latest_version_github(attr_path, package, extension, current_version, t
tag_url = str(release["tarball_url"]).replace( tag_url = str(release["tarball_url"]).replace(
"tarball", "tarball/refs/tags" "tarball", "tarball/refs/tags"
) )
try:
hash = ( hash = (
subprocess.check_output( subprocess.check_output(
["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url], ["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url],
@ -327,6 +328,8 @@ def _get_latest_version_github(attr_path, package, extension, current_version, t
.decode("utf-8") .decode("utf-8")
.strip() .strip()
) )
except subprocess.CalledProcessError:
raise ValueError("nix-prefetch-url failed")
return version, hash, prefix return version, hash, prefix