1{
2 lib,
3 buildPythonPackage,
4 cryptography,
5 fetchFromGitHub,
6 pykerberos,
7 pyspnego,
8 pytest-mock,
9 pytestCheckHook,
10 pythonOlder,
11 requests,
12}:
13
14buildPythonPackage rec {
15 pname = "requests-kerberos";
16 version = "0.14.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.6";
20
21 src = fetchFromGitHub {
22 owner = "requests";
23 repo = pname;
24 rev = "v${version}";
25 hash = "sha256-Y9dTzFCgVmSnbnTE0kEfjpEkXDEA+uOqFHLkSC27YGg=";
26 };
27
28 propagatedBuildInputs = [
29 cryptography
30 requests
31 pykerberos
32 pyspnego
33 ];
34
35 nativeCheckInputs = [
36 pytestCheckHook
37 pytest-mock
38 ];
39
40 # avoid needing to package krb5
41 postPatch = ''
42 substituteInPlace setup.py \
43 --replace "pyspnego[kerberos]" "pyspnego"
44 '';
45
46 pythonImportsCheck = [ "requests_kerberos" ];
47
48 meta = with lib; {
49 description = "An authentication handler for using Kerberos with Python Requests";
50 homepage = "https://github.com/requests/requests-kerberos";
51 license = licenses.isc;
52 maintainers = with maintainers; [ catern ];
53 };
54}