python311Packages.napalm-hp-procurve: refactor

This commit is contained in:
Fabian Affolter 2023-11-30 19:54:56 +01:00
parent 90479ad3fa
commit 8c9009a24a

View File

@ -5,6 +5,7 @@
, netmiko
, pip
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
@ -12,32 +13,37 @@ buildPythonPackage rec {
version = "0.7.0";
format = "setuptools";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "napalm-automation-community";
repo = pname;
rev = version;
repo = "napalm-hp-procurve";
rev = "refs/tags/${version}";
hash = "sha256-cO4kxI90krj1knzixRKWxa77OAaxjO8dLTy02VpkV9M=";
};
patchPhase = ''
# Dependency installation in setup.py doesn't work
echo -n > requirements.txt
substituteInPlace setup.cfg \
--replace "--cov=napalm_procurve --cov-report term-missing -vs --pylama" ""
'';
nativeBuildInputs = [
pip
];
# dependency installation in setup.py doesn't work
patchPhase = ''
echo -n > requirements.txt
'';
buildInputs = [
napalm
];
buildInputs = [ napalm ];
propagatedBuildInputs = [
netmiko
];
propagatedBuildInputs = [ netmiko ];
# setup.cfg seems to contain invalid pytest parameters
preCheck = ''
rm setup.cfg
'';
nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
pytestCheckHook
];
disabledTests = [
# AssertionError: Some methods vary.
@ -48,6 +54,10 @@ buildPythonPackage rec {
"test_get_interfaces"
];
pythonImportsCheck = [
"napalm_procurve"
];
meta = with lib; {
description = "HP ProCurve Driver for NAPALM automation frontend";
homepage = "https://github.com/napalm-automation-community/napalm-hp-procurve";