1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pythonOlder
6, paho-mqtt
7, python-dateutil
8, weconnect
9}:
10
11buildPythonPackage rec {
12 pname = "weconnect-mqtt";
13 version = "0.42.3";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "tillsteinbach";
20 repo = "WeConnect-mqtt";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-TEB2UtXH73CCJhbuQjnABcG3XLHB6VybDwjhixnpt0w=";
23 };
24
25 postPatch = ''
26 substituteInPlace weconnect_mqtt/__version.py \
27 --replace "develop" "${version}"
28 substituteInPlace pytest.ini \
29 --replace "--cov=weconnect_mqtt --cov-config=.coveragerc --cov-report html" "" \
30 --replace "pytest-cov" ""
31 '';
32
33 propagatedBuildInputs = [
34 paho-mqtt
35 python-dateutil
36 weconnect
37 ] ++ weconnect.optional-dependencies.Images;
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 ];
42
43 pythonImportsCheck = [
44 "weconnect_mqtt"
45 ];
46
47 meta = with lib; {
48 description = "Python client that publishes data from Volkswagen WeConnect";
49 homepage = "https://github.com/tillsteinbach/WeConnect-mqtt";
50 changelog = "https://github.com/tillsteinbach/WeConnect-mqtt/releases/tag/v${version}";
51 license = with licenses; [ mit ];
52 maintainers = with maintainers; [ fab ];
53 };
54}