1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, pytestCheckHook
7, pytest-asyncio
8, pythonOlder
9}:
10
11buildPythonPackage rec {
12 pname = "pytraccar";
13 version = "0.10.0";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "ludeeus";
20 repo = pname;
21 rev = version;
22 sha256 = "08f7rwvbc1h17lvgv9823ssd3p0vw7yzsg40lbkacgqqiv1hxfzs";
23 };
24
25 propagatedBuildInputs = [
26 aiohttp
27 ];
28
29 checkInputs = [
30 aresponses
31 pytestCheckHook
32 pytest-asyncio
33 ];
34
35 postPatch = ''
36 # Upstream doesn't set version in the repo
37 substituteInPlace setup.py \
38 --replace 'version="master",' 'version="${version}",'
39 '';
40
41 pythonImportsCheck = [
42 "pytraccar"
43 ];
44
45 meta = with lib; {
46 description = "Python library to handle device information from Traccar";
47 homepage = "https://github.com/ludeeus/pytraccar";
48 license = licenses.mit;
49 maintainers = with maintainers; [ fab ];
50 };
51}