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