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