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