1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 isPy27, 6 7 # propagates: 8 requests, 9 websocket-client, 10 11 # extras: async 12 aiohttp, 13 websockets, 14 15 # extras: encrypted 16 cryptography, 17 py3rijndael, 18 19 # tests 20 aioresponses, 21 pytest-asyncio, 22 pytestCheckHook, 23}: 24 25buildPythonPackage rec { 26 pname = "samsungtvws"; 27 version = "2.7.2"; 28 format = "setuptools"; 29 disabled = isPy27; 30 31 src = fetchFromGitHub { 32 owner = "xchwarze"; 33 repo = "samsung-tv-ws-api"; 34 tag = "v${version}"; 35 hash = "sha256-CU59Kg8kSEE71x6wifCKCaVFdaMftodtkrAOpD+qvWY="; 36 }; 37 38 propagatedBuildInputs = [ 39 requests 40 websocket-client 41 ]; 42 43 optional-dependencies = { 44 async = [ 45 aiohttp 46 websockets 47 ]; 48 encrypted = [ 49 cryptography 50 py3rijndael 51 ]; 52 }; 53 54 nativeCheckInputs = [ 55 aioresponses 56 pytest-asyncio 57 pytestCheckHook 58 ] 59 ++ optional-dependencies.async 60 ++ optional-dependencies.encrypted; 61 62 pythonImportsCheck = [ "samsungtvws" ]; 63 64 meta = with lib; { 65 description = "Samsung Smart TV WS API wrapper"; 66 homepage = "https://github.com/xchwarze/samsung-tv-ws-api"; 67 changelog = "https://github.com/xchwarze/samsung-tv-ws-api/releases/tag/v${version}"; 68 license = licenses.mit; 69 maintainers = with maintainers; [ hexa ]; 70 }; 71}