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