1{ buildPythonPackage, fetchPypi
2, pyasn1, pyasn1-modules
3, pythonAtLeast, pytestCheckHook
4, openldap, cyrus_sasl, lib, stdenv }:
5
6buildPythonPackage rec {
7 pname = "python-ldap";
8 version = "3.3.1";
9
10 src = fetchPypi {
11 inherit pname version;
12 sha256 = "198as30xy6p760niqps2zdvq2xcmr765h06pmda8fa9y077wl4a7";
13 };
14
15 propagatedBuildInputs = [ pyasn1 pyasn1-modules ];
16
17 checkInputs = [ pytestCheckHook ];
18 buildInputs = [ openldap cyrus_sasl ];
19
20 preCheck = ''
21 # Needed by tests to setup a mockup ldap server.
22 export BIN="${openldap}/bin"
23 export SBIN="${openldap}/bin"
24 export SLAPD="${openldap}/libexec/slapd"
25 export SCHEMA="${openldap}/etc/schema"
26 '';
27
28 disabledTests = lib.optionals (pythonAtLeast "3.9") [
29 # See https://github.com/python-ldap/python-ldap/issues/407
30 "test_simple_bind_noarg"
31 ];
32
33 doCheck = !stdenv.isDarwin;
34
35 meta = with lib; {
36 description = "Python modules for implementing LDAP clients";
37 homepage = "https://www.python-ldap.org/";
38 license = licenses.psfl;
39 };
40}