From 7e2cf7d35222dd912a0a3d16b9e0a42402e8c43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 8 May 2024 21:29:00 +0200 Subject: [PATCH 1/5] python3Packages.pyrad: fix build failing - Failing on ZHF https://hydra.nixos.org/build/258464455 - Fix netaddr to use the correct version - Fix use of deleted methods in python312 causing build fail --- .../python-modules/pyrad/default.nix | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) 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 = [ From 4b94aaf0ed117df1eb65bbe621b5bac39fa1a16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 8 May 2024 21:34:56 +0200 Subject: [PATCH 2/5] maintainers: add drawbu --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index b2cded239a7b..824866dd397a 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -5383,6 +5383,12 @@ githubId = 472846; name = "Sebastian Krohn"; }; + drawbu = { + email = "clement21.boillot@gmail.com"; + github = "drawbu"; + githubId = 69208565; + name = "Clément Boillot"; + }; drets = { email = "dmitryrets@gmail.com"; github = "drets"; From ad55da24c2721fb2d418726f1f55f85120a0d160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 8 May 2024 21:35:15 +0200 Subject: [PATCH 3/5] python3Packages.pyrad: add drawbu to meta.maintainers --- pkgs/development/python-modules/pyrad/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pyrad/default.nix b/pkgs/development/python-modules/pyrad/default.nix index 7f96cb627008..c9dfdc8ee06a 100644 --- a/pkgs/development/python-modules/pyrad/default.nix +++ b/pkgs/development/python-modules/pyrad/default.nix @@ -70,10 +70,10 @@ buildPythonPackage rec { "pyrad" ]; - meta = with lib; { + meta = { description = "Python RADIUS Implementation"; homepage = "https://github.com/pyradius/pyrad"; - license = licenses.bsd3; - maintainers = with maintainers; [ ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ drawbu ]; }; } From 5500207d41b8a0e49a6797224428399f7ba504bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 8 May 2024 22:59:08 +0200 Subject: [PATCH 4/5] python3Packages.pyrad: reformat using `nixfmt-rfc-style` --- .../python-modules/pyrad/default.nix | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/pyrad/default.nix b/pkgs/development/python-modules/pyrad/default.nix index c9dfdc8ee06a..1ecc28cce459 100644 --- a/pkgs/development/python-modules/pyrad/default.nix +++ b/pkgs/development/python-modules/pyrad/default.nix @@ -1,12 +1,13 @@ -{ buildPythonPackage -, fetchFromGitHub -, fetchpatch -, lib -, poetry-core -, netaddr -, six -, unittestCheckHook -, fetchPypi +{ + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + lib, + poetry-core, + netaddr, + six, + unittestCheckHook, + fetchPypi, }: let netaddr_0_8_0 = netaddr.overridePythonAttrs (oldAttrs: rec { @@ -40,9 +41,7 @@ buildPythonPackage rec { }) ]; - nativeBuildInputs = [ - poetry-core - ]; + nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ netaddr_0_8_0 @@ -62,13 +61,9 @@ buildPythonPackage rec { --replace-quiet "self.assertEquals" "self.assertEqual" ''; - nativeCheckInputs = [ - unittestCheckHook - ]; + nativeCheckInputs = [ unittestCheckHook ]; - pythonImportsCheck = [ - "pyrad" - ]; + pythonImportsCheck = [ "pyrad" ]; meta = { description = "Python RADIUS Implementation"; From 982fe358cae9f81585b4b68b6d80986cee542a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 9 May 2024 09:50:32 +0200 Subject: [PATCH 5/5] python3Packages.pyrad: update to `2.4-unstable-2023-06-13` --- .../python-modules/pyrad/default.nix | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/pkgs/development/python-modules/pyrad/default.nix b/pkgs/development/python-modules/pyrad/default.nix index 1ecc28cce459..9e2cb672d95a 100644 --- a/pkgs/development/python-modules/pyrad/default.nix +++ b/pkgs/development/python-modules/pyrad/default.nix @@ -1,7 +1,6 @@ { buildPythonPackage, fetchFromGitHub, - fetchpatch, lib, poetry-core, netaddr, @@ -23,42 +22,27 @@ in buildPythonPackage rec { pname = "pyrad"; - version = "2.4"; + version = "2.4-unstable-2023-06-13"; format = "pyproject"; src = fetchFromGitHub { owner = "pyradius"; repo = pname; - rev = version; - hash = "sha256-oqgkE0xG/8cmLeRZdGoHkaHbjtByeJwzBJwEdxH8oNY="; + rev = "dd34c5a29b46d83b0bea841e85fd72b79f315b87"; + hash = "sha256-U4VVGkDDyN4J/tRDaDGSr2TSA4JmqIoQj5qn9qBAvQU="; }; - patches = [ - (fetchpatch { - # Migrate to poetry-core - url = "https://github.com/pyradius/pyrad/commit/a4b70067dd6269e14a2f9530d820390a8a454231.patch"; - hash = "sha256-1We9wrVY3Or3GLIKK6hZvEjVYv6JOaahgP9zOMvgErE="; - }) - ]; - nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ netaddr_0_8_0 six ]; + preCheck = '' substituteInPlace tests/testServer.py \ --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 = [ unittestCheckHook ];