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