about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/requests-kerberos/default.nix
blob: 17a8191455aedf7547a2e675792d4ef559bb12da (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
{ lib
, fetchFromGitHub
, buildPythonPackage
, cryptography
, requests
, pykerberos
, pyspnego
, pytestCheckHook
, pytest-mock
, mock
}:

buildPythonPackage rec {
  pname = "requests-kerberos";
  version = "0.13.0";

  # tests are not present in the PyPI version
  src = fetchFromGitHub {
    owner = "requests";
    repo = pname;
    rev = "v${version}";
    sha256 = "0yvfg2cj3d10l8fd8kyal4hmpd7fd1c3bca13cj9ril5l573in76";
  };

  # avoid needing to package krb5
  postPatch = ''
    substituteInPlace setup.py \
    --replace "pyspnego[kerberos]" "pyspnego"
  '';

  propagatedBuildInputs = [
    cryptography
    requests
    pykerberos
    pyspnego
  ];

  checkInputs = [
    mock
    pytestCheckHook
    pytest-mock
  ];

  pythonImportsCheck = [ "requests_kerberos" ];

  meta = with lib; {
    description = "An authentication handler for using Kerberos with Python Requests";
    homepage = "https://github.com/requests/requests-kerberos";
    license = licenses.isc;
    maintainers = with maintainers; [ catern ];
  };
}