python312Packages.mqtt2influxdb: refactor (#356118)

This commit is contained in:
Fabian Affolter 2024-11-15 22:44:06 +01:00 committed by GitHub
commit 7b51fa844a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,21 +8,31 @@
py-expression-eval,
pyaml,
pycron,
pytestCheckHook,
schema,
setuptools,
}:
buildPythonPackage rec {
pname = "mqtt2influxdb";
version = "1.5.2";
format = "setuptools";
pyproject = true;
src = fetchFromGitHub {
owner = "hardwario";
repo = "bch-mqtt2influxdb";
rev = "v${version}";
sha256 = "YDgMoxnH4vCCa7b857U6iVBhYLxk8ZjytGziryn24bg=";
rev = "refs/tags/v${version}";
hash = "sha256-YDgMoxnH4vCCa7b857U6iVBhYLxk8ZjytGziryn24bg=";
};
propagatedBuildInputs = [
postPatch = ''
substituteInPlace setup.py \
--replace-fail "find_version('mqtt2influxdb', '__init__.py')," "'${version}',"
'';
build-system = [ setuptools ];
dependencies = [
influxdb
jsonpath-ng
paho-mqtt
@ -32,14 +42,18 @@ buildPythonPackage rec {
schema
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "mqtt2influxdb" ];
pytestFlagsArray = [ "tests/test.py" ];
meta = with lib; {
homepage = "https://github.com/hardwario/bch-mqtt2influxdb";
description = "Flexible MQTT to InfluxDB Bridge";
mainProgram = "mqtt2influxdb";
platforms = platforms.linux;
homepage = "https://github.com/hardwario/bch-mqtt2influxdb";
changelog = "https://github.com/hardwario/bch-mqtt2influxdb/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ cynerd ];
mainProgram = "mqtt2influxdb";
};
}