15
0
forked from pool/python-annoy

Accepting request 1133419 from devel:languages:python

- update to version 1.17.3
  update to 1.17.3:
  * Essentially just #645 which fixes compilation on OS X
  update to 1.17.2:
  * Fixed memory leak reported in #633
- drop unneeded denose.patch (they switched to pytest)

OBS-URL: https://build.opensuse.org/request/show/1133419
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-annoy?expand=0&rev=13
This commit is contained in:
2023-12-15 20:50:21 +00:00
committed by Git OBS Bridge
6 changed files with 29 additions and 72 deletions

View File

@@ -1,49 +0,0 @@
Index: annoy-1.17.1/test/accuracy_test.py
===================================================================
--- annoy-1.17.1.orig/test/accuracy_test.py
+++ annoy-1.17.1/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.1/test/hamming_index_test.py
===================================================================
--- annoy-1.17.1.orig/test/hamming_index_test.py
+++ annoy-1.17.1/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.1/setup.py
===================================================================
--- annoy-1.17.1.orig/setup.py
+++ annoy-1.17.1/setup.py
@@ -88,6 +88,5 @@ setup(name='annoy',
'Programming Language :: Python :: 3.9',
],
keywords='nns, approximate nearest neighbor search',
- setup_requires=['nose>=1.0'],
tests_require=['numpy', 'h5py']
)

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Oct 30 12:36:17 UTC 2023 - pgajdos@suse.com
- update to version 1.17.3
update to 1.17.3:
* Essentially just #645 which fixes compilation on OS X
update to 1.17.2:
* Fixed memory leak reported in #633
- drop unneeded denose.patch (they switched to pytest)
-------------------------------------------------------------------
Mon Jan 2 14:23:16 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@@ -16,10 +16,9 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python36 1
Name: python-annoy
Version: 1.17.1
Version: 1.17.3
Release: 0
Summary: Approximation of Nearest Neighbors
License: Apache-2.0
@@ -27,7 +26,6 @@ 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}
@@ -47,13 +45,12 @@ structures that are mmapped into memory so that many processes may
share the same data.
%prep
%setup -q -n annoy-%{version}
%patch0 -p1
%patch1 -p1
%autosetup -p1 -n annoy-%{version}
# fix testdata location
sed -i -e "s:'test/test:'test:g" test/index_test.py
%build
sed -i '/setup_requires/d' setup.py
export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_build
@@ -65,13 +62,12 @@ 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 or (AngularIndexTest and test_include_dists))'
%pytest_arch -k 'not (test_fashion_mnist or test_glove_25 or test_nytimes_16 or test_distance_consistency or test_very_large_index)'
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitearch}/*
%{python_sitearch}/annoy
%{python_sitearch}/annoy*-info
%changelog

View File

@@ -3,28 +3,28 @@ Date: 2018-07-10
https://bugzilla.opensuse.org/show_bug.cgi?id=1100677
Index: annoy-1.17.1/setup.py
Index: annoy-1.17.3/setup.py
===================================================================
--- annoy-1.17.1.orig/setup.py
+++ annoy-1.17.1/setup.py
@@ -39,17 +39,6 @@ with codecs.open('README.rst', encoding=
--- annoy-1.17.3.orig/setup.py
+++ annoy-1.17.3/setup.py
@@ -38,17 +38,6 @@ with codecs.open('README.rst', encoding=
# Various platform-dependent extras
extra_compile_args = ['-D_CRT_SECURE_NO_WARNINGS', '-fpermissive']
extra_link_args = []
-# Not all CPUs have march as a tuning parameter
-cputune = ['-march=native',]
-if platform.machine() == 'ppc64le':
- extra_compile_args += ['-mcpu=native',]
-
-if platform.machine() == 'x86_64':
- extra_compile_args += cputune
- # do not apply march on Intel Darwin
- if platform.system() != 'Darwin':
- # Not all CPUs have march as a tuning parameter
- extra_compile_args += ['-march=native',]
-
-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']

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4f7a2f2d86d45b432de68dba06667b23d0ce2b03595d64bd5c05f42dc32e7f4b
size 674087

3
v1.17.3.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c121d38cacd98f5103b24ca4e94ca097f18179eed3037e9eb93ad70ec1e6356e
size 673452