2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-03-20 04:20:00 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2021-03-20 04:20:00 +00:00
|
|
|
, poetry
|
2020-04-24 23:36:52 +00:00
|
|
|
, click
|
|
|
|
, cryptography
|
2021-03-20 04:20:00 +00:00
|
|
|
, construct
|
2020-04-24 23:36:52 +00:00
|
|
|
, zeroconf
|
|
|
|
, attrs
|
|
|
|
, pytz
|
2021-03-20 04:20:00 +00:00
|
|
|
, appdirs
|
2020-04-24 23:36:52 +00:00
|
|
|
, tqdm
|
|
|
|
, netifaces
|
2021-03-20 04:20:00 +00:00
|
|
|
, android-backup
|
|
|
|
, importlib-metadata
|
|
|
|
, croniter
|
|
|
|
, defusedxml
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-mock
|
|
|
|
, pyyaml
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-miio";
|
2021-08-18 13:19:15 +00:00
|
|
|
version = "0.5.7";
|
2021-03-20 04:20:00 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-08-18 13:19:15 +00:00
|
|
|
sha256 = "sha256-Dl/9aiCb8RYcSGEkO9X51Oaqg7FOv5mWYIDZs9fpOIg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
postPatch = ''
|
2021-03-20 04:20:00 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2021-06-28 23:13:55 +00:00
|
|
|
--replace 'click = "^7"' 'click = "*"' \
|
2021-03-20 04:20:00 +00:00
|
|
|
--replace 'croniter = "^0"' 'croniter = "*"' \
|
2021-05-20 23:08:51 +00:00
|
|
|
--replace 'defusedxml = "^0.6"' 'defusedxml = "*"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
android-backup
|
|
|
|
appdirs
|
|
|
|
attrs
|
2021-03-20 04:20:00 +00:00
|
|
|
click
|
|
|
|
construct
|
|
|
|
croniter
|
2021-06-28 23:13:55 +00:00
|
|
|
cryptography
|
2021-03-20 04:20:00 +00:00
|
|
|
defusedxml
|
2021-06-28 23:13:55 +00:00
|
|
|
netifaces
|
|
|
|
pytz
|
|
|
|
pyyaml
|
|
|
|
tqdm
|
|
|
|
zeroconf
|
2021-03-20 04:20:00 +00:00
|
|
|
] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "miio" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python library for interfacing with Xiaomi smart appliances";
|
|
|
|
homepage = "https://github.com/rytilahti/python-miio";
|
2021-03-20 04:20:00 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ flyfloh ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|