depot/third_party/nixpkgs/pkgs/development/python-modules/python-kasa/default.nix
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

82 lines
1.4 KiB
Nix

{ lib
, aiohttp
, anyio
, async-timeout
, asyncclick
, buildPythonPackage
, cryptography
, fetchFromGitHub
, kasa-crypt
, orjson
, poetry-core
, pydantic
, pytest-asyncio
, pytest-mock
, pytestCheckHook
, pythonOlder
, voluptuous
}:
buildPythonPackage rec {
pname = "python-kasa";
version = "0.6.2.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "python-kasa";
repo = "python-kasa";
rev = "refs/tags/${version}";
hash = "sha256-iCqJY3qkA3ZVXTCfxvQoaZsaqGui8PwKGAmLXKZgLJs=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
aiohttp
anyio
async-timeout
asyncclick
cryptography
pydantic
];
nativeCheckInputs = [
pytest-asyncio
pytest-mock
pytestCheckHook
voluptuous
];
passthru.optional-dependencies = {
speedups = [
kasa-crypt
orjson
];
};
pytestFlagsArray = [
"--asyncio-mode=auto"
];
disabledTestPaths = [
# Skip the examples tests
"kasa/tests/test_readme_examples.py"
];
pythonImportsCheck = [
"kasa"
];
meta = with lib; {
description = "Python API for TP-Link Kasa Smarthome products";
mainProgram = "kasa";
homepage = "https://python-kasa.readthedocs.io/";
changelog = "https://github.com/python-kasa/python-kasa/blob/${version}/CHANGELOG.md";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ fab ];
};
}