1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 influxdb,
6 jsonpath-ng,
7 paho-mqtt,
8 py-expression-eval,
9 pyaml,
10 pycron,
11 pytestCheckHook,
12 schema,
13 setuptools,
14}:
15
16buildPythonPackage rec {
17 pname = "mqtt2influxdb";
18 version = "1.5.2";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "hardwario";
23 repo = "bch-mqtt2influxdb";
24 tag = "v${version}";
25 hash = "sha256-YDgMoxnH4vCCa7b857U6iVBhYLxk8ZjytGziryn24bg=";
26 };
27
28 postPatch = ''
29 substituteInPlace setup.py \
30 --replace-fail "find_version('mqtt2influxdb', '__init__.py')," "'${version}',"
31 '';
32
33 build-system = [ setuptools ];
34
35 dependencies = [
36 influxdb
37 jsonpath-ng
38 paho-mqtt
39 py-expression-eval
40 pyaml
41 pycron
42 schema
43 ];
44
45 nativeCheckInputs = [ pytestCheckHook ];
46
47 pythonImportsCheck = [ "mqtt2influxdb" ];
48
49 enabledTestPaths = [ "tests/test.py" ];
50
51 meta = with lib; {
52 description = "Flexible MQTT to InfluxDB Bridge";
53 homepage = "https://github.com/hardwario/bch-mqtt2influxdb";
54 changelog = "https://github.com/hardwario/bch-mqtt2influxdb/releases/tag/v${version}";
55 license = licenses.mit;
56 maintainers = with maintainers; [ cynerd ];
57 mainProgram = "mqtt2influxdb";
58 };
59}