git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #135874 from junjihashimoto/feature/bump-torchvision
commitcf15afd884ea692f028b63cd6434798777957c03 authorSandro <sandro.jaeckel@gmail.com> dateFri 17 Sep 2021, 11:19 (5 years ago) parent3333520cb5023d
4 files changed+63−17
maintainers/maintainer-list.nix+6 pkgs/development/python-modules/torchvision/bin.nix+2−2 pkgs/development/python-modules/torchvision/binary-hashes.nix+19−15 pkgs/development/python-modules/torchvision/prefetch.sh+36
maintainers/maintainer-list.nix+6
@@ -5472,6 +5472,12 @@
54725472 githubId = 39434424;
54735473 name = "Felix Springer";
54745474 };
5475+ junjihashimoto = {
5476+ email = "junji.hashimoto@gmail.com";
5477+ github = "junjihashimoto";
5478+ githubId = 2469618;
5479+ name = "Junji Hashimoto";
5480+ };
54755481 justinas = {
54765482 email = "justinas@justinas.org";
54775483 github = "justinas";
pkgs/development/python-modules/torchvision/bin.nix+2−2
@@ -15,7 +15,7 @@ let
1515 pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
1616 srcs = import ./binary-hashes.nix version;
1717 unsupported = throw "Unsupported system";
18− version = "0.9.1";
18+ version = "0.10.0";
1919in buildPythonPackage {
2020 inherit version;
2121
@@ -54,6 +54,6 @@ in buildPythonPackage {
5454 changelog = "https://github.com/pytorch/vision/releases/tag/v${version}";
5555 license = licenses.bsd3;
5656 platforms = platforms.linux;
57− maintainers = with maintainers; [ ];
57+ maintainers = with maintainers; [ junjihashimoto ];
5858 };
5959}
pkgs/development/python-modules/torchvision/binary-hashes.nix+19−15
@@ -3,20 +3,24 @@
33# Precompiled wheels can be found at:
44# https://download.pytorch.org/whl/torch_stable.html
55
6−version: {
7− x86_64-linux-37 = {
8− name = "torchvision-${version}-cp37-cp37m-linux_x86_64.whl";
9− url = "https://download.pytorch.org/whl/cu111/torchvision-${version}%2Bcu111-cp37-cp37m-linux_x86_64.whl";
10− hash = "sha256-7EMVB8KZg2I3P4RqnIVk/7OOAPA1OWOipns58cSCUrw=";
11− };
12− x86_64-linux-38 = {
13− name = "torchvision-${version}-cp38-cp38-linux_x86_64.whl";
14− url = "https://download.pytorch.org/whl/cu111/torchvision-${version}%2Bcu111-cp38-cp38-linux_x86_64.whl";
15− hash = "sha256-VjsCBW9Lusr4aDQLqaFh5dpV/5ZJ5PDs7nY4CbCHDTA=";
16− };
17− x86_64-linux-39 = {
18− name = "torchvision-${version}-cp39-cp39-linux_x86_64.whl";
19− url = "https://download.pytorch.org/whl/cu111/torchvision-${version}%2Bcu111-cp39-cp39-linux_x86_64.whl";
20− hash = "sha256-pzR7TBE+WcAmozskoeOVBuMkGJf9tvsaXsUkTcu86N8=";
6+# To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows.
7+
8+version : builtins.getAttr version {
9+ "0.10.0" = {
10+ x86_64-linux-37 = {
11+ name = "torchvision-0.10.0-cp37-cp37m-linux_x86_64.whl";
12+ url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.0%2Bcu111-cp37-cp37m-linux_x86_64.whl";
13+ hash = "sha256-yMgRhp06/rYIIiDNehNrZYIrvIbPvusCxGJL0mL+Bs4=";
14+ };
15+ x86_64-linux-38 = {
16+ name = "torchvision-0.10.0-cp38-cp38-linux_x86_64.whl";
17+ url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.0%2Bcu111-cp38-cp38-linux_x86_64.whl";
18+ hash = "sha256-p1bw+4KsdTuXle+AwXYQVL8elPMroAHV9lkXJGWbtPc=";
19+ };
20+ x86_64-linux-39 = {
21+ name = "torchvision-0.10.0-cp39-cp39-linux_x86_64.whl";
22+ url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.0%2Bcu111-cp39-cp39-linux_x86_64.whl";
23+ hash = "sha256-AOfhnHThVdJx5qxj2LTj+T9dPMFxQoxP3duxIm1y7KE=";
24+ };
2125 };
2226}
pkgs/development/python-modules/torchvision/prefetch.shnew file+36
@@ -0,0 +1,36 @@
1+#!/usr/bin/env nix-shell
2+#!nix-shell -i bash -p nix-prefetch-scripts
3+
4+version=$1
5+
6+bucket="https://download.pytorch.org/whl/cu111"
7+
8+url_and_key_list=(
9+"x86_64-linux-37 $bucket/torchvision-${version}%2Bcu111-cp37-cp37m-linux_x86_64.whl torchvision-${version}-cp37-cp37m-linux_x86_64.whl"
10+"x86_64-linux-38 $bucket/torchvision-${version}%2Bcu111-cp38-cp38-linux_x86_64.whl torchvision-${version}-cp38-cp38-linux_x86_64.whl"
11+"x86_64-linux-39 $bucket/torchvision-${version}%2Bcu111-cp39-cp39-linux_x86_64.whl torchvision-${version}-cp39-cp39-linux_x86_64.whl"
12+)
13+
14+hashfile=binary-hashes-"$version".nix
15+rm -f $hashfile
16+echo " \"$version\" = {" >> $hashfile
17+
18+for url_and_key in "${url_and_key_list[@]}"; do
19+ key=$(echo "$url_and_key" | cut -d' ' -f1)
20+ url=$(echo "$url_and_key" | cut -d' ' -f2)
21+ name=$(echo "$url_and_key" | cut -d' ' -f3)
22+
23+ echo "prefetching ${url}..."
24+ hash=$(nix hash to-sri --type sha256 `nix-prefetch-url "$url" --name "$name"`)
25+
26+ echo " $key = {" >> $hashfile
27+ echo " name = \"$name\";" >> $hashfile
28+ echo " url = \"$url\";" >> $hashfile
29+ echo " hash = \"$hash\";" >> $hashfile
30+ echo " };" >> $hashfile
31+
32+ echo
33+done
34+
35+echo " };" >> $hashfile
36+echo "done."