1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 isPy27,
6
7 # buildtime
8 setuptools-scm,
9
10 # runtime
11 django,
12 python-ldap,
13
14 # tests
15 python,
16 pkgs,
17}:
18
19buildPythonPackage rec {
20 pname = "django-auth-ldap";
21 version = "4.8.0";
22 format = "pyproject";
23
24 disabled = isPy27;
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-YEJQk43cn9phnyR8elmwsvBuU6fT9GoVbyiqMN1xpzg=";
29 };
30
31 nativeBuildInputs = [ setuptools-scm ];
32
33 propagatedBuildInputs = [
34 django
35 python-ldap
36 ];
37
38 # ValueError: SCHEMADIR is None, ldap schemas are missing.
39 doCheck = false;
40
41 checkPhase = ''
42 runHook preCheck
43 export PATH=${pkgs.openldap}/bin:${pkgs.openldap}/libexec:$PATH
44 ${python.interpreter} -m django test --settings tests.settings
45 runHook postCheck
46 '';
47
48 pythonImportsCheck = [ "django_auth_ldap" ];
49
50 meta = with lib; {
51 description = "Django authentication backend that authenticates against an LDAP service";
52 homepage = "https://github.com/django-auth-ldap/django-auth-ldap";
53 license = licenses.bsd2;
54 maintainers = with maintainers; [ mmai ];
55 platforms = platforms.linux ++ platforms.darwin;
56 };
57}