summary refs log tree commit diff
path: root/pkgs/development/python-modules/cassandra-driver/default.nix
blob: a40238412c6d3efacc4d3947cd9e2600d47812cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{ stdenv
, libev
, buildPythonPackage
, fetchPypi
, pkgs
, cython
, futures
, six
, python
, scales
, eventlet
, twisted
, mock
, gevent
, nose
, pytz
, pyyaml
, sure
, pythonOlder
}:

buildPythonPackage rec {
  pname = "cassandra-driver";
  version = "3.17.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1z49z6f9rj9kp1v03s1hs1rg8cj49rh0yk0fc2qi57w7slgy2hkd";
  };

  buildInputs = [
    libev
  ];

  nativeBuildInputs = [
    # NOTE: next version will work with cython 0.29
    # Requires 'Cython!=0.25,<0.29,>=0.20'
    (cython.overridePythonAttrs(old: rec {
      pname = "Cython";
      version = "0.28.3";
      src = fetchPypi {
        inherit pname version;
        sha256 = "1aae6d6e9858888144cea147eb5e677830f45faaff3d305d77378c3cba55f526";
      };
    }))
  ];

  propagatedBuildInputs = [ six ]
    ++ stdenv.lib.optionals (pythonOlder "3.4") [ futures ];

  postPatch = ''
    sed -i "s/<=1.0.1//" setup.py
  '';

  checkPhase = ''
    ${python.interpreter} setup.py gevent_nosetests
    ${python.interpreter} setup.py eventlet_nosetests
  '';

  checkInputs = [ scales eventlet twisted mock gevent nose pytz pyyaml sure ];

  # Could not get tests running
  doCheck = false;

  meta = with stdenv.lib; {
    homepage = http://datastax.github.io/python-driver/;
    description = "A Python client driver for Apache Cassandra";
    license = licenses.asl20;
  };

}