summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtakar Jašek2020-09-06 17:38:51 +0200
committerOtakar Jašek2020-09-06 17:38:51 +0200
commit4a4cfa8f32852702b70078a501e31409769ac843 (patch)
tree388948935dec7ab6b07d9c47e272867acd28032b
parentd9687454331cd6aacf56e648edbaefb65b974d45 (diff)
downloadaur-4a4cfa8f32852702b70078a501e31409769ac843.tar.gz
tests
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD9
-rw-r--r--tests.patch13
3 files changed, 22 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index cbf2a9c5204d..8dfb9592c81b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -16,7 +16,9 @@ pkgbase = faiss-git
depends = openmp
optdepends = intel-mkl
source = faiss::git+https://github.com/facebookresearch/faiss.git
+ source = tests.patch
sha256sums = SKIP
+ sha256sums = 0e90164da283d87b2ad176449b1ba441b7ce0c6343aa4dbb8d268483bf805ccd
pkgname = faiss-git
pkgdesc = A library for efficient similarity search and clustering of dense vectors.
diff --git a/PKGBUILD b/PKGBUILD
index 4a958f0a1d23..b4ba5a567772 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,8 +8,10 @@ url="https://github.com/facebookresearch/faiss"
license=('MIT')
pkgver=1.6.1.r90.g9873376
pkgrel=1
-source=(${_pkgname}::git+https://github.com/facebookresearch/faiss.git)
-sha256sums=('SKIP')
+source=(${_pkgname}::git+https://github.com/facebookresearch/faiss.git
+ 'tests.patch')
+sha256sums=('SKIP'
+ '0e90164da283d87b2ad176449b1ba441b7ce0c6343aa4dbb8d268483bf805ccd')
depends=('blas' 'lapack' 'openmp')
makedepends=('git' 'python' 'python-numpy' 'swig' 'python-setuptools' 'cmake')
optdepends=('intel-mkl')
@@ -22,6 +24,7 @@ pkgver() {
prepare() {
cd "${srcdir}/${_pkgname}"
+ patch -p1 < ../tests.patch # see https://github.com/facebookresearch/faiss/issues/1394
mkdir -p build
cd build
cmake .. \
@@ -35,6 +38,8 @@ prepare() {
check() {
cd "${srcdir}/${_pkgname}/build"
make test
+ cd "${srcdir}/${_pkgname}/tests"
+ PYTHONPATH=../build/faiss/python:$PYTHONPATH pytest
}
build() {
diff --git a/tests.patch b/tests.patch
new file mode 100644
index 000000000000..49a259a10c06
--- /dev/null
+++ b/tests.patch
@@ -0,0 +1,13 @@
+diff --git a/tests/test_contrib.py b/tests/test_contrib.py
+index 87155e9..ad9f64a 100644
+--- a/tests/test_contrib.py
++++ b/tests/test_contrib.py
+@@ -32,7 +32,7 @@ class TestComputeGT(unittest.TestCase):
+ Dnew, Inew = knn_ground_truth(xq, matrix_iterator(xb, 1000), 10)
+
+ np.testing.assert_array_equal(Iref, Inew)
+- np.testing.assert_almost_equal(Dref, Dnew, decimal=5)
++ np.testing.assert_almost_equal(Dref, Dnew, decimal=4)
+
+
+ class TestDatasets(unittest.TestCase):