depot/third_party/nixpkgs/pkgs/development/python-modules/python-gnupg/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

46 lines
1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
gnupg,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "python-gnupg";
version = "0.5.3";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-KQ2N25zWPfls/pKEubJl8Z/W4UXlWC3Fj9cnHwJtCkc=";
};
postPatch = ''
substituteInPlace gnupg.py \
--replace "gpgbinary='gpg'" "gpgbinary='${gnupg}/bin/gpg'"
substituteInPlace test_gnupg.py \
--replace "os.environ.get('GPGBINARY', 'gpg')" "os.environ.get('GPGBINARY', '${gnupg}/bin/gpg')"
'';
nativeBuildInputs = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
disabledTests = [
# network access
"test_search_keys"
];
pythonImportsCheck = [ "gnupg" ];
meta = with lib; {
description = "API for the GNU Privacy Guard (GnuPG)";
homepage = "https://github.com/vsajip/python-gnupg";
changelog = "https://github.com/vsajip/python-gnupg/releases/tag/${version}";
license = licenses.bsd3;
maintainers = with maintainers; [ copumpkin ];
};
}