mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-08 14:23:40 +00:00
98 lines
1.9 KiB
Nix
98 lines
1.9 KiB
Nix
{
|
|
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 = "45.3.1"; # must track the major version that home-assistant pins
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "esphome";
|
|
repo = "aioesphomeapi";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-+8P6OL+4Y+qrKLYqXtjBL2ylcamsF24Ccn00Vt9ohD0=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace-fail "setuptools>=82.0.1" setuptools \
|
|
--replace-fail "Cython>=3.2.5" 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 suppoted 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
|
|
];
|
|
};
|
|
})
|