2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, asyncpg
|
|
|
|
, buildPythonPackage
|
|
|
|
, django
|
|
|
|
, fetchFromGitHub
|
|
|
|
, numpy
|
2023-10-09 19:29:22 +00:00
|
|
|
, peewee
|
2023-07-15 17:15:38 +00:00
|
|
|
, postgresql
|
|
|
|
, postgresqlTestHook
|
|
|
|
, psycopg
|
|
|
|
, psycopg2
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, sqlalchemy
|
2024-01-02 11:29:13 +00:00
|
|
|
, sqlmodel
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pgvector";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.2.4";
|
2023-07-15 17:15:38 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pgvector";
|
|
|
|
repo = "pgvector-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-XKoaEwLW59pV4Dwis7p2L65XoO2zUEa1kXxz6Lgs2d8=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
asyncpg
|
|
|
|
django
|
2023-10-09 19:29:22 +00:00
|
|
|
peewee
|
2023-07-15 17:15:38 +00:00
|
|
|
(postgresql.withPackages (p: with p; [ pgvector ]))
|
|
|
|
postgresqlTestHook
|
|
|
|
psycopg
|
|
|
|
psycopg2
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
sqlalchemy
|
2024-01-02 11:29:13 +00:00
|
|
|
sqlmodel
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
env = {
|
|
|
|
PGDATABASE = "pgvector_python_test";
|
|
|
|
postgresqlEnableTCP = 1;
|
|
|
|
postgresqlTestUserOptions = "LOGIN SUPERUSER";
|
|
|
|
};
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pgvector" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Pgvector support for Python";
|
|
|
|
homepage = "https://github.com/pgvector/pgvector-python";
|
|
|
|
changelog = "https://github.com/pgvector/pgvector-python/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|