depot/third_party/nixpkgs/pkgs/development/python-modules/annoy/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

58 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
h5py,
numpy,
pytestCheckHook,
pythonOlder,
setuptools,
}:
buildPythonPackage rec {
pname = "annoy";
version = "1.17.3";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "spotify";
repo = "annoy";
rev = "refs/tags/v${version}";
hash = "sha256-oJHW4lULRun2in35pBGOKg44s5kgLH2BKiMOzVu4rf4=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail "'nose>=1.0'" ""
'';
build-system = [ setuptools ];
nativeBuildInputs = [ h5py ];
nativeCheckInputs = [
numpy
pytestCheckHook
];
preCheck = ''
rm -rf annoy
'';
disabledTestPaths = [
# network access
"test/accuracy_test.py"
];
pythonImportsCheck = [ "annoy" ];
meta = with lib; {
description = "Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk";
homepage = "https://github.com/spotify/annoy";
changelog = "https://github.com/spotify/annoy/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ timokau ];
};
}