2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2020-01-01 12:24:24 +00:00
|
|
|
, buildPythonPackage
|
2021-03-24 08:47:20 +00:00
|
|
|
, pythonOlder
|
2020-01-01 12:24:24 +00:00
|
|
|
, fetchPypi
|
2021-03-24 08:47:20 +00:00
|
|
|
, poetry
|
2020-01-01 12:24:24 +00:00
|
|
|
, click
|
|
|
|
, cryptography
|
2021-03-24 08:47:20 +00:00
|
|
|
, construct
|
2020-01-01 12:24:24 +00:00
|
|
|
, zeroconf
|
|
|
|
, attrs
|
|
|
|
, pytz
|
2021-03-24 08:47:20 +00:00
|
|
|
, appdirs
|
2020-01-01 12:24:24 +00:00
|
|
|
, tqdm
|
|
|
|
, netifaces
|
2021-03-24 08:47:20 +00:00
|
|
|
, android-backup
|
|
|
|
, importlib-metadata
|
|
|
|
, croniter
|
|
|
|
, defusedxml
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-mock
|
|
|
|
, pyyaml
|
2020-01-01 12:24:24 +00:00
|
|
|
}:
|
|
|
|
|
2020-10-30 20:30:32 +00:00
|
|
|
|
2020-01-01 12:24:24 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-miio";
|
2021-05-07 13:14:14 +00:00
|
|
|
version = "0.5.6";
|
2021-03-24 08:47:20 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
format = "pyproject";
|
2020-01-01 12:24:24 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-05-07 13:14:14 +00:00
|
|
|
sha256 = "sha256-tmGt50xBDV++/pqyXsuxHdrwv+XbkjvtrzsYBzQh7zE=";
|
2020-01-01 12:24:24 +00:00
|
|
|
};
|
|
|
|
|
2020-10-30 20:30:32 +00:00
|
|
|
postPatch = ''
|
2021-03-24 08:47:20 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'croniter = "^0"' 'croniter = "*"' \
|
2021-05-07 13:14:14 +00:00
|
|
|
--replace 'defusedxml = "^0.6"' 'defusedxml = "*"'
|
2020-01-01 12:24:24 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-24 08:47:20 +00:00
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2021-03-25 08:30:01 +00:00
|
|
|
pythonImportsCheck = [ "miio" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-01-01 12:24:24 +00:00
|
|
|
description = "Python library for interfacing with Xiaomi smart appliances";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/rytilahti/python-miio";
|
2021-03-25 08:30:01 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-01-01 12:24:24 +00:00
|
|
|
maintainers = with maintainers; [ flyfloh ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|