1{
2 lib,
3 buildPythonPackage,
4 faker,
5 fetchFromGitHub,
6 mock,
7 six,
8 pytestCheckHook,
9 python-memcached,
10 pythonOlder,
11 zstd,
12 stdenv,
13}:
14
15buildPythonPackage rec {
16 pname = "pymemcache";
17 version = "4.0.0";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "pinterest";
24 repo = pname;
25 rev = "v${version}";
26 hash = "sha256-WgtHhp7lE6StoOBfSy9+v3ODe/+zUC7lGrc2S4M68+M=";
27 };
28
29 propagatedBuildInputs = [ six ];
30
31 nativeCheckInputs = [
32 faker
33 mock
34 pytestCheckHook
35 python-memcached
36 zstd
37 ];
38
39 postPatch = ''
40 sed -i "/--cov/d" setup.cfg
41 '';
42
43 disabledTests = lib.optionals stdenv.is32bit [
44 # test_compressed_complex is broken on 32-bit platforms
45 # this can be removed on the next version bump
46 # see also https://github.com/pinterest/pymemcache/pull/480
47 "test_compressed_complex"
48 ];
49
50 pythonImportsCheck = [ "pymemcache" ];
51
52 meta = with lib; {
53 description = "Python memcached client";
54 homepage = "https://pymemcache.readthedocs.io/";
55 license = with licenses; [ asl20 ];
56 maintainers = with maintainers; [ fab ];
57 };
58}