2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-08-12 12:06:08 +00:00
|
|
|
, poetry-core
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-asyncio
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytraccar";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.1.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.11";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ludeeus";
|
2024-01-02 11:29:13 +00:00
|
|
|
repo = "pytraccar";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-WTRqYw66iD4bbb1aWJfBI67+DtE1FE4oiuUKpfVqypE=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# https://github.com/ludeeus/pytraccar/issues/31
|
|
|
|
doCheck = lib.versionOlder aiohttp.version "3.9.0";
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
pytestFlagsArray = [
|
2022-11-21 17:40:18 +00:00
|
|
|
"--asyncio-mode=auto"
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Upstream doesn't set version in the repo
|
2022-08-12 12:06:08 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'version = "0"' 'version = "${version}"'
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pytraccar"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library to handle device information from Traccar";
|
|
|
|
homepage = "https://github.com/ludeeus/pytraccar";
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/ludeeus/pytraccar/releases/tag/${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|