From b4e58d9832c2dc54f76b6c2538cf2ea71bc8f91a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 27 Feb 2021 11:17:20 +0100 Subject: [PATCH] python3Packages.influxdb: enable tests --- .../python-modules/influxdb/default.nix | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/influxdb/default.nix b/pkgs/development/python-modules/influxdb/default.nix index 69fe83b8779b..5a2da0756462 100644 --- a/pkgs/development/python-modules/influxdb/default.nix +++ b/pkgs/development/python-modules/influxdb/default.nix @@ -1,23 +1,46 @@ { lib , buildPythonPackage -, fetchPypi -, requests , dateutil -, pytz -, six -, msgpack +, fetchFromGitHub , fetchpatch +, mock +, msgpack +, nose +, pandas +, pytestCheckHook +, pytz +, requests +, requests-mock +, six }: buildPythonPackage rec { pname = "influxdb"; version = "5.3.0"; - src = fetchPypi { - inherit pname version; - sha256 = "9bcaafd57ac152b9824ab12ed19f204206ef5df8af68404770554c5b55b475f6"; + src = fetchFromGitHub { + owner = "influxdata"; + repo = "influxdb-python"; + rev = "v${version}"; + sha256 = "1jfkf53jcf8lcq98qc0bw5d1d0yp3558mh8l2dqc9jlsm0smigjs"; }; + propagatedBuildInputs = [ + requests + dateutil + pytz + six + msgpack + ]; + + checkInputs = [ + pytestCheckHook + requests-mock + mock + nose + pandas + ]; + patches = [ (fetchpatch { url = "https://github.com/influxdata/influxdb-python/commit/cc41e290f690c4eb67f75c98fa9f027bdb6eb16b.patch"; @@ -25,14 +48,17 @@ buildPythonPackage rec { }) ]; - # ImportError: No module named tests - doCheck = false; - propagatedBuildInputs = [ requests dateutil pytz six msgpack ]; + disabledTests = [ + # Disable failing test + "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 ]; }; - }