From 48b14129788ee8e89b931c55baf0337f84f9724b31e7dc298cb7ae938bb9cdd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 20 Jan 2021 16:06:22 +0000 Subject: [PATCH 1/2] Accepting request 865023 from home:mcalabkova:branches:devel:languages:python - Update to 1.17.0 * multithreaded building + misc more - Add denose.patch to get rid of nose OBS-URL: https://build.opensuse.org/request/show/865023 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-annoy?expand=0&rev=19 --- denose.patch | 49 ++++++++++++++++++++++++++++++++++++++++++++ python-annoy.changes | 7 +++++++ python-annoy.spec | 8 +++++--- reproducible.patch | 19 +++++++++++------ v1.16.3.tar.gz | 3 --- v1.17.0.tar.gz | 3 +++ 6 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 denose.patch delete mode 100644 v1.16.3.tar.gz create mode 100644 v1.17.0.tar.gz diff --git a/denose.patch b/denose.patch new file mode 100644 index 0000000..b0b3ba6 --- /dev/null +++ b/denose.patch @@ -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'] + ) diff --git a/python-annoy.changes b/python-annoy.changes index 6ba3795..c9cae5b 100644 --- a/python-annoy.changes +++ b/python-annoy.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 20 15:12:43 UTC 2021 - Markéta Machová + +- Update to 1.17.0 + * multithreaded building + misc more +- Add denose.patch to get rid of nose + ------------------------------------------------------------------- Mon Mar 2 08:39:26 UTC 2020 - Tomáš Chvátal diff --git a/python-annoy.spec b/python-annoy.spec index 1ec791e..cf9ff34 100644 --- a/python-annoy.spec +++ b/python-annoy.spec @@ -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 diff --git a/reproducible.patch b/reproducible.patch index b3d35c5..c962914 100644 --- a/reproducible.patch +++ b/reproducible.patch @@ -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) diff --git a/v1.16.3.tar.gz b/v1.16.3.tar.gz deleted file mode 100644 index a4f0726..0000000 --- a/v1.16.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7f37a81414ad1e1782565269fa57008643ef6c4d29cc348061da522f317a63b0 -size 670455 diff --git a/v1.17.0.tar.gz b/v1.17.0.tar.gz new file mode 100644 index 0000000..e56c43c --- /dev/null +++ b/v1.17.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b162a148134525cbc405feb66f07b00f20d029c0872f48908c9761c604312f3 +size 672243 From 5b23b335c1ea04dc8ab47b38f6dabf5f288089710103b462c63b29e302c51145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 20 Jan 2021 16:10:39 +0000 Subject: [PATCH 2/2] Accepting request 865030 from home:jayvdb:branches:devel:languages:python:numeric - Skip one test flaky on Python 3.6 OBS-URL: https://build.opensuse.org/request/show/865030 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-annoy?expand=0&rev=20 --- python-annoy.changes | 5 +++++ python-annoy.spec | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/python-annoy.changes b/python-annoy.changes index c9cae5b..a21aa75 100644 --- a/python-annoy.changes +++ b/python-annoy.changes @@ -5,6 +5,11 @@ Wed Jan 20 15:12:43 UTC 2021 - Markéta Machová * multithreaded building + misc more - Add denose.patch to get rid of nose +------------------------------------------------------------------- +Wed Jan 20 15:09:53 UTC 2021 - John Vandenberg + +- Skip one test flaky on Python 3.6 + ------------------------------------------------------------------- Mon Mar 2 08:39:26 UTC 2020 - Tomáš Chvátal diff --git a/python-annoy.spec b/python-annoy.spec index cf9ff34..3fa9a91 100644 --- a/python-annoy.spec +++ b/python-annoy.spec @@ -65,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