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
|
2022-02-21 08:47:16 +00:00
|
|
|
, poetry-core
|
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";
|
2022-03-10 19:12:11 +00:00
|
|
|
version = "0.5.11";
|
2021-03-20 04:20:00 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-21 08:47:16 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-03-10 19:12:11 +00:00
|
|
|
sha256 = "sha256-1hC7yE/hGLx9g3NXqU45yC/6dcW6/0oZwgYW5bj/37c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
2022-02-21 08:47:16 +00:00
|
|
|
poetry-core
|
2021-03-20 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
2022-02-21 08:47:16 +00:00
|
|
|
] ++ lib.optional (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2021-03-20 04:20:00 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
];
|
|
|
|
|
2022-02-21 08:47:16 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'defusedxml = "^0"' 'defusedxml = "*"' \
|
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|