2019-05-04 22:43:49 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2020-10-09 16:32:34 +01:00
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
2020-06-20 05:48:11 +01:00
|
|
|
, oauthlib
|
2019-11-04 04:26:06 +00:00
|
|
|
, requests
|
2020-06-20 05:48:11 +01:00
|
|
|
, requests_oauthlib
|
2020-10-09 16:32:34 +01:00
|
|
|
, freezegun
|
|
|
|
, pytestCheckHook
|
|
|
|
, requests-mock
|
2019-05-04 22:43:49 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyatmo";
|
2021-01-24 01:50:04 +00:00
|
|
|
version = "4.2.2";
|
2020-11-04 11:48:49 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2019-05-04 22:43:49 +01:00
|
|
|
|
2020-10-09 16:32:34 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jabesq";
|
2021-01-24 01:50:04 +00:00
|
|
|
repo = "pyatmo";
|
2020-10-09 16:32:34 +01:00
|
|
|
rev = "v${version}";
|
2021-01-24 01:50:04 +00:00
|
|
|
sha256 = "sha256-3IxDDLa8KMHVkHAeTmdNVRPc5aKzF3VwL2kKnG8Fp7I=";
|
2019-05-04 22:43:49 +01:00
|
|
|
};
|
|
|
|
|
2020-11-04 11:48:49 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
2021-01-24 01:50:04 +00:00
|
|
|
--replace "oauthlib~=3.1" "oauthlib" \
|
|
|
|
--replace "requests~=2.24" "requests"
|
2020-11-04 11:48:49 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
oauthlib
|
|
|
|
requests
|
|
|
|
requests_oauthlib
|
|
|
|
];
|
2019-11-04 04:26:06 +00:00
|
|
|
|
2020-10-09 16:32:34 +01:00
|
|
|
checkInputs = [
|
|
|
|
freezegun
|
|
|
|
pytestCheckHook
|
|
|
|
requests-mock
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pyatmo" ];
|
2019-05-04 22:43:49 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple API to access Netatmo weather station data";
|
|
|
|
license = licenses.mit;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/jabesq/netatmo-api-python";
|
2019-05-04 22:43:49 +01:00
|
|
|
maintainers = with maintainers; [ delroth ];
|
|
|
|
};
|
|
|
|
}
|