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