1{ lib
2, aioresponses
3, buildPythonPackage
4, orjson
5, fetchFromGitHub
6, pytest-asyncio
7, pytestCheckHook
8, pythonOlder
9, requests
10, requests-mock
11}:
12
13buildPythonPackage rec {
14 pname = "nexia";
15 version = "2.0.7";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.5";
19
20 src = fetchFromGitHub {
21 owner = "bdraco";
22 repo = pname;
23 rev = "refs/tags/${version}";
24 hash = "sha256-1uCmlFkha5oaNm5N0/8402ulBr7fNRUbDDASECfN9r8=";
25 };
26
27 propagatedBuildInputs = [
28 orjson
29 requests
30 ];
31
32 nativeCheckInputs = [
33 aioresponses
34 requests-mock
35 pytest-asyncio
36 pytestCheckHook
37 ];
38
39 postPatch = ''
40 substituteInPlace setup.py \
41 --replace '"pytest-runner",' ""
42 '';
43
44 pythonImportsCheck = [
45 "nexia"
46 ];
47
48 meta = with lib; {
49 description = "Python module for Nexia thermostats";
50 homepage = "https://github.com/bdraco/nexia";
51 license = with licenses; [ asl20 ];
52 maintainers = with maintainers; [ fab ];
53 };
54}