2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytest-mock
|
2021-03-19 17:17:44 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2021-02-05 17:12:51 +00:00
|
|
|
, requests
|
|
|
|
, websocket_client
|
2021-03-19 17:17:44 +00:00
|
|
|
, zeroconf
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "devolo-home-control-api";
|
2021-04-05 15:23:46 +00:00
|
|
|
version = "0.17.1";
|
2021-03-19 17:17:44 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "2Fake";
|
|
|
|
repo = "devolo_home_control_api";
|
|
|
|
rev = "v${version}";
|
2021-04-05 15:23:46 +00:00
|
|
|
sha256 = "sha256-5PaIZPwikDmT4kmh0Qfg65gBAUYralmO6a22GtzoB7A=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
requests
|
|
|
|
zeroconf
|
|
|
|
websocket_client
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
postPatch = ''
|
|
|
|
# setup.py is not able to detect the version with setuptools_scm
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "setuptools_scm" "" \
|
|
|
|
--replace 'use_scm_version=True' 'use_scm_version="${version}"'
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# Disable test that requires network access
|
2021-03-19 17:17:44 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test__on_pong"
|
|
|
|
"TestMprm"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
pythonImportsCheck = [ "devolo_home_control_api" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library to work with devolo Home Control";
|
|
|
|
homepage = "https://github.com/2Fake/devolo_home_control_api";
|
|
|
|
license = with licenses; [ gpl3Only ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|