1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# build-system
cython,
setuptools,
# dependencies
aiohappyeyeballs,
async-interrupt,
chacha20poly1305-reuseable,
cryptography,
noiseprotocol,
protobuf,
tzdata,
tzlocal,
zeroconf,
# tests
mock,
pytest-asyncio,
pytestCheckHook,
}:
buildPythonPackage (finalAttrs: {
pname = "aioesphomeapi";
version = "46.3.0"; # must track the major version that home-assistant pins
pyproject = true;
src = fetchFromGitHub {
owner = "esphome";
repo = "aioesphomeapi";
tag = "v${finalAttrs.version}";
hash = "sha256-xwsNlgcYXUOJdJmpQ3/O1gtYptAeX2Vtn4ywxbdNGOM=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "setuptools>=83.0.0" setuptools \
--replace-fail "Cython>=3.2.9" Cython
'';
build-system = [
setuptools
cython
];
pythonRelaxDeps = [
"aiohappyeyeballs"
"cryptography"
];
dependencies = [
aiohappyeyeballs
async-interrupt
chacha20poly1305-reuseable
cryptography
noiseprotocol
protobuf
tzdata
tzlocal
zeroconf
];
nativeCheckInputs = [
mock
pytest-asyncio
pytestCheckHook
];
# Lack of network sandboxing leads to conflicting listeners when testing
# this package e.g. in nixpkgs-review on the two supported python package sets.
doCheck = !stdenv.hostPlatform.isDarwin;
disabledTestPaths = [
# benchmarking requires pytest-codespeed
"tests/benchmarks"
];
__darwinAllowLocalNetworking = true;
pythonImportsCheck = [ "aioesphomeapi" ];
meta = {
description = "Python Client for ESPHome native API";
homepage = "https://github.com/esphome/aioesphomeapi";
changelog = "https://github.com/esphome/aioesphomeapi/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
fab
hexa
];
};
})
|