2020-01-01 12:24:24 +00:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, appdirs
|
|
|
|
, click
|
|
|
|
, construct
|
2020-10-30 20:30:32 +00:00
|
|
|
, croniter
|
2020-01-01 12:24:24 +00:00
|
|
|
, cryptography
|
2020-10-30 20:30:32 +00:00
|
|
|
, importlib-metadata
|
2020-01-01 12:24:24 +00:00
|
|
|
, pytest
|
2020-10-30 20:30:32 +00:00
|
|
|
, pytest-mock
|
2020-01-01 12:24:24 +00:00
|
|
|
, zeroconf
|
|
|
|
, attrs
|
|
|
|
, pytz
|
|
|
|
, tqdm
|
|
|
|
, netifaces
|
|
|
|
}:
|
|
|
|
|
2020-10-30 20:30:32 +00:00
|
|
|
|
2020-01-01 12:24:24 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-miio";
|
2020-07-31 09:56:45 +01:00
|
|
|
version = "0.5.3";
|
2020-01-01 12:24:24 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-07-31 09:56:45 +01:00
|
|
|
sha256 = "3be5275b569844dfa267c80a1e23dc0957411dd501cae0ed3cccf43467031ceb";
|
2020-01-01 12:24:24 +00:00
|
|
|
};
|
|
|
|
|
2020-10-30 20:30:32 +00:00
|
|
|
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 ];
|
2020-01-01 12:24:24 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
pytest
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Python library for interfacing with Xiaomi smart appliances";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/rytilahti/python-miio";
|
2020-01-01 12:24:24 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ flyfloh ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|