1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 h5py,
6 numpy,
7 pynose,
8 pythonOlder,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "annoy";
14 version = "1.17.3";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-nL/r7+Cl+EPropxr5MhNYB9PQa1N7QSG8biMOwdznBU=";
22 };
23
24 postPatch = ''
25 substituteInPlace setup.py \
26 --replace-fail "'nose>=1.0'" ""
27 '';
28
29 build-system = [ setuptools ];
30
31 nativeBuildInputs = [ h5py ];
32
33 nativeCheckInputs = [
34 numpy
35 pynose
36 ];
37
38 pythonImportsCheck = [ "annoy" ];
39
40 meta = with lib; {
41 description = "Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk";
42 homepage = "https://github.com/spotify/annoy";
43 changelog = "https://github.com/spotify/annoy/releases/tag/v${version}";
44 license = licenses.asl20;
45 maintainers = with maintainers; [ timokau ];
46 };
47}