[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/13: gnu: onnx: Change source to 'git-fetch'.
From: |
guix-commits |
Subject: |
06/13: gnu: onnx: Change source to 'git-fetch'. |
Date: |
Fri, 30 Jul 2021 19:04:27 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 630c39d8df7557b6a0941c1d5ee879e487de0f5e
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Jul 30 17:26:24 2021 +0200
gnu: onnx: Change source to 'git-fetch'.
* gnu/packages/machine-learning.scm (onnx)[source]: Change to
'git-fetch'. Add "onnx-skip-model-downloads.patch".
[arguments]: Add 'make-test-directory-writable' phase.
* gnu/packages/patches/onnx-skip-model-downloads.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/machine-learning.scm | 31 +++++++++++++++-------
.../patches/onnx-skip-model-downloads.patch | 16 +++++++++++
3 files changed, 38 insertions(+), 10 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index e6c03cb..450d957 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1514,6 +1514,7 @@ dist_patch_DATA =
\
%D%/packages/patches/oneko-remove-nonfree-characters.patch \
%D%/packages/patches/onnx-use-system-googletest.patch \
%D%/packages/patches/onnx-shared-libraries.patch \
+ %D%/packages/patches/onnx-skip-model-downloads.patch \
%D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch \
%D%/packages/patches/opencascade-oce-glibc-2.26.patch \
%D%/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch \
diff --git a/gnu/packages/machine-learning.scm
b/gnu/packages/machine-learning.scm
index 75faeb8..177d1aa 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -585,16 +585,20 @@ in terms of new algorithms.")
(package
(name "onnx")
(version "1.9.0")
- (source
- (origin
- (method url-fetch)
- (uri (pypi-uri "onnx" version))
- (patches (search-patches "onnx-use-system-googletest.patch"
- "onnx-shared-libraries.patch"))
- (sha256
- (base32 "0yjv2axz2vc2ysniwislsp53fsb8f61y1warrr2ppn2d9ijml1d9"))
- (modules '((guix build utils)))
- (snippet '(delete-file-recursively "third_party"))))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/onnx/onnx")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32
+ "1xnii361f68x0masxgfc4ai7hh3wlxxk56aznwf4m4yr6wqx47ml"))
+ (file-name (git-file-name name version))
+ (patches (search-patches "onnx-use-system-googletest.patch"
+ "onnx-shared-libraries.patch"
+ "onnx-skip-model-downloads.patch"))
+ (modules '((guix build utils)))
+ (snippet '(delete-file-recursively "third_party"))))
(build-system python-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
@@ -625,6 +629,13 @@ in terms of new algorithms.")
;; -j'.
(setenv "MAX_JOBS"
(number->string (parallel-job-count)))))
+ (add-before 'check 'make-test-directory-writable
+ (lambda _
+ ;; Make things writable for tests.
+ (setenv "HOME" (getcwd))
+ (for-each make-file-writable
+ (find-files "onnx/examples" "."
+ #:directories? #t))))
(add-after 'install 'install-from-cmake
(lambda _
;; Run "make install" in the build tree 'setup.py'
diff --git a/gnu/packages/patches/onnx-skip-model-downloads.patch
b/gnu/packages/patches/onnx-skip-model-downloads.patch
new file mode 100644
index 0000000..4ab55b4
--- /dev/null
+++ b/gnu/packages/patches/onnx-skip-model-downloads.patch
@@ -0,0 +1,16 @@
+A few tests require downloading models from URLs such as
+ <https://s3.amazonaws.com/download.onnx/models/opset_9/zfnet512.tar.gz>.
+Skip those.
+
+diff --git a/onnx/backend/test/runner/__init__.py
b/onnx/backend/test/runner/__init__.py
+index 049ed57b..f236f1bf 100644
+--- a/onnx/backend/test/runner/__init__.py
++++ b/onnx/backend/test/runner/__init__.py
+@@ -202,6 +202,7 @@ class Runner(object):
+ print('Start downloading model {} from {}'.format(
+ model_test.model_name,
+ model_test.url))
++ raise unittest.SkipTest('Skipping download')
+ urlretrieve(model_test.url, download_file.name)
+ print('Done')
+ with tarfile.open(download_file.name) as t:
- branch master updated (721e380 -> db2c7e7), guix-commits, 2021/07/30
- 01/13: gnu: python-onnx: Update to 1.9.0., guix-commits, 2021/07/30
- 02/13: gnu: python-onnx: Move comment to the patch header., guix-commits, 2021/07/30
- 03/13: gnu: python-onnx: Delete bundled software., guix-commits, 2021/07/30
- 04/13: gnu: python-onnx: Install libonnx.so and libonnx_proto.so., guix-commits, 2021/07/30
- 05/13: gnu: python-onnx: Rename to "onnx"., guix-commits, 2021/07/30
- 06/13: gnu: onnx: Change source to 'git-fetch'.,
guix-commits <=
- 07/13: gnu: python-yubikey-manager: Fix libykpers reference., guix-commits, 2021/07/30
- 10/13: gnu: Add libmobi., guix-commits, 2021/07/30
- 11/13: gnu: racket: Update to 8.2., guix-commits, 2021/07/30
- 13/13: gnu: racket-minimal: Bootstrap from C., guix-commits, 2021/07/30
- 09/13: gnu: guile-dbd-sqlite3: Replace 'url-fetch' by 'git-fetch'., guix-commits, 2021/07/30
- 08/13: gnu: guile-dbi: Replace 'url-fetch' by 'git-fetch'., guix-commits, 2021/07/30
- 12/13: gnu: racket: Unbundle racket-minimal., guix-commits, 2021/07/30