diff --git a/pkgs/development/python-modules/napalm/hp-procurve.nix b/pkgs/development/python-modules/napalm/hp-procurve.nix index ef6ec5862bc9..64e0462b3a9a 100644 --- a/pkgs/development/python-modules/napalm/hp-procurve.nix +++ b/pkgs/development/python-modules/napalm/hp-procurve.nix @@ -11,15 +11,15 @@ standard-telnetlib, }: -buildPythonPackage rec { - pname = "napalm-hp-procurve"; +buildPythonPackage (finalAttrs: { + pname = "napalm-procurve"; version = "0.7.0"; pyproject = true; src = fetchFromGitHub { owner = "napalm-automation-community"; repo = "napalm-hp-procurve"; - tag = version; + tag = finalAttrs.version; hash = "sha256-cO4kxI90krj1knzixRKWxa77OAaxjO8dLTy02VpkV9M="; }; @@ -27,7 +27,7 @@ buildPythonPackage rec { # Dependency installation in setup.py doesn't work echo -n > requirements.txt substituteInPlace setup.cfg \ - --replace " --pylama" "" + --replace-fail " --pylama" "" ''; build-system = [ @@ -62,8 +62,8 @@ buildPythonPackage rec { meta = { description = "HP ProCurve Driver for NAPALM automation frontend"; homepage = "https://github.com/napalm-automation-community/napalm-hp-procurve"; - changelog = "https://github.com/napalm-automation-community/napalm-hp-procurve/releases/tag/${src.tag}"; + changelog = "https://github.com/napalm-automation-community/napalm-hp-procurve/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.asl20; maintainers = [ ]; }; -} +}) diff --git a/pkgs/development/python-modules/napalm/ros.nix b/pkgs/development/python-modules/napalm/ros.nix index 080766099cf6..3374a9504860 100644 --- a/pkgs/development/python-modules/napalm/ros.nix +++ b/pkgs/development/python-modules/napalm/ros.nix @@ -2,13 +2,13 @@ lib, buildPythonPackage, fetchFromGitHub, - setuptools, napalm, librouteros, pytestCheckHook, - pythonAtLeast, + poetry-core, }: -buildPythonPackage rec { + +buildPythonPackage (finalAttrs: { pname = "napalm-ros"; version = "1.2.6"; pyproject = true; @@ -16,19 +16,31 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "napalm-automation-community"; repo = "napalm-ros"; - tag = version; + tag = finalAttrs.version; hash = "sha256-Fv11Blx44vZZ8NuhQQIFpDr+dH2gDJtQP7b0kAk3U/s="; }; - build-system = [ setuptools ]; + # Setuptools is wrong, upstream uses poetry + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'requires = ["setuptools>=56.0.0", "wheel"]' 'requires = ["poetry-core"]' \ + --replace-fail 'build-backend = "setuptools.build_meta"' 'build-backend = "poetry.core.masonry.api"' + ''; - dependencies = [ librouteros ]; + build-system = [ poetry-core ]; - nativeCheckInputs = [ + dependencies = [ + librouteros napalm - pytestCheckHook ]; + pythonRelaxDeps = [ + "librouteros" + "napalm" + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + disabledTests = [ # AssertionError: Some methods vary. "test_method_signatures" @@ -39,9 +51,9 @@ buildPythonPackage rec { meta = { description = "MikroTik RouterOS NAPALM driver"; homepage = "https://github.com/napalm-automation-community/napalm-ros"; - changelog = "https://github.com/napalm-automation-community/napalm-ros/releases/tag/${src.tag}"; + changelog = "https://github.com/napalm-automation-community/napalm-ros/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.gpl2Plus; platforms = lib.platforms.linux; maintainers = with lib.maintainers; [ felbinger ]; }; -} +})