Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pytraccar / default.nix
blobf854589103a10a9b2ed87d2c96f388cec5900fbe
1 { lib
2 , aiohttp
3 , aresponses
4 , buildPythonPackage
5 , fetchFromGitHub
6 , poetry-core
7 , pydantic
8 , pytestCheckHook
9 , pytest-asyncio
10 , pythonOlder
13 buildPythonPackage rec {
14   pname = "pytraccar";
15   version = "1.0.0";
16   format = "pyproject";
18   disabled = pythonOlder "3.8";
20   src = fetchFromGitHub {
21     owner = "ludeeus";
22     repo = pname;
23     rev = version;
24     hash = "sha256-ngyLe6sbTTQ7n4WdV06OlQnn/vqkD+JUruyMYS1Ym+Q=";
25   };
27   nativeBuildInputs = [
28     poetry-core
29   ];
31   propagatedBuildInputs = [
32     aiohttp
33     pydantic
34   ];
36   nativeCheckInputs = [
37     aresponses
38     pytestCheckHook
39     pytest-asyncio
40   ];
42   pytestFlagsArray = [
43     "--asyncio-mode=auto"
44   ];
46   postPatch = ''
47     # Upstream doesn't set version in the repo
48     substituteInPlace pyproject.toml \
49       --replace 'version = "0"' 'version = "${version}"'
50   '';
52   pythonImportsCheck = [
53     "pytraccar"
54   ];
56   meta = with lib; {
57     description = "Python library to handle device information from Traccar";
58     homepage = "https://github.com/ludeeus/pytraccar";
59     license = licenses.mit;
60     maintainers = with maintainers; [ fab ];
61   };