2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
unasync,
|
|
|
|
poetry-core,
|
|
|
|
python,
|
|
|
|
click,
|
|
|
|
hiredis,
|
|
|
|
more-itertools,
|
|
|
|
pydantic,
|
|
|
|
python-ulid,
|
|
|
|
redis,
|
|
|
|
types-redis,
|
|
|
|
typing-extensions,
|
|
|
|
pkgs,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
2023-11-16 04:20:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "redis-om";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.3.1";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "redis";
|
|
|
|
repo = "redis-om-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-jwFtRnj/jhH+AKjExdOCgUfgEWweFCXVuz6F3qQRcs0=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2024-01-25 14:12:00 +00:00
|
|
|
pythonRelaxDepsHook
|
2023-11-16 04:20:00 +00:00
|
|
|
unasync
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
# it has not been maintained at all for a half year and some dependencies are outdated
|
|
|
|
# https://github.com/redis/redis-om-python/pull/554
|
|
|
|
# https://github.com/redis/redis-om-python/pull/577
|
|
|
|
pythonRelaxDeps = true;
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2023-11-16 04:20:00 +00:00
|
|
|
click
|
|
|
|
hiredis
|
|
|
|
more-itertools
|
|
|
|
pydantic
|
|
|
|
python-ulid
|
|
|
|
redis
|
|
|
|
types-redis
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
${python.pythonOnBuildForHost.interpreter} make_sync.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
${pkgs.redis}/bin/redis-server &
|
|
|
|
REDIS_PID=$!
|
|
|
|
'';
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
kill $REDIS_PID
|
|
|
|
'';
|
|
|
|
|
|
|
|
# probably require redisearch
|
|
|
|
# https://github.com/redis/redis-om-python/issues/532
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"aredis_om"
|
|
|
|
"redis_om"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Object mapping, and more, for Redis and Python";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "migrate";
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://github.com/redis/redis-om-python";
|
|
|
|
changelog = "https://github.com/redis/redis-om-python/releases/tag/${src.rev}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|