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.46.0";
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-7TR6+woAV8f80t4epCnZj4jYYpTPKDkzwzNNsgofiwg=";
23 };
24
25 postPatch = ''
26 substituteInPlace requirements.txt \
27 --replace "weconnect[Images]~=" "weconnect>="
28 substituteInPlace weconnect_mqtt/__version.py \
29 --replace "develop" "${version}"
30 substituteInPlace pytest.ini \
31 --replace "--cov=weconnect_mqtt --cov-config=.coveragerc --cov-report html" "" \
32 --replace "pytest-cov" ""
33 '';
34
35 propagatedBuildInputs = [
36 paho-mqtt
37 python-dateutil
38 weconnect
39 ] ++ weconnect.optional-dependencies.Images;
40
41 nativeCheckInputs = [
42 pytestCheckHook
43 ];
44
45 pythonImportsCheck = [
46 "weconnect_mqtt"
47 ];
48
49 meta = with lib; {
50 description = "Python client that publishes data from Volkswagen WeConnect";
51 homepage = "https://github.com/tillsteinbach/WeConnect-mqtt";
52 changelog = "https://github.com/tillsteinbach/WeConnect-mqtt/releases/tag/v${version}";
53 license = with licenses; [ mit ];
54 maintainers = with maintainers; [ fab ];
55 };
56}