diff --git a/pkgs/development/python-modules/pyrad/default.nix b/pkgs/development/python-modules/pyrad/default.nix index 8a7074888716..7f96cb627008 100644 --- a/pkgs/development/python-modules/pyrad/default.nix +++ b/pkgs/development/python-modules/pyrad/default.nix @@ -6,7 +6,19 @@ , netaddr , six , unittestCheckHook +, fetchPypi }: +let + netaddr_0_8_0 = netaddr.overridePythonAttrs (oldAttrs: rec { + version = "0.8.0"; + + src = fetchPypi { + pname = "netaddr"; + inherit version; + hash = "sha256-1sxXx6B7HZ0ukXqos2rozmHDW6P80bg8oxxaDuK1okM="; + }; + }); +in buildPythonPackage rec { pname = "pyrad"; @@ -33,14 +45,21 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ - netaddr + netaddr_0_8_0 six ]; - preCheck = '' substituteInPlace tests/testServer.py \ - --replace "def testBind(self):" "def dontTestBind(self):" \ - --replace "def testBindv6(self):" "def dontTestBindv6(self):" + --replace-warn "def testBind(self):" "def dontTestBind(self):" \ + --replace-warn "def testBindv6(self):" "def dontTestBindv6(self):" \ + + # A lot of test methods have been deprecated since Python 3.1 + # and have been removed in Python 3.12. + # https://docs.python.org/3/whatsnew/3.11.html#pending-removal-in-python-3-12 + substituteInPlace tests/*.py \ + --replace-quiet "self.failUnless" "self.assertTrue" \ + --replace-quiet "self.failIf" "self.assertFalse" \ + --replace-quiet "self.assertEquals" "self.assertEqual" ''; nativeCheckInputs = [