1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 cython,
9 setuptools,
10
11 # dependencies
12 aiohappyeyeballs,
13 async-interrupt,
14 async-timeout,
15 chacha20poly1305-reuseable,
16 cryptography,
17 noiseprotocol,
18 protobuf,
19 zeroconf,
20
21 # tests
22 mock,
23 pytest-asyncio,
24 pytestCheckHook,
25}:
26
27buildPythonPackage rec {
28 pname = "aioesphomeapi";
29 version = "30.2.0";
30 pyproject = true;
31
32 disabled = pythonOlder "3.9";
33
34 src = fetchFromGitHub {
35 owner = "esphome";
36 repo = "aioesphomeapi";
37 tag = "v${version}";
38 hash = "sha256-2mH1+/58DSWYWl/mTBsCp6r77OUNWV5rR+4mnbKV9PE=";
39 };
40
41 build-system = [
42 setuptools
43 cython
44 ];
45
46 pythonRelaxDeps = [ "cryptography" ];
47
48 dependencies = [
49 aiohappyeyeballs
50 async-interrupt
51 chacha20poly1305-reuseable
52 cryptography
53 noiseprotocol
54 protobuf
55 zeroconf
56 ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
57
58 nativeCheckInputs = [
59 mock
60 pytest-asyncio
61 pytestCheckHook
62 ];
63
64 disabledTestPaths = [
65 # benchmarking requires pytest-codespeed
66 "tests/benchmarks"
67 ];
68
69 __darwinAllowLocalNetworking = true;
70
71 pythonImportsCheck = [ "aioesphomeapi" ];
72
73 meta = with lib; {
74 description = "Python Client for ESPHome native API";
75 homepage = "https://github.com/esphome/aioesphomeapi";
76 changelog = "https://github.com/esphome/aioesphomeapi/releases/tag/${src.tag}";
77 license = licenses.mit;
78 maintainers = with maintainers; [
79 fab
80 hexa
81 ];
82 };
83}