depot/third_party/nixpkgs/pkgs/development/python-modules/python-kasa/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

75 lines
1.3 KiB
Nix

{ lib
, anyio
, asyncclick
, buildPythonPackage
, fetchFromGitHub
, kasa-crypt
, orjson
, poetry-core
, pydantic
, pytest-asyncio
, pytest-mock
, pytestCheckHook
, pythonOlder
, voluptuous
}:
buildPythonPackage rec {
pname = "python-kasa";
version = "0.5.2";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-+ezs8mj3TRmeIhKPxyov9BPdNkhj0ri4FgoZdW7O8tA=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
anyio
asyncclick
pydantic
];
nativeCheckInputs = [
pytest-asyncio
pytest-mock
pytestCheckHook
voluptuous
];
passthru.optional-dependencies = {
speedup = [
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";
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 ];
};
}