depot/third_party/nixpkgs/pkgs/development/python-modules/certifi/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

53 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
cacert,
pythonOlder,
fetchFromGitHub,
setuptools,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "certifi";
version = "2024.02.02";
pyproject = true;
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = pname;
repo = "python-certifi";
rev = version;
hash = "sha256-gnWJjZy5E/0lvAeLftXNtcHH6RHL/dUomXOBgumiWX8=";
};
patches = [
# Add support for NIX_SSL_CERT_FILE
./env.patch
];
postPatch = ''
# Use our system-wide ca-bundle instead of the bundled one
rm -v "certifi/cacert.pem"
ln -snvf "${cacert}/etc/ssl/certs/ca-bundle.crt" "certifi/cacert.pem"
'';
nativeBuildInputs = [ setuptools ];
propagatedNativeBuildInputs = [
# propagate cacerts setup-hook to set up `NIX_SSL_CERT_FILE`
cacert
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "certifi" ];
meta = with lib; {
homepage = "https://github.com/certifi/python-certifi";
description = "Python package for providing Mozilla's CA Bundle";
license = licenses.isc;
maintainers = with maintainers; [ koral ];
};
}