2018-05-09 18:46:42 +00:00
#
# spec file for package python-annoy
#
2021-01-20 16:06:22 +00:00
# Copyright (c) 2021 SUSE LLC
2018-05-09 18:46:42 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2019-09-13 14:45:22 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2019-03-06 12:14:00 +00:00
#
2018-05-09 18:46:42 +00:00
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name : python-annoy
2021-01-20 16:06:22 +00:00
Version : 1.17.0
2018-05-09 18:46:42 +00:00
Release : 0
2019-03-17 15:30:45 +00:00
Summary : Approximation of Nearest Neighbors
2019-03-06 12:14:00 +00:00
License : Apache-2.0
2018-05-09 18:46:42 +00:00
Group : Development/Languages/Python
2020-01-16 19:26:07 +00:00
URL : https://github.com/spotify/annoy
2019-09-13 14:45:22 +00:00
Source : https://github.com/spotify/annoy/archive/v%{version} .tar.gz
2018-07-11 07:44:59 +00:00
# PATCH-FIX-OPENSUSE boo#1100677
Patch0 : reproducible.patch
2021-01-20 16:06:22 +00:00
Patch1 : denose.patch
BuildRequires : %{python_module cached-property}
2018-05-09 18:46:42 +00:00
BuildRequires : %{python_module devel}
2019-09-13 14:45:22 +00:00
BuildRequires : %{python_module h5py}
BuildRequires : %{python_module numpy}
BuildRequires : %{python_module pytest}
2018-05-09 18:46:42 +00:00
BuildRequires : %{python_module setuptools}
BuildRequires : c++_compiler
BuildRequires : fdupes
BuildRequires : python-rpm-macros
%python_subpackages
%description
Annoy (Approximate Nearest Neighbors) is a C++ library with Python
bindings to search for points in space that are close to a given
query point. It also creates large read-only file-based data
structures that are mmapped into memory so that many processes may
share the same data.
%prep
%setup -q -n annoy-%{version}
2018-07-11 07:44:59 +00:00
%patch0 -p1
2021-01-20 16:06:22 +00:00
%patch1 -p1
2019-09-13 14:45:22 +00:00
# fix testdata location
sed -i -e " s : ' t e s t / t e s t : ' t e s t : g " test/index_test.py
2018-05-09 18:46:42 +00:00
%build
2019-03-06 12:14:00 +00:00
export CFLAGS=" %{optflags} - f n o - s t r i c t - a l i a s i n g "
2018-05-09 18:46:42 +00:00
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot} %{$python_sitearch}
2019-09-13 14:45:22 +00:00
%check
# online tests: test_fashion_mnist, test_glove_25, test_nytimes_16
2019-09-25 07:35:37 +00:00
# fails on 32bit: test_distance_consistency
2020-03-02 08:40:45 +00:00
# fails on 32bit: test_very_large_index
2021-01-20 16:10:39 +00:00
# flakey on Python 3.6: AngularIndexTest.test_include_dists
2019-09-13 14:45:22 +00:00
cd test
2021-01-20 16:10:39 +00:00
%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))'
2019-09-13 14:45:22 +00:00
2018-05-09 18:46:42 +00:00
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitearch} /*
%changelog