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