depot/third_party/nixpkgs/pkgs/development/python-modules/certifi/default.nix
Default email 5e9e1146e1 Project import generated by Copybara.
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
2023-08-05 00:07:22 +02:00

52 lines
1 KiB
Nix

{ lib
, buildPythonPackage
, cacert
, pythonOlder
, fetchFromGitHub
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "certifi";
version = "2023.05.07";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = pname;
repo = "python-certifi";
rev = version;
hash = "sha256-KXm0CtuZJL9VgFeY+DV0rdjaKqPQCqcoGPCkeGieTX8=";
};
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"
'';
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 ];
};
}