Loading pkgs/development/python-modules/txtai/default.nix +68 −23 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ buildPythonPackage, pythonOlder, fetchFromGitHub, setuptools, # propagated build input faiss, torch, Loading Loading @@ -47,18 +48,32 @@ openpyxl, requests, xmltodict, pgvector, sqlite-vec, python-multipart, # native check inputs unittestCheckHook, pythonAtLeast, pytestCheckHook, # check inputs httpx, msgpack, sqlalchemy, }: let version = "7.3.0"; version = "7.4.0"; api = [ aiohttp fastapi pillow python-multipart uvicorn ]; ann = [ annoy hnswlib pgvector sqlalchemy sqlite-vec ]; # cloud = [ apache-libcloud ]; console = [ rich ]; Loading Loading @@ -124,10 +139,11 @@ let requests xmltodict ]; all = api ++ console ++ database ++ graph ++ model ++ pipeline ++ similarity ++ workflow; all = api ++ ann ++ console ++ database ++ graph ++ model ++ pipeline ++ similarity ++ workflow; optional-dependencies = { inherit ann api console database Loading @@ -147,7 +163,8 @@ in buildPythonPackage { pname = "txtai"; inherit version; format = "setuptools"; pyproject = true; disabled = pythonOlder "3.8"; Loading @@ -155,16 +172,17 @@ buildPythonPackage { owner = "neuml"; repo = "txtai"; rev = "refs/tags/v${version}"; hash = "sha256-tnM6ye0Sxh8P2bm3awE72GvXEY0gXX1Sv+wPr77wRGU="; hash = "sha256-DQB12mFUMsKJ8cACowI1Vc7k2n1npdTOQknRmHd5EIM="; }; buildTools = [ setuptools ]; pythonRemoveDeps = [ # We call it faiss, not faiss-cpu. "faiss-cpu" ]; propagatedBuildInputs = [ dependencies = [ faiss torch transformers Loading @@ -176,23 +194,52 @@ buildPythonPackage { optional-dependencies = optional-dependencies; pythonImportsCheck = [ "txtai" ]; # some tests hang forever doCheck = false; preCheck = '' export TRANSFORMERS_CACHE=$(mktemp -d) # The Python imports check runs huggingface-hub which needs a writable directory. # `pythonImportsCheck` runs in the installPhase (before checkPhase). preInstall = '' export HF_HOME=$(mktemp -d) ''; pythonImportsCheck = [ "txtai" ]; nativeCheckInputs = [ unittestCheckHook ] ++ optional-dependencies.api ++ optional-dependencies.similarity; pytestCheckHook ] ++ optional-dependencies.ann ++ optional-dependencies.api ++ optional-dependencies.similarity; checkInputs = [ httpx msgpack python-multipart sqlalchemy ]; # The deselected paths depend on the huggingface hub and should be run as a passthru test # disabledTestPaths won't work as the problem is with the classes containing the tests # (in other words, it fails on __init__) pytestFlagsArray = [ "test/python/test*.py" "--deselect=test/python/testcloud.py" "--deselect=test/python/testconsole.py" "--deselect=test/python/testembeddings.py" "--deselect=test/python/testgraph.py" "--deselect=test/python/testapi/testembeddings.py" "--deselect=test/python/testapi/testpipelines.py" "--deselect=test/python/testapi/testworkflow.py" "--deselect=test/python/testdatabase/testclient.py" "--deselect=test/python/testdatabase/testduckdb.py" "--deselect=test/python/testdatabase/testencoder.py" "--deselect=test/python/testworkflow.py" ]; unittestFlagsArray = [ "-s" "test/python" "-v" disabledTests = [ # Hardcoded paths "testInvalidTar" "testInvalidZip" # Downloads from Huggingface "testPipeline" # Not finding sqlite-vec despite being supplied "testSQLite" "testSQLiteCustom" ]; meta = { Loading @@ -201,7 +248,5 @@ buildPythonPackage { homepage = "https://github.com/neuml/txtai"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ happysalada ]; # This should be addressed in a newer version, but we first need to wait for python311Packages.faiss to be updated broken = pythonAtLeast "3.12"; }; } Loading
pkgs/development/python-modules/txtai/default.nix +68 −23 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ buildPythonPackage, pythonOlder, fetchFromGitHub, setuptools, # propagated build input faiss, torch, Loading Loading @@ -47,18 +48,32 @@ openpyxl, requests, xmltodict, pgvector, sqlite-vec, python-multipart, # native check inputs unittestCheckHook, pythonAtLeast, pytestCheckHook, # check inputs httpx, msgpack, sqlalchemy, }: let version = "7.3.0"; version = "7.4.0"; api = [ aiohttp fastapi pillow python-multipart uvicorn ]; ann = [ annoy hnswlib pgvector sqlalchemy sqlite-vec ]; # cloud = [ apache-libcloud ]; console = [ rich ]; Loading Loading @@ -124,10 +139,11 @@ let requests xmltodict ]; all = api ++ console ++ database ++ graph ++ model ++ pipeline ++ similarity ++ workflow; all = api ++ ann ++ console ++ database ++ graph ++ model ++ pipeline ++ similarity ++ workflow; optional-dependencies = { inherit ann api console database Loading @@ -147,7 +163,8 @@ in buildPythonPackage { pname = "txtai"; inherit version; format = "setuptools"; pyproject = true; disabled = pythonOlder "3.8"; Loading @@ -155,16 +172,17 @@ buildPythonPackage { owner = "neuml"; repo = "txtai"; rev = "refs/tags/v${version}"; hash = "sha256-tnM6ye0Sxh8P2bm3awE72GvXEY0gXX1Sv+wPr77wRGU="; hash = "sha256-DQB12mFUMsKJ8cACowI1Vc7k2n1npdTOQknRmHd5EIM="; }; buildTools = [ setuptools ]; pythonRemoveDeps = [ # We call it faiss, not faiss-cpu. "faiss-cpu" ]; propagatedBuildInputs = [ dependencies = [ faiss torch transformers Loading @@ -176,23 +194,52 @@ buildPythonPackage { optional-dependencies = optional-dependencies; pythonImportsCheck = [ "txtai" ]; # some tests hang forever doCheck = false; preCheck = '' export TRANSFORMERS_CACHE=$(mktemp -d) # The Python imports check runs huggingface-hub which needs a writable directory. # `pythonImportsCheck` runs in the installPhase (before checkPhase). preInstall = '' export HF_HOME=$(mktemp -d) ''; pythonImportsCheck = [ "txtai" ]; nativeCheckInputs = [ unittestCheckHook ] ++ optional-dependencies.api ++ optional-dependencies.similarity; pytestCheckHook ] ++ optional-dependencies.ann ++ optional-dependencies.api ++ optional-dependencies.similarity; checkInputs = [ httpx msgpack python-multipart sqlalchemy ]; # The deselected paths depend on the huggingface hub and should be run as a passthru test # disabledTestPaths won't work as the problem is with the classes containing the tests # (in other words, it fails on __init__) pytestFlagsArray = [ "test/python/test*.py" "--deselect=test/python/testcloud.py" "--deselect=test/python/testconsole.py" "--deselect=test/python/testembeddings.py" "--deselect=test/python/testgraph.py" "--deselect=test/python/testapi/testembeddings.py" "--deselect=test/python/testapi/testpipelines.py" "--deselect=test/python/testapi/testworkflow.py" "--deselect=test/python/testdatabase/testclient.py" "--deselect=test/python/testdatabase/testduckdb.py" "--deselect=test/python/testdatabase/testencoder.py" "--deselect=test/python/testworkflow.py" ]; unittestFlagsArray = [ "-s" "test/python" "-v" disabledTests = [ # Hardcoded paths "testInvalidTar" "testInvalidZip" # Downloads from Huggingface "testPipeline" # Not finding sqlite-vec despite being supplied "testSQLite" "testSQLiteCustom" ]; meta = { Loading @@ -201,7 +248,5 @@ buildPythonPackage { homepage = "https://github.com/neuml/txtai"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ happysalada ]; # This should be addressed in a newer version, but we first need to wait for python311Packages.faiss to be updated broken = pythonAtLeast "3.12"; }; }