1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 unasync,
7 poetry-core,
8 python,
9 click,
10 hiredis,
11 more-itertools,
12 pydantic,
13 python-ulid,
14 redis,
15 redisTestHook,
16 types-redis,
17 typing-extensions,
18 pytest-asyncio,
19 pytestCheckHook,
20}:
21
22buildPythonPackage rec {
23 pname = "redis-om";
24 version = "0.3.5";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "redis";
29 repo = "redis-om-python";
30 tag = "v${version}";
31 hash = "sha256-TfwMYDZYDKCdI5i8izBVZaXN5GC/Skhkl905c/DHuXY=";
32 };
33
34 patches = [
35 # Include redis_om package, https://github.com/redis/redis-om-python/pull/718
36 (fetchpatch {
37 name = "include-redis_om.patch";
38 url = "https://github.com/redis/redis-om-python/commit/cc03485f148dcc2f455dd8cafd3b116758504c50.patch";
39 hash = "sha256-UzQfRbLCTnKW5jxQhldI9KCuN//bx3/PvNnfd872D+o=";
40 })
41 ];
42
43 build-system = [
44 unasync
45 poetry-core
46 ];
47
48 # it has not been maintained at all for a half year and some dependencies are outdated
49 # https://github.com/redis/redis-om-python/pull/554
50 # https://github.com/redis/redis-om-python/pull/577
51 pythonRelaxDeps = true;
52
53 dependencies = [
54 click
55 hiredis
56 more-itertools
57 pydantic
58 python-ulid
59 redis
60 types-redis
61 typing-extensions
62 ];
63
64 preBuild = ''
65 ${python.pythonOnBuildForHost.interpreter} make_sync.py
66 '';
67
68 nativeCheckInputs = [
69 pytestCheckHook
70 pytest-asyncio
71 redisTestHook
72 ];
73
74 # probably require redisearch
75 # https://github.com/redis/redis-om-python/issues/532
76 doCheck = false;
77
78 pythonImportsCheck = [
79 "aredis_om"
80 "redis_om"
81 ];
82
83 meta = with lib; {
84 description = "Object mapping, and more, for Redis and Python";
85 mainProgram = "migrate";
86 homepage = "https://github.com/redis/redis-om-python";
87 changelog = "https://github.com/redis/redis-om-python/releases/tag/${src.tag}";
88 license = licenses.mit;
89 maintainers = with maintainers; [ natsukium ];
90 };
91}