about summary refs log tree commit diff
path: root/pkgs/development/python-modules/chroma-hnswlib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/chroma-hnswlib/default.nix')
-rw-r--r--pkgs/development/python-modules/chroma-hnswlib/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/chroma-hnswlib/default.nix b/pkgs/development/python-modules/chroma-hnswlib/default.nix
new file mode 100644
index 000000000000..31f884e53ba8
--- /dev/null
+++ b/pkgs/development/python-modules/chroma-hnswlib/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, numpy
+, pybind11
+, setuptools
+, wheel
+, pythonOlder
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "chroma-hnswlib";
+  version = "0.7.3";
+  pyproject = true;
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "chroma-core";
+    repo = "hnswlib";
+    rev = "refs/tags/${version}";
+    hash = "sha256-c4FvymqZy8AZKbh6Y8xZRjKAqYcUyZABRGc1u7vwlsk=";
+  };
+
+  nativeBuildInputs = [
+    numpy
+    pybind11
+    setuptools
+    wheel
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "hnswlib"
+  ];
+
+  meta = with lib; {
+    description = "Header-only C++/python library for fast approximate nearest neighbors";
+    homepage = "https://github.com/chroma-core/hnswlib";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}