forked from pool/python-annoy
Accepting request 865041 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/865041 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-annoy?expand=0&rev=10
This commit is contained in:
49
denose.patch
Normal file
49
denose.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
Index: annoy-1.17.0/test/accuracy_test.py
|
||||
===================================================================
|
||||
--- annoy-1.17.0.orig/test/accuracy_test.py
|
||||
+++ annoy-1.17.0/test/accuracy_test.py
|
||||
@@ -24,7 +24,6 @@ try:
|
||||
except ImportError:
|
||||
from urllib.request import urlretrieve # Python 3
|
||||
import gzip
|
||||
-from nose.plugins.attrib import attr
|
||||
|
||||
class AccuracyTest(unittest.TestCase):
|
||||
def _get_index(self, dataset):
|
||||
Index: annoy-1.17.0/test/hamming_index_test.py
|
||||
===================================================================
|
||||
--- annoy-1.17.0.orig/test/hamming_index_test.py
|
||||
+++ annoy-1.17.0/test/hamming_index_test.py
|
||||
@@ -12,11 +12,11 @@
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
|
||||
+import unittest
|
||||
import numpy
|
||||
import random
|
||||
from common import TestCase
|
||||
from annoy import AnnoyIndex
|
||||
-from nose.plugins.skip import SkipTest
|
||||
|
||||
|
||||
class HammingIndexTest(TestCase):
|
||||
@@ -85,7 +85,7 @@ class HammingIndexTest(TestCase):
|
||||
avg_dist = 1.0 * sum(dists) / len(dists)
|
||||
self.assertLessEqual(avg_dist, 0.42)
|
||||
|
||||
- @SkipTest # will fix later
|
||||
+ @unittest.skip('will fix later')
|
||||
def test_zero_vectors(self):
|
||||
# Mentioned on the annoy-user list
|
||||
bitstrings = [
|
||||
Index: annoy-1.17.0/setup.py
|
||||
===================================================================
|
||||
--- annoy-1.17.0.orig/setup.py
|
||||
+++ annoy-1.17.0/setup.py
|
||||
@@ -84,6 +84,5 @@ setup(name='annoy',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
],
|
||||
keywords='nns, approximate nearest neighbor search',
|
||||
- setup_requires=['nose>=1.0'],
|
||||
tests_require=['numpy', 'h5py']
|
||||
)
|
||||
@@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 20 15:12:43 UTC 2021 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Update to 1.17.0
|
||||
* multithreaded building + misc more
|
||||
- Add denose.patch to get rid of nose
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 20 15:09:53 UTC 2021 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- Skip one test flaky on Python 3.6
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 2 08:39:26 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-annoy
|
||||
#
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-annoy
|
||||
Version: 1.16.3
|
||||
Version: 1.17.0
|
||||
Release: 0
|
||||
Summary: Approximation of Nearest Neighbors
|
||||
License: Apache-2.0
|
||||
@@ -27,9 +27,10 @@ URL: https://github.com/spotify/annoy
|
||||
Source: https://github.com/spotify/annoy/archive/v%{version}.tar.gz
|
||||
# PATCH-FIX-OPENSUSE boo#1100677
|
||||
Patch0: reproducible.patch
|
||||
Patch1: denose.patch
|
||||
BuildRequires: %{python_module cached-property}
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module h5py}
|
||||
BuildRequires: %{python_module nose >= 1.0}
|
||||
BuildRequires: %{python_module numpy}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
@@ -48,6 +49,7 @@ share the same data.
|
||||
%prep
|
||||
%setup -q -n annoy-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
# fix testdata location
|
||||
sed -i -e "s:'test/test:'test:g" test/index_test.py
|
||||
|
||||
@@ -63,8 +65,9 @@ export CFLAGS="%{optflags} -fno-strict-aliasing"
|
||||
# online tests: test_fashion_mnist, test_glove_25, test_nytimes_16
|
||||
# fails on 32bit: test_distance_consistency
|
||||
# fails on 32bit: test_very_large_index
|
||||
# flakey on Python 3.6: AngularIndexTest.test_include_dists
|
||||
cd test
|
||||
%pytest_arch -k 'not (test_fashion_mnist or test_glove_25 or test_nytimes_16 or test_distance_consistency or test_very_large_index)'
|
||||
%pytest_arch -k 'not (test_fashion_mnist or test_glove_25 or test_nytimes_16 or test_distance_consistency or test_very_large_index or (AngularIndexTest and test_include_dists))'
|
||||
|
||||
%files %{python_files}
|
||||
%doc README.rst
|
||||
|
||||
@@ -3,11 +3,11 @@ Date: 2018-07-10
|
||||
|
||||
https://bugzilla.opensuse.org/show_bug.cgi?id=1100677
|
||||
|
||||
Index: annoy-1.16.3/setup.py
|
||||
Index: annoy-1.17.0/setup.py
|
||||
===================================================================
|
||||
--- annoy-1.16.3.orig/setup.py
|
||||
+++ annoy-1.16.3/setup.py
|
||||
@@ -38,22 +38,6 @@ with codecs.open('README.rst', encoding=
|
||||
--- annoy-1.17.0.orig/setup.py
|
||||
+++ annoy-1.17.0/setup.py
|
||||
@@ -39,17 +39,6 @@ with codecs.open('README.rst', encoding=
|
||||
extra_compile_args = ['-D_CRT_SECURE_NO_WARNINGS']
|
||||
extra_link_args = []
|
||||
|
||||
@@ -22,10 +22,17 @@ Index: annoy-1.16.3/setup.py
|
||||
-if os.name != 'nt':
|
||||
- extra_compile_args += ['-O3', '-ffast-math', '-fno-associative-math']
|
||||
-
|
||||
# Add multithreaded build flag for all platforms using Python 3 and
|
||||
# for non-Windows Python 2 platforms
|
||||
python_major_version = sys.version_info[0]
|
||||
@@ -59,11 +48,6 @@ if python_major_version == 3 or (python_
|
||||
if os.name != 'nt':
|
||||
extra_compile_args += ['-std=c++14']
|
||||
|
||||
-# #349: something with OS X Mojave causes libstd not to be found
|
||||
-if platform.system() == 'Darwin':
|
||||
- extra_compile_args += ['-std=c++11', '-mmacosx-version-min=10.9']
|
||||
- extra_link_args += ['-stdlib=libc++', '-mmacosx-version-min=10.9']
|
||||
- extra_compile_args += ['-mmacosx-version-min=10.12']
|
||||
- extra_link_args += ['-stdlib=libc++', '-mmacosx-version-min=10.12']
|
||||
-
|
||||
# Manual configuration, you're on your own here.
|
||||
manual_compiler_args = os.environ.get('ANNOY_COMPILER_ARGS', None)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7f37a81414ad1e1782565269fa57008643ef6c4d29cc348061da522f317a63b0
|
||||
size 670455
|
||||
3
v1.17.0.tar.gz
Normal file
3
v1.17.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2b162a148134525cbc405feb66f07b00f20d029c0872f48908c9761c604312f3
|
||||
size 672243
|
||||
Reference in New Issue
Block a user