1{ 2 lib, 3 aiohttp, 4 buildPythonPackage, 5 fetchFromGitHub, 6 poetry-core, 7 pytestCheckHook, 8 pytest-asyncio, 9 pythonOlder, 10}: 11 12buildPythonPackage rec { 13 pname = "pytraccar"; 14 version = "2.1.1"; 15 pyproject = true; 16 17 disabled = pythonOlder "3.11"; 18 19 src = fetchFromGitHub { 20 owner = "ludeeus"; 21 repo = "pytraccar"; 22 rev = "refs/tags/${version}"; 23 hash = "sha256-WTRqYw66iD4bbb1aWJfBI67+DtE1FE4oiuUKpfVqypE="; 24 }; 25 26 nativeBuildInputs = [ poetry-core ]; 27 28 propagatedBuildInputs = [ aiohttp ]; 29 30 # https://github.com/ludeeus/pytraccar/issues/31 31 doCheck = lib.versionOlder aiohttp.version "3.9.0"; 32 33 nativeCheckInputs = [ 34 pytestCheckHook 35 pytest-asyncio 36 ]; 37 38 pytestFlagsArray = [ "--asyncio-mode=auto" ]; 39 40 postPatch = '' 41 # Upstream doesn't set version in the repo 42 substituteInPlace pyproject.toml \ 43 --replace 'version = "0"' 'version = "${version}"' 44 ''; 45 46 pythonImportsCheck = [ "pytraccar" ]; 47 48 meta = with lib; { 49 description = "Python library to handle device information from Traccar"; 50 homepage = "https://github.com/ludeeus/pytraccar"; 51 changelog = "https://github.com/ludeeus/pytraccar/releases/tag/${version}"; 52 license = licenses.mit; 53 maintainers = with maintainers; [ fab ]; 54 }; 55}