python3Packages.getmac: switch to pytestCheckHook and fix build

This commit is contained in:
Fabian Affolter 2021-02-19 18:18:11 +01:00
parent 8b166bcee0
commit 53b2a693f7

View file

@ -1,5 +1,10 @@
{ lib, buildPythonPackage, fetchFromGitHub { lib
, pytest, pytest-benchmark, pytest-mock }: , buildPythonPackage
, fetchFromGitHub
, pytest-benchmark
, pytest-mock
, pytestCheckHook
}:
buildPythonPackage rec { buildPythonPackage rec {
pname = "getmac"; pname = "getmac";
@ -7,19 +12,32 @@ buildPythonPackage rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "GhostofGoes"; owner = "GhostofGoes";
repo = "getmac"; repo = pname;
rev = version; rev = version;
sha256 = "08d4iv5bjl1s4i9qhzf3pzjgj1rgbwi0x26qypf3ycgdj0a6gvh2"; sha256 = "08d4iv5bjl1s4i9qhzf3pzjgj1rgbwi0x26qypf3ycgdj0a6gvh2";
}; };
checkInputs = [ pytest pytest-benchmark pytest-mock ]; checkInputs = [
checkPhase = '' pytestCheckHook
pytest --ignore tests/test_cli.py 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; { 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"; 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; license = licenses.mit;
maintainers = with maintainers; [ colemickens ]; maintainers = with maintainers; [ colemickens ];
}; };