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