1{ lib
2, aiohttp
3, buildPythonPackage
4, fetchFromGitHub
5, oauthlib
6, pytest-asyncio
7, pytest-mock
8, pytestCheckHook
9, pythonOlder
10, requests
11, requests-oauthlib
12, requests-mock
13, setuptools-scm
14, time-machine
15}:
16
17buildPythonPackage rec {
18 pname = "pyatmo";
19 version = "7.4.0";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "jabesq";
26 repo = "pyatmo";
27 rev = "refs/tags/v${version}";
28 sha256 = "sha256-0AgmH0cxXPUBzC30HyX68WsSyYsDcPaVQHLOIsZbHzI=";
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 pytest-asyncio
46 pytest-mock
47 pytestCheckHook
48 requests-mock
49 time-machine
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}