2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
2024-07-27 06:49:29 +00:00
|
|
|
fetchFromGitHub,
|
2024-06-05 15:53:02 +00:00
|
|
|
h5py,
|
|
|
|
numpy,
|
2024-07-27 06:49:29 +00:00
|
|
|
pytestCheckHook,
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "annoy";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.17.3";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spotify";
|
|
|
|
repo = "annoy";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-oJHW4lULRun2in35pBGOKg44s5kgLH2BKiMOzVu4rf4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace-fail "'nose>=1.0'" ""
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ h5py ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
numpy
|
2024-07-27 06:49:29 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
rm -rf annoy
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# network access
|
|
|
|
"test/accuracy_test.py"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "annoy" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk";
|
|
|
|
homepage = "https://github.com/spotify/annoy";
|
2023-04-29 16:46:19 +00:00
|
|
|
changelog = "https://github.com/spotify/annoy/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ timokau ];
|
|
|
|
};
|
|
|
|
}
|