summary refs log tree commit diff
path: root/pkgs/development/python-modules/influxdb/default.nix
blob: 3b9672701833bcc0afddcaa16cf817a05069159e (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
{ lib
, buildPythonPackage
, python-dateutil
, fetchFromGitHub
, fetchpatch
, mock
, msgpack
, nose
, pandas
, pytestCheckHook
, pytz
, requests
, requests-mock
, six
}:

buildPythonPackage rec {
  pname = "influxdb";
  version = "5.3.0";

  src = fetchFromGitHub {
    owner = "influxdata";
    repo = "influxdb-python";
    rev = "v${version}";
    sha256 = "1jfkf53jcf8lcq98qc0bw5d1d0yp3558mh8l2dqc9jlsm0smigjs";
  };

  propagatedBuildInputs = [
    requests
    python-dateutil
    pytz
    six
    msgpack
  ];

  checkInputs = [
    pytestCheckHook
    requests-mock
    mock
    nose
    pandas
  ];

  patches = [
    (fetchpatch {
      # Relaxes msgpack pinning
      url = "https://github.com/influxdata/influxdb-python/commit/cc41e290f690c4eb67f75c98fa9f027bdb6eb16b.patch";
      sha256 = "1fb9qrq1kp24pixjwvzhdy67z3h0wnj92aj0jw0a25fd0rdxdvg4";
    })
  ];

  disabledTests = [
    # Tests cause FutureWarning due to use of 'record' instead of 'records' in pandas.
    #   https://github.com/influxdata/influxdb-python/pull/845
    # Also type mismatches in assertEqual on DataFrame:
    #   b'foo[30 chars]_one=1.0,column_two=1.0 0\nfoo,tag_one=red,tag[47 chars]00\n' !=
    #   b'foo[30 chars]_one="1",column_two=1i 0\nfoo,tag_one=red,tag_[46 chars]00\n'
    "test_write_points_from_dataframe_with_nan_json"
    "test_write_points_from_dataframe_with_tags_and_nan_json"
  ];

  pythonImportsCheck = [ "influxdb" ];

  meta = with lib; {
    description = "Python client for InfluxDB";
    homepage = "https://github.com/influxdb/influxdb-python";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}