depot/third_party/nixpkgs/pkgs/development/python-modules/python-ldap/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

74 lines
1.5 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
pythonOlder,
# build-system
setuptools,
# native dependencies
openldap,
cyrus_sasl,
# dependencies
pyasn1,
pyasn1-modules,
# tests
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "python-ldap";
version = "3.4.4";
pyproject = true;
disabled = pythonOlder "3.6" || pythonAtLeast "3.12"; # requires distutils
src = fetchFromGitHub {
owner = "python-ldap";
repo = "python-ldap";
rev = "refs/tags/python-ldap-${version}";
hash = "sha256-v1cWoRGxbvvFnHqnwoIfmiQQcxfaA8Bf3+M5bE5PtuU=";
};
build-system = [ setuptools ];
buildInputs = [
openldap
cyrus_sasl
];
dependencies = [
pyasn1
pyasn1-modules
];
nativeCheckInputs = [ pytestCheckHook ];
preCheck = ''
# Needed by tests to setup a mockup ldap server.
export BIN="${openldap}/bin"
export SBIN="${openldap}/bin"
export SLAPD="${openldap}/libexec/slapd"
export SCHEMA="${openldap}/etc/schema"
'';
disabledTests = [
# https://github.com/python-ldap/python-ldap/issues/501
"test_tls_ext_noca"
];
doCheck = !stdenv.isDarwin;
meta = with lib; {
changelog = "https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-${version}";
description = "Python modules for implementing LDAP clients";
downloadPage = "https://github.com/python-ldap/python-ldap";
homepage = "https://www.python-ldap.org/";
license = licenses.psfl;
};
}