nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 gnupg,
7 pytestCheckHook,
8}:
9
10buildPythonPackage (finalAttrs: {
11 pname = "python-gnupg";
12 version = "0.5.6";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "vsajip";
17 repo = "python-gnupg";
18 tag = finalAttrs.version;
19 hash = "sha256-ztwITune/rO4c3wUCsw6wBN09jnpWpElgwQx7JCXsVw=";
20 };
21
22 postPatch = ''
23 substituteInPlace gnupg.py \
24 --replace "gpgbinary='gpg'" "gpgbinary='${lib.getExe gnupg}'"
25 substituteInPlace test_gnupg.py \
26 --replace "os.environ.get('GPGBINARY', 'gpg')" "os.environ.get('GPGBINARY', '${lib.getExe gnupg}')"
27 '';
28
29 build-system = [ setuptools ];
30
31 nativeCheckInputs = [ pytestCheckHook ];
32
33 disabledTests = [
34 # network access
35 "test_search_keys"
36 ];
37
38 pythonImportsCheck = [ "gnupg" ];
39
40 meta = {
41 description = "API for the GNU Privacy Guard (GnuPG)";
42 homepage = "https://github.com/vsajip/python-gnupg";
43 changelog = "https://github.com/vsajip/python-gnupg/releases/tag/${finalAttrs.version}";
44 license = lib.licenses.bsd3;
45 maintainers = [ ];
46 };
47})