Merge pull request #325164 from natsukium/lancedb/init

python312Packages.lancedb: init at 0.9.0
This commit is contained in:
OTABI Tomoya 2024-07-12 14:34:37 +09:00 committed by GitHub
commit 1950b59cb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12678 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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 ];
};
}

View File

@ -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(

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,95 @@
{
lib,
stdenv,
buildPythonPackage,
rustPlatform,
fetchFromGitHub,
darwin,
libiconv,
pkg-config,
protobuf,
numpy,
pyarrow,
ml-dtypes,
pandas,
pillow,
polars,
pytestCheckHook,
tqdm,
}:
buildPythonPackage rec {
pname = "pylance";
version = "0.13.0";
pyproject = true;
src = fetchFromGitHub {
owner = "lancedb";
repo = "lance";
rev = "refs/tags/v${version}";
hash = "sha256-gwSpdj3i68QBrIcuvjj/32CsRKYVh9dSf98qNLDpxpc=";
};
sourceRoot = "${src.name}/python";
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';
nativeBuildInputs = [
pkg-config
rustPlatform.cargoSetupHook
];
build-system = [ rustPlatform.maturinBuildHook ];
buildInputs =
[
libiconv
protobuf
]
++ lib.optionals stdenv.isDarwin (
with darwin.apple_sdk.frameworks;
[
Security
SystemConfiguration
]
);
pythonRelaxDeps = [ "pyarrow" ];
dependencies = [
numpy
pyarrow
];
pythonImportsCheck = [ "lance" ];
nativeCheckInputs = [
ml-dtypes
pandas
pillow
polars
pytestCheckHook
tqdm
];
preCheck = ''
cd python/tests
'';
disabledTests = [
# Error during planning: Invalid function 'invert'.
"test_polar_scan"
"test_simple_predicates"
];
meta = {
description = "Python wrapper for Lance columnar format";
homepage = "https://github.com/lancedb/lance";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ natsukium ];
};
}

View File

@ -6589,6 +6589,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 { };
@ -10156,6 +10158,8 @@ self: super: with self; {
pykrakenapi = callPackage ../development/python-modules/pykrakenapi { };
pylance = callPackage ../development/python-modules/pylance { };
pylddwrap = callPackage ../development/python-modules/pylddwrap { };
pyloadapi = callPackage ../development/python-modules/pyloadapi { };