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