1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 setuptools,
7 cyrus_sasl,
8 openldap,
9 gevent,
10 tornado,
11 trio,
12 pytestCheckHook,
13}:
14
15buildPythonPackage rec {
16 pname = "bonsai";
17 version = "1.5.2";
18
19 disabled = pythonOlder "3.8";
20
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "noirello";
25 repo = "bonsai";
26 rev = "v${version}";
27 hash = "sha256-h/PbwQ69fDcmUCazMtxXP1iE0fE1on+WoK+wYgQ9jLs=";
28 };
29
30 nativeBuildInputs = [ setuptools ];
31
32 buildInputs = [
33 cyrus_sasl
34 openldap
35 ];
36
37 passthru.optional-dependencies = {
38 gevent = [ gevent ];
39 tornado = [ tornado ];
40 trio = [ trio ];
41 };
42
43 nativeCheckInputs = [ pytestCheckHook ];
44
45 disabledTestPaths = [
46 # requires running LDAP server
47 "tests/test_asyncio.py"
48 "tests/test_ldapclient.py"
49 "tests/test_ldapconnection.py"
50 "tests/test_ldapentry.py"
51 "tests/test_ldapreference.py"
52 "tests/test_pool.py"
53 ];
54
55 disabledTests = [
56 # requires running LDAP server
57 "test_set_async_connect"
58 ];
59
60 pythonImportsCheck = [ "bonsai" ];
61
62 meta = {
63 changelog = "https://github.com/noirello/bonsai/blob/${src.rev}/CHANGELOG.rst";
64 description = "Python 3 module for accessing LDAP directory servers";
65 homepage = "https://github.com/noirello/bonsai";
66 license = lib.licenses.mit;
67 maintainers = with lib.maintainers; [ dotlambda ];
68 };
69}