1{ lib 2, asyncclick 3, buildPythonPackage 4, fetchFromGitHub 5, fetchpatch 6, importlib-metadata 7, poetry-core 8, pytest-asyncio 9, pytest-mock 10, pytestCheckHook 11, pythonOlder 12, voluptuous 13}: 14 15buildPythonPackage rec { 16 pname = "python-kasa"; 17 version = "0.4.0"; 18 format = "pyproject"; 19 20 disabled = pythonOlder "3.7"; 21 22 src = fetchFromGitHub { 23 owner = pname; 24 repo = pname; 25 rev = version; 26 sha256 = "08blmz5kg826l08pf6yrvl8gc8iz3hfb6wsfqih606dal08kdhdi"; 27 }; 28 29 nativeBuildInputs = [ 30 poetry-core 31 ]; 32 33 propagatedBuildInputs = [ 34 asyncclick 35 importlib-metadata 36 ]; 37 38 checkInputs = [ 39 pytest-asyncio 40 pytest-mock 41 pytestCheckHook 42 voluptuous 43 ]; 44 45 patches = [ 46 # Switch to poetry-core, https://github.com/python-kasa/python-kasa/pull/226 47 (fetchpatch { 48 name = "switch-to-poetry-core.patch"; 49 url = "https://github.com/python-kasa/python-kasa/commit/05c2a4a7dedbd60038e177b4d3f5ac5798544d11.patch"; 50 sha256 = "0cla11yqx88wj2s50s3xxxhv4nz4h3wd9pi12v79778hzdlg58rr"; 51 }) 52 ]; 53 54 postPatch = '' 55 substituteInPlace pyproject.toml \ 56 --replace 'asyncclick = "^7"' 'asyncclick = "*"' 57 ''; 58 59 disabledTestPaths = [ 60 # Skip the examples tests 61 "kasa/tests/test_readme_examples.py" 62 ]; 63 64 pythonImportsCheck = [ "kasa" ]; 65 66 meta = with lib; { 67 description = "Python API for TP-Link Kasa Smarthome products"; 68 homepage = "https://python-kasa.readthedocs.io/"; 69 license = licenses.gpl3Plus; 70 maintainers = with maintainers; [ fab ]; 71 }; 72}