Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / python-ldap / default.nix
blob5bc9f3fecfcc00d62b92397019568ddeb49db184
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchFromGitHub
5 , pythonOlder
7 # build-system
8 , setuptools
10 # native dependencies
11 , openldap
12 , cyrus_sasl
14 # dependencies
15 , pyasn1
16 , pyasn1-modules
18 # tests
19 , pytestCheckHook
22 buildPythonPackage rec {
23   pname = "python-ldap";
24   version = "3.4.4";
25   pyproject = true;
27   disabled = pythonOlder "3.6";
29   src = fetchFromGitHub {
30     owner = "python-ldap";
31     repo = "python-ldap";
32     rev = "refs/tags/python-ldap-${version}";
33     hash = "sha256-v1cWoRGxbvvFnHqnwoIfmiQQcxfaA8Bf3+M5bE5PtuU=";
34   };
36   nativeBuildInputs = [
37     setuptools
38   ];
40   buildInputs = [
41     openldap
42     cyrus_sasl
43   ];
45   propagatedBuildInputs = [
46     pyasn1
47     pyasn1-modules
48   ];
50   nativeCheckInputs = [
51     pytestCheckHook
52   ];
54   preCheck = ''
55     # Needed by tests to setup a mockup ldap server.
56     export BIN="${openldap}/bin"
57     export SBIN="${openldap}/bin"
58     export SLAPD="${openldap}/libexec/slapd"
59     export SCHEMA="${openldap}/etc/schema"
60   '';
62   disabledTests = [
63     # https://github.com/python-ldap/python-ldap/issues/501
64     "test_tls_ext_noca"
65   ];
67   doCheck = !stdenv.isDarwin;
69   meta = with lib; {
70     changelog = "https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-${version}";
71     description = "Python modules for implementing LDAP clients";
72     downloadPage = "https://github.com/python-ldap/python-ldap";
73     homepage = "https://www.python-ldap.org/";
74     license = licenses.psfl;
75   };