summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorRobert Schütz <dev@schuetz-co.de>2021-03-24 09:47:20 +0100
committerRobert Schütz <dev@schuetz-co.de>2021-03-24 10:10:32 +0100
commit0285851c4e7fe57ebe71181d93afee6c44fcd47c (patch)
tree8ff5a8eea650d90c74bdae4458f3c73a4d111094 /pkgs/development
parent50a392a4fedf398d2c43a0ab9f4144f1bd39c953 (diff)
downloadnixpkgs-0285851c4e7fe57ebe71181d93afee6c44fcd47c.tar
nixpkgs-0285851c4e7fe57ebe71181d93afee6c44fcd47c.tar.gz
nixpkgs-0285851c4e7fe57ebe71181d93afee6c44fcd47c.tar.bz2
nixpkgs-0285851c4e7fe57ebe71181d93afee6c44fcd47c.tar.lz
nixpkgs-0285851c4e7fe57ebe71181d93afee6c44fcd47c.tar.xz
nixpkgs-0285851c4e7fe57ebe71181d93afee6c44fcd47c.tar.zst
nixpkgs-0285851c4e7fe57ebe71181d93afee6c44fcd47c.zip
python3Packages.python-miio: 0.5.4 -> 0.5.5.1
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/python-miio/default.nix66
1 files changed, 45 insertions, 21 deletions
diff --git a/pkgs/development/python-modules/python-miio/default.nix b/pkgs/development/python-modules/python-miio/default.nix
index 78c89408ac2..54ee1954579 100644
--- a/pkgs/development/python-modules/python-miio/default.nix
+++ b/pkgs/development/python-modules/python-miio/default.nix
@@ -1,47 +1,71 @@
 { lib
 , buildPythonPackage
+, pythonOlder
 , fetchPypi
-, appdirs
+, poetry
 , click
-, construct
-, croniter
 , cryptography
-, importlib-metadata
-, pytest
-, pytest-mock
+, construct
 , zeroconf
 , attrs
 , pytz
+, appdirs
 , tqdm
 , netifaces
+, android-backup
+, importlib-metadata
+, croniter
+, defusedxml
+, pytestCheckHook
+, pytest-mock
+, pyyaml
 }:
 
 
 buildPythonPackage rec {
   pname = "python-miio";
-  version = "0.5.4";
+  version = "0.5.5.1";
+
+  disabled = pythonOlder "3.6";
+
+  format = "pyproject";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "5a6fd3bb2cc2f75cdfe5673f36a5a418144d08add6e53b384cb146e99f27bd39";
+    sha256 = "sha256-3IBObrytkn6rLUT+wMlwzreqQ4AfCgxiMTJm2Iwm+5E=";
   };
 
   postPatch = ''
-    substituteInPlace setup.py \
-      --replace  "zeroconf>=0.25.1,<0.26.0" "zeroconf"
-    substituteInPlace setup.py \
-      --replace  "pytz>=2019.3,<2020.0" "pytz"
-    substituteInPlace setup.py \
-      --replace  "cryptography>=2.9,<3.0" "cryptography"
-    '';
-
-  checkInputs = [ pytest pytest-mock];
-  propagatedBuildInputs = [ appdirs click construct croniter cryptography importlib-metadata zeroconf attrs pytz tqdm netifaces ];
-
-  checkPhase = ''
-    pytest
+    substituteInPlace pyproject.toml \
+      --replace 'croniter = "^0"' 'croniter = "*"' \
+      --replace 'defusedxml = "^0.6"' 'defusedxml = "*"'
   '';
 
+  nativeBuildInputs = [
+    poetry
+  ];
+
+  propagatedBuildInputs = [
+    click
+    cryptography
+    construct
+    zeroconf
+    attrs
+    pytz
+    appdirs
+    tqdm
+    netifaces
+    android-backup
+    croniter
+    defusedxml
+  ] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
+
+  checkInputs = [
+    pytestCheckHook
+    pytest-mock
+    pyyaml
+  ];
+
   meta = with lib; {
     description = "Python library for interfacing with Xiaomi smart appliances";
     homepage = "https://github.com/rytilahti/python-miio";