587713944a
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
62 lines
1.5 KiB
Nix
62 lines
1.5 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, paho-mqtt
|
|
, python-dateutil
|
|
, weconnect
|
|
, setuptools
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "weconnect-mqtt";
|
|
version = "0.49.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tillsteinbach";
|
|
repo = "WeConnect-mqtt";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-V96fdy6h012SbP3tyOMniAwLf/1+iKzTc9WnevAVwTI=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace weconnect_mqtt/__version.py \
|
|
--replace-fail "0.0.0dev" "${version}"
|
|
substituteInPlace requirements.txt \
|
|
--replace-fail "weconnect[Images]~=" "weconnect>="
|
|
substituteInPlace pytest.ini \
|
|
--replace-fail "--cov=weconnect_mqtt --cov-config=.coveragerc --cov-report html" "" \
|
|
--replace-fail "pytest-cov" ""
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
setuptools
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
paho-mqtt
|
|
python-dateutil
|
|
weconnect
|
|
] ++ weconnect.optional-dependencies.Images;
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"weconnect_mqtt"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Python client that publishes data from Volkswagen WeConnect";
|
|
mainProgram = "weconnect-mqtt";
|
|
homepage = "https://github.com/tillsteinbach/WeConnect-mqtt";
|
|
changelog = "https://github.com/tillsteinbach/WeConnect-mqtt/releases/tag/v${version}";
|
|
license = with licenses; [ mit ];
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|