From 0282a1ef86bfcb2db9fea7fb886b0f26c1c466d7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 9 Aug 2021 12:18:24 +0200 Subject: [PATCH 1/2] python3Packages.coapthon3: 1.0.1 -> 1.0.2 --- pkgs/development/python-modules/coapthon3/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/coapthon3/default.nix b/pkgs/development/python-modules/coapthon3/default.nix index 6f22e8e9f296..643072269a36 100644 --- a/pkgs/development/python-modules/coapthon3/default.nix +++ b/pkgs/development/python-modules/coapthon3/default.nix @@ -2,14 +2,14 @@ buildPythonPackage rec { pname = "CoAPthon3"; - version = "1.0.1"; + version = "1.0.2"; disabled = isPy27; src = fetchFromGitHub { owner = "Tanganelli"; repo = pname; rev = version; - sha256 = "1im35i5i72y1p9qj8ixkwq7q6ksbrmi42giqiyfgjp1ym38snl69"; + sha256 = "sha256-9QApoPUu3XFZY/lgjAsf5r2StFiRtUd1UXWDrzYUh6w="; }; propagatedBuildInputs = [ cachetools ]; From 06a8b080e58d4394d750aa5d1cb42e4262ed7bf2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 9 Aug 2021 13:29:02 +0200 Subject: [PATCH 2/2] python3Packages.py-air-control-exporter: fix build and cleanup --- .../py-air-control-exporter/default.nix | 49 ++++++++++++++++--- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/py-air-control-exporter/default.nix b/pkgs/development/python-modules/py-air-control-exporter/default.nix index 869aea01a29a..1a8a52fd246e 100644 --- a/pkgs/development/python-modules/py-air-control-exporter/default.nix +++ b/pkgs/development/python-modules/py-air-control-exporter/default.nix @@ -1,6 +1,15 @@ -{ buildPythonPackage, fetchPypi, flask, isPy27, lib, nixosTests -, prometheus_client, py-air-control, pytestCheckHook, pytest-cov, pytest-runner -, setuptools-scm }: +{ lib +, buildPythonPackage +, click +, fetchPypi +, flask +, isPy27 +, nixosTests +, prometheus_client +, py-air-control +, pytestCheckHook +, setuptools-scm +}: buildPythonPackage rec { pname = "py-air-control-exporter"; @@ -12,14 +21,40 @@ buildPythonPackage rec { sha256 = "ece2e446273542e5c0352c9d6e80d8279132c6ada3649c59e87a711448801a3b"; }; - nativeBuildInputs = [ setuptools-scm ]; - checkInputs = [ pytestCheckHook pytest-cov pytest-runner ]; - propagatedBuildInputs = [ flask prometheus_client py-air-control ]; + 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" ]; passthru.tests = { inherit (nixosTests.prometheus-exporters) py-air-control; }; meta = with lib; { - description = "Exports Air Quality Metrics to Prometheus."; + description = "Exports Air Quality Metrics to Prometheus"; homepage = "https://github.com/urbas/py-air-control-exporter"; license = licenses.mit; maintainers = with maintainers; [ urbas ];