Skip to content

Commit 06a8b08

Browse files
committed
python3Packages.py-air-control-exporter: fix build and cleanup
1 parent 0282a1e commit 06a8b08

File tree

1 file changed

+42
-7
lines changed
  • pkgs/development/python-modules/py-air-control-exporter

1 file changed

+42
-7
lines changed

pkgs/development/python-modules/py-air-control-exporter/default.nix

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
{ buildPythonPackage, fetchPypi, flask, isPy27, lib, nixosTests
2-
, prometheus_client, py-air-control, pytestCheckHook, pytest-cov, pytest-runner
3-
, setuptools-scm }:
1+
{ lib
2+
, buildPythonPackage
3+
, click
4+
, fetchPypi
5+
, flask
6+
, isPy27
7+
, nixosTests
8+
, prometheus_client
9+
, py-air-control
10+
, pytestCheckHook
11+
, setuptools-scm
12+
}:
413

514
buildPythonPackage rec {
615
pname = "py-air-control-exporter";
@@ -12,14 +21,40 @@ buildPythonPackage rec {
1221
sha256 = "ece2e446273542e5c0352c9d6e80d8279132c6ada3649c59e87a711448801a3b";
1322
};
1423

15-
nativeBuildInputs = [ setuptools-scm ];
16-
checkInputs = [ pytestCheckHook pytest-cov pytest-runner ];
17-
propagatedBuildInputs = [ flask prometheus_client py-air-control ];
24+
nativeBuildInputs = [
25+
setuptools-scm
26+
];
27+
28+
propagatedBuildInputs = [
29+
click
30+
flask
31+
prometheus_client
32+
py-air-control
33+
];
34+
35+
checkInputs = [
36+
pytestCheckHook
37+
];
38+
39+
postPatch = ''
40+
substituteInPlace setup.py \
41+
--replace "pytest-runner" ""
42+
substituteInPlace setup.cfg \
43+
--replace "--cov=py_air_control_exporter" ""
44+
'';
45+
46+
disabledTests = [
47+
# Tests are outdated
48+
"test_help"
49+
"test_unknown_protocol"
50+
];
51+
52+
pythonImportsCheck = [ "py_air_control_exporter" ];
1853

1954
passthru.tests = { inherit (nixosTests.prometheus-exporters) py-air-control; };
2055

2156
meta = with lib; {
22-
description = "Exports Air Quality Metrics to Prometheus.";
57+
description = "Exports Air Quality Metrics to Prometheus";
2358
homepage = "https://github.com/urbas/py-air-control-exporter";
2459
license = licenses.mit;
2560
maintainers = with maintainers; [ urbas ];

0 commit comments

Comments
 (0)