about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyrad/default.nix
blob: 8a707488871628028b8cea5fbb46ea0d862d94d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ buildPythonPackage
, fetchFromGitHub
, fetchpatch
, lib
, poetry-core
, netaddr
, six
, unittestCheckHook
}:

buildPythonPackage rec {
  pname = "pyrad";
  version = "2.4";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "pyradius";
    repo = pname;
    rev = version;
    hash = "sha256-oqgkE0xG/8cmLeRZdGoHkaHbjtByeJwzBJwEdxH8oNY=";
  };

  patches = [
    (fetchpatch {
      # Migrate to poetry-core
      url = "https://github.com/pyradius/pyrad/commit/a4b70067dd6269e14a2f9530d820390a8a454231.patch";
      hash = "sha256-1We9wrVY3Or3GLIKK6hZvEjVYv6JOaahgP9zOMvgErE=";
    })
  ];

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    netaddr
    six
  ];

  preCheck = ''
    substituteInPlace tests/testServer.py \
      --replace "def testBind(self):" "def dontTestBind(self):" \
      --replace "def testBindv6(self):" "def dontTestBindv6(self):"
  '';

  nativeCheckInputs = [
    unittestCheckHook
  ];

  pythonImportsCheck = [
    "pyrad"
  ];

  meta = with lib; {
    description = "Python RADIUS Implementation";
    homepage = "https://github.com/pyradius/pyrad";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ];
  };
}