1{
2 lib,
3 asn1crypto,
4 buildPythonPackage,
5 click,
6 cryptography,
7 fetchFromGitHub,
8 freezegun,
9 jinja2,
10 oscrypto,
11 pyhanko-certvalidator,
12 pytest-aiohttp,
13 pytestCheckHook,
14 python-dateutil,
15 python-pkcs11,
16 pythonOlder,
17 pytz,
18 pyyaml,
19 requests,
20 requests-mock,
21 setuptools,
22 tzlocal,
23 werkzeug,
24 wheel,
25}:
26
27buildPythonPackage rec {
28 pname = "certomancer";
29 version = "0.11.0";
30 format = "pyproject";
31
32 disabled = pythonOlder "3.7";
33
34 src = fetchFromGitHub {
35 owner = "MatthiasValvekens";
36 repo = "certomancer";
37 rev = "refs/tags/v${version}";
38 hash = "sha256-UQV0Tk4C5b5iBZ34Je59gK2dLTaJusnpxdyNicIh2Q8=";
39 };
40
41 postPatch = ''
42 substituteInPlace pyproject.toml \
43 --replace ' "pytest-runner",' "" \
44 '';
45
46 nativeBuildInputs = [
47 setuptools
48 wheel
49 ];
50
51 propagatedBuildInputs = [
52 asn1crypto
53 click
54 oscrypto
55 python-dateutil
56 pyyaml
57 tzlocal
58 ];
59
60 passthru.optional-dependencies = {
61 requests-mocker = [ requests-mock ];
62 web-api = [
63 jinja2
64 werkzeug
65 ];
66 pkcs12 = [ cryptography ];
67 pkcs11 = [ python-pkcs11 ];
68 };
69
70 nativeCheckInputs = [
71 freezegun
72 pyhanko-certvalidator
73 pytest-aiohttp
74 pytestCheckHook
75 pytz
76 requests
77 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
78
79 disabledTests = [
80 # pyhanko_certvalidator.errors.DisallowedAlgorithmError
81 "test_validate"
82 ];
83
84 pythonImportsCheck = [ "certomancer" ];
85
86 meta = with lib; {
87 description = "Quickly construct, mock & deploy PKI test configurations using simple declarative configuration";
88 mainProgram = "certomancer";
89 homepage = "https://github.com/MatthiasValvekens/certomancer";
90 license = licenses.mit;
91 maintainers = with maintainers; [ wolfangaukang ];
92 };
93}