Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 76 lines 1.3 kB view raw
1{ lib 2, buildPythonPackage 3, pythonOlder 4, fetchPypi 5, poetry 6, click 7, cryptography 8, construct 9, zeroconf 10, attrs 11, pytz 12, appdirs 13, tqdm 14, netifaces 15, android-backup 16, importlib-metadata 17, croniter 18, defusedxml 19, pytestCheckHook 20, pytest-mock 21, pyyaml 22}: 23 24 25buildPythonPackage rec { 26 pname = "python-miio"; 27 version = "0.5.6"; 28 disabled = pythonOlder "3.6"; 29 format = "pyproject"; 30 31 src = fetchPypi { 32 inherit pname version; 33 sha256 = "sha256-tmGt50xBDV++/pqyXsuxHdrwv+XbkjvtrzsYBzQh7zE="; 34 }; 35 36 postPatch = '' 37 substituteInPlace pyproject.toml \ 38 --replace 'croniter = "^0"' 'croniter = "*"' \ 39 --replace 'defusedxml = "^0.6"' 'defusedxml = "*"' 40 ''; 41 42 nativeBuildInputs = [ 43 poetry 44 ]; 45 46 propagatedBuildInputs = [ 47 click 48 cryptography 49 construct 50 zeroconf 51 attrs 52 pytz 53 appdirs 54 tqdm 55 netifaces 56 android-backup 57 croniter 58 defusedxml 59 ] ++ lib.optional (pythonOlder "3.8") importlib-metadata; 60 61 checkInputs = [ 62 pytestCheckHook 63 pytest-mock 64 pyyaml 65 ]; 66 67 pythonImportsCheck = [ "miio" ]; 68 69 meta = with lib; { 70 description = "Python library for interfacing with Xiaomi smart appliances"; 71 homepage = "https://github.com/rytilahti/python-miio"; 72 license = licenses.gpl3Only; 73 maintainers = with maintainers; [ flyfloh ]; 74 }; 75} 76