2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, aresponses
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-08-12 12:06:08 +00:00
|
|
|
, poetry-core
|
|
|
|
, pydantic
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-asyncio
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytraccar";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "1.0.0";
|
|
|
|
format = "pyproject";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ludeeus";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-ngyLe6sbTTQ7n4WdV06OlQnn/vqkD+JUruyMYS1Ym+Q=";
|
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
|
2022-08-12 12:06:08 +00:00
|
|
|
pydantic
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
aresponses
|
|
|
|
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";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|