1{ 2 lib, 3 aiohttp, 4 buildPythonPackage, 5 fetchFromGitHub, 6 pytest-aiohttp, 7 pytestCheckHook, 8 pythonOlder, 9}: 10 11buildPythonPackage rec { 12 pname = "moonraker-api"; 13 version = "2.0.6"; 14 format = "setuptools"; 15 16 disabled = pythonOlder "3.8"; 17 18 src = fetchFromGitHub { 19 owner = "cmroche"; 20 repo = "moonraker-api"; 21 tag = "v${version}"; 22 hash = "sha256-AwSHF9BbxKBXIQdG4OX1vYYP/ST4jSz3uMMDUx0MSEg="; 23 }; 24 25 postPatch = '' 26 # see comment on https://github.com/cmroche/moonraker-api/commit/e5ca8ab60d2839e150a81182fbe65255d84b4e4e 27 substituteInPlace setup.py \ 28 --replace 'name="moonraker-api",' 'name="moonraker-api",version="${version}",' 29 ''; 30 31 propagatedBuildInputs = [ aiohttp ]; 32 33 nativeCheckInputs = [ 34 pytest-aiohttp 35 pytestCheckHook 36 ]; 37 38 pythonImportsCheck = [ "moonraker_api" ]; 39 40 meta = with lib; { 41 description = "Python API for the Moonraker API"; 42 homepage = "https://github.com/cmroche/moonraker-api"; 43 license = with licenses; [ gpl3Only ]; 44 maintainers = with maintainers; [ fab ]; 45 }; 46}