Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pytraccar / default.nix
blob3af3cb33e96d7c1d86b5c02c7745fe843540654e
1 { lib
2 , aiohttp
3 , buildPythonPackage
4 , fetchFromGitHub
5 , poetry-core
6 , pytestCheckHook
7 , pytest-asyncio
8 , pythonOlder
9 }:
11 buildPythonPackage rec {
12   pname = "pytraccar";
13   version = "2.1.1";
14   pyproject = true;
16   disabled = pythonOlder "3.11";
18   src = fetchFromGitHub {
19     owner = "ludeeus";
20     repo = "pytraccar";
21     rev = "refs/tags/${version}";
22     hash = "sha256-WTRqYw66iD4bbb1aWJfBI67+DtE1FE4oiuUKpfVqypE=";
23   };
25   nativeBuildInputs = [
26     poetry-core
27   ];
29   propagatedBuildInputs = [
30     aiohttp
31   ];
33   # https://github.com/ludeeus/pytraccar/issues/31
34   doCheck = lib.versionOlder aiohttp.version "3.9.0";
36   nativeCheckInputs = [
37     pytestCheckHook
38     pytest-asyncio
39   ];
41   pytestFlagsArray = [
42     "--asyncio-mode=auto"
43   ];
45   postPatch = ''
46     # Upstream doesn't set version in the repo
47     substituteInPlace pyproject.toml \
48       --replace 'version = "0"' 'version = "${version}"'
49   '';
51   pythonImportsCheck = [
52     "pytraccar"
53   ];
55   meta = with lib; {
56     description = "Python library to handle device information from Traccar";
57     homepage = "https://github.com/ludeeus/pytraccar";
58     changelog = "https://github.com/ludeeus/pytraccar/releases/tag/${version}";
59     license = licenses.mit;
60     maintainers = with maintainers; [ fab ];
61   };