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 = "28.0.0";
30 pyproject = true;
31
32 disabled = pythonOlder "3.9";
33
34 src = fetchFromGitHub {
35 owner = "esphome";
36 repo = "aioesphomeapi";
37 rev = "refs/tags/v${version}";
38 hash = "sha256-vMqDxg2BV9/g5FquejnT/Rsvwjhdh01K2LxiT355p1U=";
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 disabledTests = [
65 # https://github.com/esphome/aioesphomeapi/issues/837
66 "test_reconnect_logic_stop_callback"
67 # python3.12.4 regression
68 # https://github.com/esphome/aioesphomeapi/issues/889
69 "test_start_connection_cannot_increase_recv_buffer"
70 "test_start_connection_can_only_increase_buffer_size_to_262144"
71 ];
72
73 disabledTestPaths = [
74 # benchmarking requires pytest-codespeed
75 "tests/test_bluetooth_benchmarks.py"
76 ];
77
78 pythonImportsCheck = [ "aioesphomeapi" ];
79
80 meta = with lib; {
81 description = "Python Client for ESPHome native API";
82 homepage = "https://github.com/esphome/aioesphomeapi";
83 changelog = "https://github.com/esphome/aioesphomeapi/releases/tag/v${version}";
84 license = licenses.mit;
85 maintainers = with maintainers; [
86 fab
87 hexa
88 ];
89 };
90}