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.40.3";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "tillsteinbach";
20 repo = "WeConnect-mqtt";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-kV4BWQ4XfB2QjXY5b46+pxt3rhyo1glKRYO2mMJNhJM=";
23 };
24
25 propagatedBuildInputs = [
26 paho-mqtt
27 python-dateutil
28 weconnect
29 ] ++ weconnect.optional-dependencies.Images;
30
31 postPatch = ''
32 substituteInPlace weconnect_mqtt/__version.py \
33 --replace "develop" "${version}"
34 substituteInPlace pytest.ini \
35 --replace "--cov=weconnect_mqtt --cov-config=.coveragerc --cov-report html" "" \
36 --replace "pytest-cov" ""
37 '';
38
39 checkInputs = [
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 license = with licenses; [ mit ];
51 maintainers = with maintainers; [ fab ];
52 };
53}