2021-08-10 14:31:46 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, click
|
|
|
|
, fetchPypi
|
|
|
|
, flask
|
|
|
|
, isPy27
|
|
|
|
, nixosTests
|
|
|
|
, prometheus_client
|
|
|
|
, py-air-control
|
|
|
|
, pytestCheckHook
|
|
|
|
, setuptools-scm
|
|
|
|
}:
|
2020-12-07 07:45:13 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "py-air-control-exporter";
|
2020-12-26 04:20:00 +00:00
|
|
|
version = "0.3.0";
|
2020-12-07 07:45:13 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-12-26 04:20:00 +00:00
|
|
|
sha256 = "ece2e446273542e5c0352c9d6e80d8279132c6ada3649c59e87a711448801a3b";
|
2020-12-07 07:45:13 +00:00
|
|
|
};
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
flask
|
|
|
|
prometheus_client
|
|
|
|
py-air-control
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "pytest-runner" ""
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "--cov=py_air_control_exporter" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests are outdated
|
|
|
|
"test_help"
|
|
|
|
"test_unknown_protocol"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "py_air_control_exporter" ];
|
2020-12-07 07:45:13 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) py-air-control; };
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
meta = with lib; {
|
2021-08-10 14:31:46 +00:00
|
|
|
description = "Exports Air Quality Metrics to Prometheus";
|
2020-12-07 07:45:13 +00:00
|
|
|
homepage = "https://github.com/urbas/py-air-control-exporter";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ urbas ];
|
|
|
|
};
|
|
|
|
}
|