From 24d6aa1a9003225dfdbed496704f6d363e272a09 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 23 Apr 2023 15:02:47 +0200 Subject: [PATCH] python310Packages.qdrant-client: adjust inputs - enable tests - add pythonImportsCheck --- .../python-modules/qdrant-client/default.nix | 69 ++++++++++++++----- 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/qdrant-client/default.nix b/pkgs/development/python-modules/qdrant-client/default.nix index 98bde376e042..57e5ab8ee019 100644 --- a/pkgs/development/python-modules/qdrant-client/default.nix +++ b/pkgs/development/python-modules/qdrant-client/default.nix @@ -1,34 +1,71 @@ -{ lib, buildPythonPackage, fetchPypi, python3Packages, numpy, httpx, grpcio, typing-extensions, grpcio-tools, pydantic, urllib3, h2 }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, grpcio +, grpcio-tools +, h2 +, httpx +, numpy +, pytestCheckHook +, poetry-core +, pydantic +, pythonOlder +, typing-extensions +, urllib3 +}: buildPythonPackage rec { pname = "qdrant-client"; version = "1.1.0"; - - src = fetchPypi { - pname = "qdrant_client"; - inherit version; - hash = "sha256-tiWPQXjYkUM77rgKYbQG4jdi9c/I2WTMq5y+9zLax/0="; - }; - format = "pyproject"; - nativeBuildInputs = with python3Packages; [ + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "qdrant"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-rpNTV3VBTND39iW/kve0aG1KJzAIl1whmhH+e6RbOhw="; + }; + + nativeBuildInputs = [ poetry-core ]; + propagatedBuildInputs = [ + numpy + httpx + grpcio + typing-extensions + grpcio-tools + pydantic + urllib3 + h2 + ]; - # postPatch = '' - # substituteInPlace setup.cfg \ - # --replace "validators>=0.18.2,<0.20.0" "validators>=0.18.2,<0.21.0" - # ''; + nativeCheckInputs = [ + pytestCheckHook + ]; - propagatedBuildInputs = [ numpy httpx grpcio typing-extensions grpcio-tools pydantic urllib3 h2 ]; + pythonImportsCheck = [ + "qdrant_client" + ]; - doCheck = false; + disabledTests = [ + # Tests require network access + "test_conditional_payload_update" + "test_locks" + "test_multiple_vectors" + "test_points_crud" + "test_qdrant_client_integration" + "test_quantization_config" + "test_record_upload" + ]; meta = with lib; { - homepage = "https://github.com/qdrant/qdrant-client"; description = "Python client for Qdrant vector search engine"; + homepage = "https://github.com/qdrant/qdrant-client"; + changelog = "https://github.com/qdrant/qdrant-client/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ happysalada ]; };