1{
2 lib,
3 async-timeout,
4 beartype,
5 buildPythonPackage,
6 setuptools,
7 versioneer,
8 deprecated,
9 fetchFromGitHub,
10 packaging,
11 pympler,
12 pytest-asyncio,
13 pytest-lazy-fixtures,
14 pytestCheckHook,
15 redis,
16 typing-extensions,
17 wrapt,
18}:
19
20buildPythonPackage rec {
21 pname = "coredis";
22 version = "5.1.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "alisaifee";
27 repo = "coredis";
28 tag = version;
29 hash = "sha256-KaS048C8YLo7UNiryqjYk3yulf/gYGsFQ//Jnx10dQ4=";
30 };
31
32 postPatch = ''
33 sed -i '/mypy==/d' pyproject.toml
34 sed -i '/packaging/d' pyproject.toml
35 sed -i '/pympler/d' pyproject.toml
36 sed -i '/types_deprecated/d' pyproject.toml
37 substituteInPlace pytest.ini \
38 --replace-fail "-K" ""
39 '';
40
41 build-system = [
42 setuptools
43 versioneer
44 ];
45
46 dependencies = [
47 async-timeout
48 beartype
49 deprecated
50 packaging
51 pympler
52 typing-extensions
53 wrapt
54 ];
55
56 nativeCheckInputs = [
57 pytestCheckHook
58 redis
59 pytest-asyncio
60 pytest-lazy-fixtures
61 ];
62
63 pythonImportsCheck = [ "coredis" ];
64
65 enabledTestPaths = [
66 # All other tests require Docker
67 "tests/test_lru_cache.py"
68 "tests/test_parsers.py"
69 "tests/test_retry.py"
70 "tests/test_utils.py"
71 ];
72
73 meta = {
74 description = "Async redis client with support for redis server, cluster & sentinel";
75 homepage = "https://github.com/alisaifee/coredis";
76 changelog = "https://github.com/alisaifee/coredis/blob/${src.tag}/HISTORY.rst";
77 license = lib.licenses.mit;
78 teams = [ lib.teams.wdz ];
79 };
80}