diff --git a/pkgs/development/python-modules/getmac/default.nix b/pkgs/development/python-modules/getmac/default.nix index 51ce0ef0503..483539bc221 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 ]; }; diff --git a/pkgs/development/python-modules/pymysensors/default.nix b/pkgs/development/python-modules/pymysensors/default.nix new file mode 100644 index 00000000000..bbfeec3a36c --- /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/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 595a0a05a43..53df1f1c597 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 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ed2a4d7a3a5..98f0b12aca6 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 { };