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 = "24.3.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-wQR3dwN5O++TdtQh+Wcj7c7TNMaRj2lMlOuXOAPVU0Q="; 39 }; 40 41 build-system = [ 42 setuptools 43 cython 44 ]; 45 46 dependencies = [ 47 aiohappyeyeballs 48 async-interrupt 49 chacha20poly1305-reuseable 50 cryptography 51 noiseprotocol 52 protobuf 53 zeroconf 54 ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; 55 56 nativeCheckInputs = [ 57 mock 58 pytest-asyncio 59 pytestCheckHook 60 ]; 61 62 disabledTests = [ 63 # https://github.com/esphome/aioesphomeapi/issues/837 64 "test_reconnect_logic_stop_callback" 65 ]; 66 67 pythonImportsCheck = [ "aioesphomeapi" ]; 68 69 meta = with lib; { 70 description = "Python Client for ESPHome native API"; 71 homepage = "https://github.com/esphome/aioesphomeapi"; 72 changelog = "https://github.com/esphome/aioesphomeapi/releases/tag/v${version}"; 73 license = licenses.mit; 74 maintainers = with maintainers; [ 75 fab 76 hexa 77 ]; 78 }; 79}