From b303f1aff2cf6dca7b9a4624df13fec7eb8e640b Mon Sep 17 00:00:00 2001 From: BatteredBunny Date: Thu, 6 Aug 2026 23:37:03 +0300 Subject: [PATCH] python3Packages.napalm-ros: fix build --- .../development/python-modules/napalm/ros.nix | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/napalm/ros.nix b/pkgs/development/python-modules/napalm/ros.nix index 080766099cf6..9d4161dfcb6f 100644 --- a/pkgs/development/python-modules/napalm/ros.nix +++ b/pkgs/development/python-modules/napalm/ros.nix @@ -2,11 +2,10 @@ lib, buildPythonPackage, fetchFromGitHub, - setuptools, napalm, librouteros, pytestCheckHook, - pythonAtLeast, + poetry-core, }: buildPythonPackage rec { pname = "napalm-ros"; @@ -20,15 +19,27 @@ buildPythonPackage rec { 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"