Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, noiseprotocol
6, protobuf
7, pytest-asyncio
8, pytestCheckHook
9, pythonOlder
10, zeroconf
11}:
12
13buildPythonPackage rec {
14 pname = "aioesphomeapi";
15 version = "13.0.2";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.9";
19
20 src = fetchFromGitHub {
21 owner = "esphome";
22 repo = pname;
23 rev = "refs/tags/v${version}";
24 hash = "sha256-z1QFAKvkJuOH2utYertORca5PpW43VS3YB2mhjBsh+A=";
25 };
26
27 postPatch = ''
28 substituteInPlace requirements.txt \
29 --replace "protobuf>=3.12.2,<4.0" "protobuf>=3.12.2"
30 '';
31
32 propagatedBuildInputs = [
33 noiseprotocol
34 protobuf
35 zeroconf
36 ];
37
38 checkInputs = [
39 mock
40 pytest-asyncio
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [
45 "aioesphomeapi"
46 ];
47
48 meta = with lib; {
49 description = "Python Client for ESPHome native API";
50 homepage = "https://github.com/esphome/aioesphomeapi";
51 changelog = "https://github.com/esphome/aioesphomeapi/releases/tag/v${version}";
52 license = licenses.mit;
53 maintainers = with maintainers; [ fab hexa ];
54 };
55}