1{ lib
2, aiohttp
3, buildPythonPackage
4, fetchFromGitHub
5, freezegun
6, oauthlib
7, pytest-asyncio
8, pytest-mock
9, pytestCheckHook
10, pythonOlder
11, requests
12, requests_oauthlib
13, requests-mock
14, setuptools-scm
15}:
16
17buildPythonPackage rec {
18 pname = "pyatmo";
19 version = "6.2.0";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "jabesq";
26 repo = "pyatmo";
27 rev = "v${version}";
28 sha256 = "sha256-VBc2avJiIFQW1LYXQEvIZ/wZKMFJsCF9DDrxwL8dDnk=";
29 };
30
31 SETUPTOOLS_SCM_PRETEND_VERSION = version;
32
33 nativeBuildInputs = [
34 setuptools-scm
35 ];
36
37 propagatedBuildInputs = [
38 aiohttp
39 oauthlib
40 requests
41 requests_oauthlib
42 ];
43
44 checkInputs = [
45 freezegun
46 pytest-asyncio
47 pytest-mock
48 pytestCheckHook
49 requests-mock
50 ];
51
52 postPatch = ''
53 substituteInPlace setup.cfg \
54 --replace "oauthlib~=3.1" "oauthlib" \
55 --replace "requests~=2.24" "requests"
56 '';
57
58 pythonImportsCheck = [
59 "pyatmo"
60 ];
61
62 meta = with lib; {
63 description = "Simple API to access Netatmo weather station data";
64 homepage = "https://github.com/jabesq/pyatmo";
65 license = licenses.mit;
66 maintainers = with maintainers; [ delroth ];
67 };
68}