summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-auth-ldap/default.nix
blob: 1ee93ac481c027bf33ba057419f749460f08267a (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # buildtime
  setuptools-scm,

  # runtime
  django,
  python-ldap,

  # tests
  openldap,
}:

buildPythonPackage rec {
  pname = "django-auth-ldap";
  version = "5.3.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "django-auth-ldap";
    repo = "django-auth-ldap";
    tag = version;
    hash = "sha256-+ezadod2ZKrsNW7lVO1dVqQWUnzP1Mi9On8/RJ2qNfI=";
  };

  build-system = [ setuptools-scm ];

  dependencies = [
    django
    python-ldap
  ];

  # Duplicate attributeType: "MSADat2:102"\nslapadd: could not add entry dn="cn={4}msuser,cn=schema,cn=config" (line=1): \xd0\xbe\xff\xff\xff\x7f\n'
  doCheck = false;

  preCheck = ''
    export PATH=${openldap}/bin:${openldap}/libexec:$PATH
    export SCHEMA=${openldap}/etc/schema
    export DJANGO_SETTINGS_MODULE=tests.settings
  '';

  checkPhase = ''
    runHook preCheck
    python -m django test --settings tests.settings
    runHook postCheck
  '';

  pythonImportsCheck = [ "django_auth_ldap" ];

  meta = {
    changelog = "https://github.com/django-auth-ldap/django-auth-ldap/releases/tag/${src.tag}";
    description = "Django authentication backend that authenticates against an LDAP service";
    homepage = "https://github.com/django-auth-ldap/django-auth-ldap";
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [ mmai ];
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
  };
}