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