python312Packages.txtai: 7.4.0 -> 8.0.0; fix (#352153)

This commit is contained in:
Peder Bergebakken Sundt 2024-11-29 11:30:42 +01:00 committed by GitHub
commit 5b7acac7d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 134 additions and 69 deletions

View File

@ -7,7 +7,6 @@
pgvector, pgvector,
poetry-core, poetry-core,
psycopg2, psycopg2,
pythonOlder,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -15,8 +14,6 @@ buildPythonPackage rec {
version = "0.2.6"; version = "0.2.6";
pyproject = true; pyproject = true;
disabled = pythonOlder "3.8";
src = fetchPypi { src = fetchPypi {
pname = "llama_index_vector_stores_postgres"; pname = "llama_index_vector_stores_postgres";
inherit version; inherit version;
@ -25,6 +22,10 @@ buildPythonPackage rec {
pythonRemoveDeps = [ "psycopg2-binary" ]; pythonRemoveDeps = [ "psycopg2-binary" ];
pythonRelaxDeps = [
"pgvector"
];
build-system = [ build-system = [
poetry-core poetry-core
]; ];
@ -38,10 +39,10 @@ buildPythonPackage rec {
pythonImportsCheck = [ "llama_index.vector_stores.postgres" ]; pythonImportsCheck = [ "llama_index.vector_stores.postgres" ];
meta = with lib; { meta = {
description = "LlamaIndex Vector Store Integration for Postgres"; description = "LlamaIndex Vector Store Integration for Postgres";
homepage = "https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres"; homepage = "https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres";
license = licenses.mit; license = lib.licenses.mit;
maintainers = with maintainers; [ fab ]; maintainers = with lib.maintainers; [ fab ];
}; };
} }

View File

@ -1,10 +1,17 @@
{ {
lib, lib,
asyncpg,
buildPythonPackage, buildPythonPackage,
django,
fetchFromGitHub, fetchFromGitHub,
# build-system
setuptools,
# dependencies
numpy, numpy,
# tests
asyncpg,
django,
peewee, peewee,
postgresql, postgresql,
postgresqlTestHook, postgresqlTestHook,
@ -12,37 +19,38 @@
psycopg2, psycopg2,
pytest-asyncio, pytest-asyncio,
pytestCheckHook, pytestCheckHook,
pythonOlder, scipy,
sqlalchemy, sqlalchemy,
sqlmodel, sqlmodel,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pgvector"; pname = "pgvector";
version = "0.2.4"; version = "0.3.6";
format = "setuptools"; pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "pgvector"; owner = "pgvector";
repo = "pgvector-python"; repo = "pgvector-python";
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
hash = "sha256-XKoaEwLW59pV4Dwis7p2L65XoO2zUEa1kXxz6Lgs2d8="; hash = "sha256-ho0UgamZxsN+pv7QkpsDnN7f+I+SrexA2gVtmJF8/3Q=";
}; };
propagatedBuildInputs = [ numpy ]; build-system = [ setuptools ];
dependencies = [ numpy ];
nativeCheckInputs = [ nativeCheckInputs = [
asyncpg asyncpg
django django
peewee peewee
(postgresql.withPackages (p: with p; [ pgvector ]))
postgresqlTestHook
psycopg psycopg
psycopg2 psycopg2
(postgresql.withPackages (p: with p; [ pgvector ]))
postgresqlTestHook
pytest-asyncio pytest-asyncio
pytestCheckHook pytestCheckHook
scipy
sqlalchemy sqlalchemy
sqlmodel sqlmodel
]; ];
@ -55,11 +63,13 @@ buildPythonPackage rec {
pythonImportsCheck = [ "pgvector" ]; pythonImportsCheck = [ "pgvector" ];
meta = with lib; { __darwinAllowLocalNetworking = true;
meta = {
description = "Pgvector support for Python"; description = "Pgvector support for Python";
homepage = "https://github.com/pgvector/pgvector-python"; homepage = "https://github.com/pgvector/pgvector-python";
changelog = "https://github.com/pgvector/pgvector-python/blob/${src.rev}/CHANGELOG.md"; changelog = "https://github.com/pgvector/pgvector-python/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit; license = lib.licenses.mit;
maintainers = with maintainers; [ natsukium ]; maintainers = with lib.maintainers; [ natsukium ];
}; };
} }

View File

@ -1,10 +1,12 @@
{ {
lib, lib,
buildPythonPackage, buildPythonPackage,
pythonOlder,
fetchFromGitHub, fetchFromGitHub,
# build-system
setuptools, setuptools,
# propagated build input
# dependencies
faiss, faiss,
torch, torch,
transformers, transformers,
@ -12,61 +14,80 @@
numpy, numpy,
pyyaml, pyyaml,
regex, regex,
# optional-dependencies # optional-dependencies
# ann
annoy,
hnswlib,
pgvector,
sqlalchemy,
sqlite-vec,
# api
aiohttp, aiohttp,
fastapi, fastapi,
uvicorn,
# TODO add apache-libcloud
# , apache-libcloud
rich,
duckdb,
pillow, pillow,
python-multipart,
uvicorn,
# cloud
# apache-libcloud, (unpackaged)
# console
rich,
# database
duckdb,
# graph
# grand-cypher (unpackaged)
# grand-graph (unpackaged)
networkx, networkx,
python-louvain, python-louvain,
# model
onnx, onnx,
onnxruntime, onnxruntime,
# pipeline-audio
# model2vec,
sounddevice,
soundfile, soundfile,
scipy, scipy,
ttstokenizer, ttstokenizer,
webrtcvad,
# pipeline-data
beautifulsoup4, beautifulsoup4,
nltk, nltk,
pandas, pandas,
tika, tika,
# pipeline-image
imagehash, imagehash,
timm, timm,
# pipeline-llm
litellm,
# llama-cpp-python, (unpackaged)
# pipeline-text
fasttext, fasttext,
sentencepiece, sentencepiece,
# pipeline-train
accelerate, accelerate,
bitsandbytes,
onnxmltools, onnxmltools,
annoy, peft,
hnswlib, skl2onnx,
# TODO add pymagnitude-lite # vectors
#, pymagnitude-lite # pymagnitude-lite, (unpackaged)
scikit-learn, scikit-learn,
sentence-transformers, sentence-transformers,
skops,
# workflow
# apache-libcloud (unpackaged)
croniter, croniter,
openpyxl, openpyxl,
requests, requests,
xmltodict, xmltodict,
pgvector,
sqlite-vec, # tests
python-multipart,
# native check inputs
pytestCheckHook,
# check inputs
httpx, httpx,
msgpack, msgpack,
sqlalchemy, pytestCheckHook,
}: }:
let let
version = "7.4.0"; version = "8.0.0";
api = [
aiohttp
fastapi
pillow
python-multipart
uvicorn
];
ann = [ ann = [
annoy annoy
hnswlib hnswlib
@ -74,30 +95,39 @@ let
sqlalchemy sqlalchemy
sqlite-vec sqlite-vec
]; ];
api = [
aiohttp
fastapi
pillow
python-multipart
uvicorn
];
# cloud = [ apache-libcloud ]; # cloud = [ apache-libcloud ];
console = [ rich ]; console = [ rich ];
database = [ database = [
duckdb duckdb
pillow pillow
sqlalchemy
]; ];
graph = [ graph = [
# grand-cypher
# grand-graph
networkx networkx
python-louvain python-louvain
sqlalchemy
]; ];
model = [ model = [
onnx onnx
onnxruntime onnxruntime
]; ];
pipeline-audio = [ pipeline-audio = [
onnx onnx
onnxruntime onnxruntime
soundfile
scipy scipy
sounddevice
soundfile
ttstokenizer ttstokenizer
webrtcvad
]; ];
pipeline-data = [ pipeline-data = [
beautifulsoup4 beautifulsoup4
@ -110,25 +140,40 @@ let
pillow pillow
timm timm
]; ];
pipeline-llm = [
litellm
# llama-cpp-python
];
pipeline-text = [ pipeline-text = [
fasttext fasttext
sentencepiece sentencepiece
]; ];
pipeline-train = [ pipeline-train = [
accelerate accelerate
bitsandbytes
onnx onnx
onnxmltools onnxmltools
onnxruntime onnxruntime
peft
skl2onnx
]; ];
pipeline = pipeline-audio ++ pipeline-data ++ pipeline-image ++ pipeline-text ++ pipeline-train; pipeline =
pipeline-audio
similarity = [ ++ pipeline-data
annoy ++ pipeline-image
++ pipeline-llm
++ pipeline-text
++ pipeline-train;
scoring = [ sqlalchemy ];
vectors = [
fasttext fasttext
hnswlib litellm
# llama-cpp-python
# model2vec
# pymagnitude-lite # pymagnitude-lite
scikit-learn scikit-learn
sentence-transformers sentence-transformers
skops
]; ];
workflow = [ workflow = [
# apache-libcloud # apache-libcloud
@ -139,7 +184,18 @@ let
requests requests
xmltodict xmltodict
]; ];
all = api ++ ann ++ console ++ database ++ graph ++ model ++ pipeline ++ similarity ++ workflow; similarity = ann ++ vectors;
all =
api
++ ann
++ console
++ database
++ graph
++ model
++ pipeline
++ scoring
++ similarity
++ workflow;
optional-dependencies = { optional-dependencies = {
inherit inherit
@ -151,9 +207,11 @@ let
model model
pipeline-audio pipeline-audio
pipeline-image pipeline-image
pipeline-llm
pipeline-text pipeline-text
pipeline-train pipeline-train
pipeline pipeline
scoring
similarity similarity
workflow workflow
all all
@ -165,17 +223,14 @@ buildPythonPackage {
inherit version; inherit version;
pyproject = true; pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "neuml"; owner = "neuml";
repo = "txtai"; repo = "txtai";
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
hash = "sha256-DQB12mFUMsKJ8cACowI1Vc7k2n1npdTOQknRmHd5EIM="; hash = "sha256-qhbtKZo0C4OcXdKBGBJhfBMmY0DzbEx6n7d4y4MenN0=";
}; };
buildTools = [ setuptools ]; build-system = [ setuptools ];
pythonRemoveDeps = [ pythonRemoveDeps = [
# We call it faiss, not faiss-cpu. # We call it faiss, not faiss-cpu.
@ -184,12 +239,13 @@ buildPythonPackage {
dependencies = [ dependencies = [
faiss faiss
torch
transformers
huggingface-hub huggingface-hub
msgpack
numpy numpy
pyyaml pyyaml
regex regex
torch
transformers
]; ];
optional-dependencies = optional-dependencies; optional-dependencies = optional-dependencies;
@ -203,21 +259,19 @@ buildPythonPackage {
pythonImportsCheck = [ "txtai" ]; pythonImportsCheck = [ "txtai" ];
nativeCheckInputs = [ nativeCheckInputs = [
pytestCheckHook
] ++ optional-dependencies.ann ++ optional-dependencies.api ++ optional-dependencies.similarity;
checkInputs = [
httpx httpx
msgpack msgpack
pytestCheckHook
python-multipart python-multipart
sqlalchemy sqlalchemy
]; ] ++ optional-dependencies.ann ++ optional-dependencies.api ++ optional-dependencies.similarity;
# The deselected paths depend on the huggingface hub and should be run as a passthru test # 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 # disabledTestPaths won't work as the problem is with the classes containing the tests
# (in other words, it fails on __init__) # (in other words, it fails on __init__)
pytestFlagsArray = [ pytestFlagsArray = [
"test/python/test*.py" "test/python/test*.py"
"--deselect=test/python/testagent.py"
"--deselect=test/python/testcloud.py" "--deselect=test/python/testcloud.py"
"--deselect=test/python/testconsole.py" "--deselect=test/python/testconsole.py"
"--deselect=test/python/testembeddings.py" "--deselect=test/python/testembeddings.py"