1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 mock,
6 msgpack,
7 pandas,
8 pynose,
9 pytestCheckHook,
10 python-dateutil,
11 pytz,
12 requests,
13 requests-mock,
14 setuptools,
15 six,
16}:
17
18buildPythonPackage rec {
19 pname = "influxdb";
20 version = "5.3.2";
21 pyproject = true;
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-WMZH9gQ3Et2G6a7hLrTM+7tUFUZ7yZEKSKqMdMEQiXA=";
26 };
27
28 postPatch = ''
29 for f in influxdb/tests/dataframe_client_test.py influxdb/tests/influxdb08/dataframe_client_test.py; do
30 substituteInPlace "$f" \
31 --replace-fail "pandas.util.testing" "pandas.testing"
32 done
33
34 for f in influxdb/tests/influxdb08/client_test.py influxdb/tests/client_test.py; do
35 substituteInPlace "$f" \
36 --replace-fail "assertRaisesRegexp" "assertRaisesRegex"
37 done
38 '';
39
40 build-system = [ setuptools ];
41
42 dependencies = [
43 msgpack
44 python-dateutil
45 pytz
46 requests
47 six
48 ];
49
50 __darwinAllowLocalNetworking = true;
51
52 nativeCheckInputs = [
53 mock
54 pandas
55 pynose
56 pytestCheckHook
57 requests-mock
58 ];
59
60 disabledTests = [
61 "socket"
62 # Tests cause FutureWarning due to use of 'record' instead of 'records' in pandas.
63 # https://github.com/influxdata/influxdb-python/pull/845
64 # Also type mismatches in assertEqual on DataFrame:
65 # b'foo[30 chars]_one=1.0,column_two=1.0 0\nfoo,tag_one=red,tag[47 chars]00\n' !=
66 # b'foo[30 chars]_one="1",column_two=1i 0\nfoo,tag_one=red,tag_[46 chars]00\n'
67 "test_write_points_from_dataframe_with_nan_json"
68 "test_write_points_from_dataframe_with_tags_and_nan_json"
69 "test_write_points_from_dataframe_with_numeric_precision"
70 # Reponse is not empty but `s = '孝'` and the JSON decoder chokes on that
71 "test_query_with_empty_result"
72 # Pandas API changes cause it to no longer infer datetimes in the expected manner
73 "test_multiquery_into_dataframe"
74 "test_multiquery_into_dataframe_dropna"
75 # FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead.
76 "test_write_points_from_dataframe_with_tag_escaped"
77 # AssertionError: 2 != 1 : <class 'influxdb.tests.helper_test.TestSeriesHelper.testWarnBulkSizeNoEffect.<locals>.WarnBulkSizeNoEffect'> call should have generated one warning.
78 "testWarnBulkSizeNoEffect"
79 ];
80
81 pythonImportsCheck = [ "influxdb" ];
82
83 meta = with lib; {
84 description = "Python client for InfluxDB";
85 homepage = "https://github.com/influxdb/influxdb-python";
86 changelog = "https://github.com/influxdata/influxdb-python/blob/v${version}/CHANGELOG.md";
87 license = licenses.mit;
88 maintainers = with maintainers; [ fab ];
89 };
90}