From 529e5690ced2298d7a8615b6791c921aa643dcf88028048f5dc94d30a7cbd4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 15 Dec 2023 12:15:46 +0000 Subject: [PATCH 1/2] Accepting request 1133132 from home:pgajdos:python pmmu version update OBS-URL: https://build.opensuse.org/request/show/1133132 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-annoy?expand=0&rev=26 --- denose.patch | 49 -------------------------------------------- python-annoy.changes | 10 +++++++++ python-annoy.spec | 17 +++++++-------- reproducible.patch | 20 +++++++++--------- v1.17.1.tar.gz | 3 --- v1.17.3.tar.gz | 3 +++ 6 files changed, 30 insertions(+), 72 deletions(-) delete mode 100644 denose.patch delete mode 100644 v1.17.1.tar.gz create mode 100644 v1.17.3.tar.gz diff --git a/denose.patch b/denose.patch deleted file mode 100644 index 44bcadd..0000000 --- a/denose.patch +++ /dev/null @@ -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'] - ) diff --git a/python-annoy.changes b/python-annoy.changes index defea7b..8827e0d 100644 --- a/python-annoy.changes +++ b/python-annoy.changes @@ -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 diff --git a/python-annoy.spec b/python-annoy.spec index a7ec1ec..4dd9edb 100644 --- a/python-annoy.spec +++ b/python-annoy.spec @@ -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,13 @@ 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))' +#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)' %files %{python_files} %doc README.rst %license LICENSE -%{python_sitearch}/* +%{python_sitearch}/annoy +%{python_sitearch}/annoy*-info %changelog diff --git a/reproducible.patch b/reproducible.patch index 6b6f847..c855ae6 100644 --- a/reproducible.patch +++ b/reproducible.patch @@ -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'] diff --git a/v1.17.1.tar.gz b/v1.17.1.tar.gz deleted file mode 100644 index 21bf7cd..0000000 --- a/v1.17.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f7a2f2d86d45b432de68dba06667b23d0ce2b03595d64bd5c05f42dc32e7f4b -size 674087 diff --git a/v1.17.3.tar.gz b/v1.17.3.tar.gz new file mode 100644 index 0000000..75018bc --- /dev/null +++ b/v1.17.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c121d38cacd98f5103b24ca4e94ca097f18179eed3037e9eb93ad70ec1e6356e +size 673452 From 00010c7be6a0d8ab3f2eb7ef1fc3597e1bfd4fb469b51192397bd69637e95fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 15 Dec 2023 12:16:25 +0000 Subject: [PATCH 2/2] delete commented out command OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-annoy?expand=0&rev=27 --- python-annoy.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python-annoy.spec b/python-annoy.spec index 4dd9edb..7c6afbe 100644 --- a/python-annoy.spec +++ b/python-annoy.spec @@ -62,7 +62,6 @@ 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 -#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)' %files %{python_files}