python312Packages.lancedb: init at 0.9.0

This commit is contained in:
natsukium
2024-07-07 12:06:41 +09:00
parent a2bdb6a23b
commit 1fdd41e8b2
4 changed files with 7050 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,119 @@
{
lib,
stdenv,
buildPythonPackage,
rustPlatform,
fetchFromGitHub,
darwin,
libiconv,
pkg-config,
protobuf,
attrs,
cachetools,
deprecation,
overrides,
packaging,
pydantic,
pylance,
requests,
retry,
tqdm,
aiohttp,
pandas,
polars,
pytest-asyncio,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "lancedb";
version = "0.9.0";
pyproject = true;
src = fetchFromGitHub {
owner = "lancedb";
repo = "lancedb";
rev = "refs/tags/python-v${version}";
hash = "sha256-RWmvqGm/Bekajb/fs/PQJ2fL0Vo1Mmy+x40PKaDmIEU=";
};
# ratelimiter only support up to python310 and it has been removed from nixpkgs
patches = [ ./remove-ratelimiter.patch ];
buildAndTestSubdir = "python";
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';
build-system = [ rustPlatform.maturinBuildHook ];
nativeBuildInputs = [
pkg-config
rustPlatform.cargoSetupHook
];
buildInputs =
[
libiconv
protobuf
]
++ lib.optionals stdenv.isDarwin (
with darwin.apple_sdk.frameworks;
[
IOKit
Security
SystemConfiguration
]
);
pythonRemoveDeps = [ "ratelimiter" ];
dependencies = [
attrs
cachetools
deprecation
overrides
packaging
pydantic
pylance
requests
retry
tqdm
];
pythonImportsCheck = [ "lancedb" ];
nativeCheckInputs = [
aiohttp
pandas
polars
pytest-asyncio
pytestCheckHook
];
preCheck = ''
cd python/python/tests
'';
pytestFlagsArray = [ "-m 'not slow'" ];
disabledTests = [
# require tantivy which is not packaged in nixpkgs
"test_basic"
];
disabledTestPaths = [
# touch the network
"test_s3.py"
];
meta = {
description = "Developer-friendly, serverless vector database for AI applications";
homepage = "https://github.com/lancedb/lancedb";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ natsukium ];
};
}
@@ -0,0 +1,26 @@
diff --git a/python/python/lancedb/embeddings/utils.py b/python/python/lancedb/embeddings/utils.py
index 813631c..4ae6025 100644
--- a/python/python/lancedb/embeddings/utils.py
+++ b/python/python/lancedb/embeddings/utils.py
@@ -111,7 +111,7 @@ class FunctionWrapper:
if len(self.rate_limiter_kwargs) > 0:
v = int(sys.version_info.minor)
- if v >= 11:
+ if True:
print(
"WARNING: rate limit only support up to 3.10, proceeding "
"without rate limiter"
diff --git a/python/python/tests/test_embeddings.py b/python/python/tests/test_embeddings.py
index ed7b105..28ca9cb 100644
--- a/python/python/tests/test_embeddings.py
+++ b/python/python/tests/test_embeddings.py
@@ -35,7 +35,7 @@ def mock_embed_func(input_data):
def test_with_embeddings():
for wrap_api in [True, False]:
- if wrap_api and sys.version_info.minor >= 11:
+ if wrap_api:
# ratelimiter package doesn't work on 3.11
continue
data = pa.Table.from_arrays(
+2
View File
@@ -6576,6 +6576,8 @@ self: super: with self; {
lakeside = callPackage ../development/python-modules/lakeside { };
lancedb = callPackage ../development/python-modules/lancedb { };
langchain = callPackage ../development/python-modules/langchain { };
langchain-chroma = callPackage ../development/python-modules/langchain-chroma { };