From dde9d8b71e724b37ce16872709da1f9fe5956d1e Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Sat, 16 Nov 2024 16:55:16 +0800 Subject: [PATCH] python3Packages.weaviate-client: 4.8.0 -> 4.9.3 (cherry picked from commit 8b36f4d41d83e38a1a4aded497d7dfc228d2113b) --- .../weaviate-client/default.nix | 56 ++++++++++++++++--- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/weaviate-client/default.nix b/pkgs/development/python-modules/weaviate-client/default.nix index e059e5bcabb7..46e350bc7e25 100644 --- a/pkgs/development/python-modules/weaviate-client/default.nix +++ b/pkgs/development/python-modules/weaviate-client/default.nix @@ -12,11 +12,21 @@ requests, setuptools-scm, validators, + pytestCheckHook, + numpy, + pytest-httpserver, + pandas, + polars, + h5py, + litestar, + pytest-asyncio, + flask, + fastapi, }: buildPythonPackage rec { pname = "weaviate-client"; - version = "4.8.1"; + version = "4.9.3"; pyproject = true; disabled = pythonOlder "3.8"; @@ -25,37 +35,69 @@ buildPythonPackage rec { owner = "weaviate"; repo = "weaviate-python-client"; rev = "refs/tags/v${version}"; - hash = "sha256-HSLU9OQMEOCwgxtLj20yJ0Xo9c6SVfMhfVT/F5du17A="; + hash = "sha256-F5vU5JKAOztoJwTe+OL3QKHbuhbbXL5WMia2AYrkRS0="; }; pythonRelaxDeps = [ "httpx" "validators" + "authlib" ]; build-system = [ setuptools-scm ]; - dependencies = [ authlib grpcio + flask grpcio-health-checking grpcio-tools + h5py httpx pydantic + numpy + litestar + fastapi + polars requests + pandas validators ]; - doCheck = false; + nativeCheckInputs = [ + pytest-httpserver + pytest-asyncio + pytestCheckHook # pytestCheckHook won't work + ]; + + preCheck = '' + export HOME=$(mktemp -d) + sed -i '/raw.githubusercontent.com/,+1d' test/test_util.py + substituteInPlace pytest.ini \ + --replace-fail "--benchmark-skip" "" + rm -rf test/test_embedded.py # Need network + ''; + + disabledTests = [ + # Need network + "test_bearer_token" + "test_token_refresh_timeout" + "test_with_simple_auth_no_oidc_via_api_key" + "test_client_with_extra_options" + ]; + + pytestFlagsArray = [ + "test" + "mock_tests" + ]; pythonImportsCheck = [ "weaviate" ]; - meta = with lib; { + meta = { description = "Python native client for easy interaction with a Weaviate instance"; homepage = "https://github.com/weaviate/weaviate-python-client"; changelog = "https://github.com/weaviate/weaviate-python-client/releases/tag/v${version}"; - license = licenses.mit; - maintainers = with maintainers; [ happysalada ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ happysalada ]; }; }