From 53b2a693f7124f1d839ab0a4fcdd74234c270eb5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 19 Feb 2021 18:18:11 +0100 Subject: [PATCH 1/3] python3Packages.getmac: switch to pytestCheckHook and fix build --- .../python-modules/getmac/default.nix | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/getmac/default.nix b/pkgs/development/python-modules/getmac/default.nix index 51ce0ef05031..483539bc221f 100644 --- a/pkgs/development/python-modules/getmac/default.nix +++ b/pkgs/development/python-modules/getmac/default.nix @@ -1,5 +1,10 @@ -{ lib, buildPythonPackage, fetchFromGitHub -, pytest, pytest-benchmark, pytest-mock }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytest-benchmark +, pytest-mock +, pytestCheckHook +}: buildPythonPackage rec { pname = "getmac"; @@ -7,19 +12,32 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "GhostofGoes"; - repo = "getmac"; + repo = pname; rev = version; sha256 = "08d4iv5bjl1s4i9qhzf3pzjgj1rgbwi0x26qypf3ycgdj0a6gvh2"; }; - checkInputs = [ pytest pytest-benchmark pytest-mock ]; - checkPhase = '' - pytest --ignore tests/test_cli.py - ''; + checkInputs = [ + pytestCheckHook + pytest-benchmark + pytest-mock + ]; + + disabledTests = [ + # Disable CLI tests + "test_cli_main_basic" + "test_cli_main_verbose" + "test_cli_main_debug" + "test_cli_multiple_debug_levels" + # Disable test that require network access + "test_uuid_lanscan_iface" + ]; + + pythonImportsCheck = [ "getmac" ]; meta = with lib; { + description = "Python package to get the MAC address of network interfaces and hosts on the local network"; homepage = "https://github.com/GhostofGoes/getmac"; - description = "Pure-Python package to get the MAC address of network interfaces and hosts on the local network."; license = licenses.mit; maintainers = with maintainers; [ colemickens ]; }; From 99a074aa71c0e56de7a57c9c5a3131021efbdcb9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 19 Feb 2021 18:24:02 +0100 Subject: [PATCH 2/3] python3Packages.pymysensors: init at 0.20.1 --- .../python-modules/pymysensors/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/pymysensors/default.nix diff --git a/pkgs/development/python-modules/pymysensors/default.nix b/pkgs/development/python-modules/pymysensors/default.nix new file mode 100644 index 000000000000..bbfeec3a36ce --- /dev/null +++ b/pkgs/development/python-modules/pymysensors/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, click +, crcmod +, fetchFromGitHub +, getmac +, intelhex +, paho-mqtt +, pyserial +, pyserial-asyncio +, pytest-sugar +, pytest-timeout +, pytestCheckHook +, pythonOlder +, voluptuous +}: + +buildPythonPackage rec { + pname = "pymysensors"; + version = "0.20.1"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "theolind"; + repo = pname; + rev = version; + sha256 = "1hz3551ydsmd23havd0dljmvkhzjnmd28k41ws60s8ms3gzlzqfy"; + }; + + propagatedBuildInputs = [ + click + crcmod + getmac + intelhex + paho-mqtt + pyserial + pyserial-asyncio + voluptuous + ]; + + checkInputs = [ + pytest-sugar + pytest-timeout + pytestCheckHook + ]; + + pythonImportsCheck = [ "mysensors" ]; + + meta = with lib; { + description = "Python API for talking to a MySensors gateway"; + homepage = "https://github.com/theolind/pymysensors"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bdff2fce1522..73efe1ea1294 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5718,6 +5718,8 @@ in { pymyq = callPackage ../development/python-modules/pymyq { }; + pymysensors = callPackage ../development/python-modules/pymysensors { }; + pymysql = callPackage ../development/python-modules/pymysql { }; pymysqlsa = callPackage ../development/python-modules/pymysqlsa { }; From ab75447925762ee9859ed86c178adb080c59b20b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 19 Feb 2021 18:24:29 +0100 Subject: [PATCH 3/3] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index ce7fbfb60648..95397bae577d 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -523,7 +523,7 @@ "mychevy" = ps: with ps; [ ]; # missing inputs: mychevy "mycroft" = ps: with ps; [ ]; # missing inputs: mycroftapi "myq" = ps: with ps; [ pymyq ]; - "mysensors" = ps: with ps; [ aiohttp-cors paho-mqtt ]; # missing inputs: pymysensors + "mysensors" = ps: with ps; [ aiohttp-cors paho-mqtt pymysensors ]; "mystrom" = ps: with ps; [ aiohttp-cors python-mystrom ]; "mythicbeastsdns" = ps: with ps; [ ]; # missing inputs: mbddns "n26" = ps: with ps; [ ]; # missing inputs: n26