Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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.41.1";
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-RYxfz5uBWV1HLbcIK1N/glJv2w0nfPLBPyM2b7HuDIY=";
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 changelog = "https://github.com/tillsteinbach/WeConnect-mqtt/releases/tag/v${version}";
51 license = with licenses; [ mit ];
52 maintainers = with maintainers; [ fab ];
53 };
54}