summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/requests-kerberos/default.nix
blob: a1d532a73391719797b671d228fcabce71038c8d (plain)
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
{
  lib,
  stdenv,
  buildPythonPackage,
  cryptography,
  fetchFromGitHub,
  pyspnego,
  pytest-mock,
  pytestCheckHook,
  requests,
}:

buildPythonPackage rec {
  pname = "requests-kerberos";
  version = "0.15.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "requests";
    repo = "requests-kerberos";
    rev = "v${version}";
    hash = "sha256-s1Q3zqKPSuTkiFExr+axai9Eta1xjw/cip8xzfDGR88=";
  };

  propagatedBuildInputs = [
    cryptography
    requests
    pyspnego
  ]
  # Avoid broken Python krb5 package on Darwin
  ++ lib.optionals (!stdenv.hostPlatform.isDarwin) pyspnego.optional-dependencies.kerberos;

  nativeCheckInputs = [
    pytestCheckHook
    pytest-mock
  ];

  pythonImportsCheck = [ "requests_kerberos" ];

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