1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 lib,
5 poetry-core,
6 netaddr,
7 six,
8 unittestCheckHook,
9 fetchPypi,
10}:
11let
12 netaddr_0_8_0 = netaddr.overridePythonAttrs (oldAttrs: rec {
13 version = "0.8.0";
14
15 src = fetchPypi {
16 pname = "netaddr";
17 inherit version;
18 hash = "sha256-1sxXx6B7HZ0ukXqos2rozmHDW6P80bg8oxxaDuK1okM=";
19 };
20 });
21in
22
23buildPythonPackage rec {
24 pname = "pyrad";
25 version = "2.4-unstable-2023-06-13";
26 format = "pyproject";
27
28 src = fetchFromGitHub {
29 owner = "pyradius";
30 repo = pname;
31 rev = "dd34c5a29b46d83b0bea841e85fd72b79f315b87";
32 hash = "sha256-U4VVGkDDyN4J/tRDaDGSr2TSA4JmqIoQj5qn9qBAvQU=";
33 };
34
35 nativeBuildInputs = [ poetry-core ];
36
37 propagatedBuildInputs = [
38 netaddr_0_8_0
39 six
40 ];
41
42 preCheck = ''
43 substituteInPlace tests/testServer.py \
44 --replace-warn "def testBind(self):" "def dontTestBind(self):" \
45 --replace-warn "def testBindv6(self):" "def dontTestBindv6(self):" \
46 '';
47
48 nativeCheckInputs = [ unittestCheckHook ];
49
50 pythonImportsCheck = [ "pyrad" ];
51
52 meta = {
53 description = "Python RADIUS Implementation";
54 homepage = "https://github.com/pyradius/pyrad";
55 license = lib.licenses.bsd3;
56 maintainers = with lib.maintainers; [ drawbu ];
57 };
58}