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