Files
nixpkgs/pkgs/development/python-modules/python-kasa/default.nix

86 lines
1.6 KiB
Nix

{
lib,
aiohttp,
asyncclick,
buildPythonPackage,
cryptography,
fetchFromGitHub,
hatchling,
kasa-crypt,
mashumaro,
orjson,
ptpython,
pytest-asyncio,
pytest-freezer,
pytest-mock,
pytest-socket,
pytest-xdist,
pytestCheckHook,
rich,
voluptuous,
}:
buildPythonPackage (finalAttrs: {
pname = "python-kasa";
version = "0.12.0";
pyproject = true;
src = fetchFromGitHub {
owner = "python-kasa";
repo = "python-kasa";
tag = finalAttrs.version;
hash = "sha256-z984z3Rqh5wZ+Tbum+vOaJjXOL8ljX1g/HkhdlQi4rI=";
};
build-system = [ hatchling ];
dependencies = [
aiohttp
asyncclick
cryptography
mashumaro
];
optional-dependencies = {
shell = [
ptpython
rich
];
speedups = [
kasa-crypt
orjson
];
};
nativeCheckInputs = [
pytest-asyncio
pytest-freezer
pytest-mock
pytest-socket
pytest-xdist
pytestCheckHook
voluptuous
]
++ lib.flatten (builtins.attrValues finalAttrs.passthru.optional-dependencies);
pytestFlags = [ "--asyncio-mode=auto" ];
disabledTestPaths = [
# Skip the examples tests
"tests/test_readme_examples.py"
# Failing on hydra
"tests/test_cli.py"
];
pythonImportsCheck = [ "kasa" ];
meta = {
description = "Python API for TP-Link Kasa Smarthome products";
homepage = "https://python-kasa.readthedocs.io/";
changelog = "https://github.com/python-kasa/python-kasa/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ fab ];
mainProgram = "kasa";
};
})