1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 gnupg,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "python-gnupg";
12 version = "0.5.5";
13
14 format = "pyproject";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-P9yvdvYKG5SP+ON9w5jQPPnOdCcGXVgwgrktp6T/WmM=";
19 };
20
21 postPatch = ''
22 substituteInPlace gnupg.py \
23 --replace "gpgbinary='gpg'" "gpgbinary='${gnupg}/bin/gpg'"
24 substituteInPlace test_gnupg.py \
25 --replace "os.environ.get('GPGBINARY', 'gpg')" "os.environ.get('GPGBINARY', '${gnupg}/bin/gpg')"
26 '';
27
28 nativeBuildInputs = [ setuptools ];
29
30 nativeCheckInputs = [ pytestCheckHook ];
31
32 disabledTests = [
33 # network access
34 "test_search_keys"
35 ];
36
37 pythonImportsCheck = [ "gnupg" ];
38
39 meta = with lib; {
40 description = "API for the GNU Privacy Guard (GnuPG)";
41 homepage = "https://github.com/vsajip/python-gnupg";
42 changelog = "https://github.com/vsajip/python-gnupg/releases/tag/${version}";
43 license = licenses.bsd3;
44 maintainers = [ ];
45 };
46}