Files
nixpkgs/pkgs/development/python-modules/wled/default.nix
2025-03-03 16:40:39 +01:00

80 lines
1.4 KiB
Nix

{
lib,
aiohttp,
aresponses,
awesomeversion,
backoff,
buildPythonPackage,
cachetools,
fetchFromGitHub,
mashumaro,
orjson,
poetry-core,
pytest-asyncio,
pytest-cov-stub,
pytest-xdist,
pytestCheckHook,
pythonOlder,
typer,
yarl,
zeroconf,
}:
buildPythonPackage rec {
pname = "wled";
version = "0.21.0";
pyproject = true;
disabled = pythonOlder "3.11";
src = fetchFromGitHub {
owner = "frenck";
repo = "python-wled";
tag = "v${version}";
hash = "sha256-yJ7tiJWSOpkkLwKXo4lYlDrp1FEJ/cGoDaXJamY4ARg=";
};
postPatch = ''
# Upstream doesn't set a version for the pyproject.toml
substituteInPlace pyproject.toml \
--replace-fail "0.0.0" "${version}" \
'';
build-system = [ poetry-core ];
dependencies = [
aiohttp
awesomeversion
backoff
cachetools
mashumaro
orjson
yarl
];
optional-dependencies = {
cli = [
typer
zeroconf
];
};
nativeCheckInputs = [
aresponses
pytest-asyncio
pytest-cov-stub
pytest-xdist
pytestCheckHook
];
pythonImportsCheck = [ "wled" ];
meta = with lib; {
description = "Asynchronous Python client for WLED";
homepage = "https://github.com/frenck/python-wled";
changelog = "https://github.com/frenck/python-wled/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
}