1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 pythonOlder, 7 8 # build-system 9 distutils, 10 setuptools, 11 12 # native dependencies 13 openldap, 14 cyrus_sasl, 15 16 pyasn1, 17 pyasn1-modules, 18 19 # tests 20 pytestCheckHook, 21 jaraco-functools, 22}: 23 24buildPythonPackage rec { 25 pname = "python-ldap"; 26 version = "3.4.4"; 27 pyproject = true; 28 29 disabled = pythonOlder "3.6"; 30 31 src = fetchFromGitHub { 32 owner = "python-ldap"; 33 repo = "python-ldap"; 34 tag = "python-ldap-${version}"; 35 hash = "sha256-v1cWoRGxbvvFnHqnwoIfmiQQcxfaA8Bf3+M5bE5PtuU="; 36 }; 37 38 build-system = [ 39 distutils 40 setuptools 41 ]; 42 43 buildInputs = [ 44 openldap 45 cyrus_sasl 46 ]; 47 48 dependencies = [ 49 pyasn1 50 pyasn1-modules 51 ]; 52 53 nativeCheckInputs = [ 54 jaraco-functools 55 pytestCheckHook 56 ]; 57 58 preCheck = '' 59 # Needed by tests to setup a mockup ldap server. 60 export BIN="${openldap}/bin" 61 export SBIN="${openldap}/bin" 62 export SLAPD="${openldap}/libexec/slapd" 63 export SCHEMA="${openldap}/etc/schema" 64 ''; 65 66 disabledTests = [ 67 # https://github.com/python-ldap/python-ldap/issues/501 68 "test_tls_ext_noca" 69 ]; 70 71 __darwinAllowLocalNetworking = true; 72 73 meta = with lib; { 74 description = "Python modules for implementing LDAP clients"; 75 downloadPage = "https://github.com/python-ldap/python-ldap"; 76 homepage = "https://www.python-ldap.org/"; 77 changelog = "https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-${version}"; 78 license = licenses.psfl; 79 maintainers = [ ]; 80 }; 81}