2020-03-18 17:03:58 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch
|
|
|
|
, acme, aiohttp, snitun, attrs, pycognito, warrant
|
2020-06-19 10:52:29 +01:00
|
|
|
, pytest-aiohttp, asynctest, atomicwrites, pytest, pythonOlder }:
|
2019-12-21 10:27:45 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hass-nabucasa";
|
2020-06-19 10:52:29 +01:00
|
|
|
version = "0.34.6";
|
2019-12-21 10:27:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nabucasa";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-06-19 10:52:29 +01:00
|
|
|
sha256 = "1lkqwj58qr0vn7zf5mhrhaz973ahj9wjp4mgzvyja1gcdh6amv34";
|
2019-12-21 10:27:45 +00:00
|
|
|
};
|
|
|
|
|
2019-12-29 18:37:08 +00:00
|
|
|
postPatch = ''
|
2020-06-19 10:52:29 +01:00
|
|
|
sed -i 's/"acme.*"/"acme"/' setup.py
|
2019-12-29 18:37:08 +00:00
|
|
|
'';
|
|
|
|
|
2020-06-19 10:52:29 +01:00
|
|
|
patches = [
|
|
|
|
# relax pytz dependency
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/NabuCasa/hass-nabucasa/commit/419e80feddc36c68384c032feda0057515b53eaa.patch";
|
|
|
|
sha256 = "14dgwci8615cwcf27hg7b42s7da50xhyjys3yx446q7ipk8zw4x6";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
acme aiohttp atomicwrites snitun attrs warrant pycognito
|
|
|
|
];
|
2019-12-21 10:27:45 +00:00
|
|
|
|
2020-03-18 17:03:58 +00:00
|
|
|
checkInputs = [ pytest pytest-aiohttp asynctest ];
|
2019-12-21 10:27:45 +00:00
|
|
|
|
2020-06-19 10:52:29 +01:00
|
|
|
# Asynctest's mocking is broken with python3.8
|
|
|
|
# https://github.com/Martiusweb/asynctest/issues/132
|
|
|
|
doCheck = pythonOlder "3.8";
|
|
|
|
|
2019-12-21 10:27:45 +00:00
|
|
|
checkPhase = ''
|
|
|
|
pytest tests/
|
2020-03-18 17:03:58 +00:00
|
|
|
'';
|
2019-12-21 10:27:45 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/NabuCasa/hass-nabucasa";
|
|
|
|
description = "Home Assistant cloud integration by Nabu Casa, inc.";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ Scriptkiddi ];
|
|
|
|
};
|
|
|
|
}
|