depot/third_party/nixpkgs/pkgs/development/python-modules/python-kasa/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

77 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 ];
};
}