summary refs log tree commit diff
path: root/pkgs/development/python-modules/nexia/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/nexia/default.nix')
-rw-r--r--pkgs/development/python-modules/nexia/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/nexia/default.nix b/pkgs/development/python-modules/nexia/default.nix
new file mode 100644
index 00000000000..b9553765fb4
--- /dev/null
+++ b/pkgs/development/python-modules/nexia/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pytestCheckHook
+, pythonOlder
+, requests
+, requests-mock
+}:
+
+buildPythonPackage rec {
+  pname = "nexia";
+  version = "0.9.10";
+  disabled = pythonOlder "3.5";
+
+  src = fetchFromGitHub {
+    owner = "bdraco";
+    repo = pname;
+    rev = version;
+    sha256 = "0k97i243ap1sap5smvfmpsjqzkx5adjvi14awv82pcp52ckzkbi9";
+  };
+
+  propagatedBuildInputs = [
+    requests
+  ];
+
+  checkInputs = [
+    requests-mock
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.py --replace '"pytest-runner",' ""
+  '';
+
+  pythonImportsCheck = [ "nexia" ];
+
+  meta = with lib; {
+    description = "Python module for Nexia thermostats";
+    homepage = "https://github.com/bdraco/nexia";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ fab ];
+  };
+}