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