Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pyhanko / default.nix
blob68d777bd1b28114d3bc7e89749c1e3e93cae1e84
1 { lib
2 , aiohttp
3 , asn1crypto
4 , buildPythonPackage
5 , certomancer
6 , click
7 , cryptography
8 , defusedxml
9 , fetchFromGitHub
10 , fonttools
11 , freezegun
12 , oscrypto
13 , pillow
14 , pyhanko-certvalidator
15 , pytest-aiohttp
16 , pytestCheckHook
17 , python-barcode
18 , python-pae
19 , python-pkcs11
20 , pythonOlder
21 , pytz
22 , pyyaml
23 , qrcode
24 , requests
25 , requests-mock
26 , setuptools
27 , tzlocal
28 , uharfbuzz
29 , wheel
30 , xsdata
33 buildPythonPackage rec {
34   pname = "pyhanko";
35   version = "0.21.0";
36   pyproject = true;
38   disabled = pythonOlder "3.8";
40   src = fetchFromGitHub {
41     owner = "MatthiasValvekens";
42     repo = "pyHanko";
43     rev = "refs/tags/v${version}";
44     hash = "sha256-+RlrXuKMY89mO4iuFw7RLQABy+wLrAeHlEvTDCpBSqU=";
45   };
47   postPatch = ''
48     substituteInPlace pyproject.toml \
49       --replace ' "pytest-runner",' ""
50   '';
52   nativeBuildInputs = [
53     setuptools
54     wheel
55   ];
57   propagatedBuildInputs = [
58     asn1crypto
59     click
60     cryptography
61     pyhanko-certvalidator
62     pytz
63     pyyaml
64     qrcode
65     requests
66     tzlocal
67   ];
69   passthru.optional-dependencies = {
70     extra-pubkey-algs = [
71       oscrypto
72     ];
73     xmp = [
74       defusedxml
75     ];
76     opentype = [
77       fonttools
78       uharfbuzz
79     ];
80     image-support = [
81       pillow
82       python-barcode
83     ];
84     pkcs11 = [
85       python-pkcs11
86     ];
87     async-http = [
88       aiohttp
89     ];
90     etsi = [
91       xsdata
92     ];
93   };
95   nativeCheckInputs = [
96     aiohttp
97     certomancer
98     freezegun
99     python-pae
100     pytest-aiohttp
101     requests-mock
102     pytestCheckHook
103   ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
105   disabledTestPaths = [
106     # ModuleNotFoundError: No module named 'csc_dummy'
107     "pyhanko_tests/test_csc.py"
108   ];
110   disabledTests = [
111     # Most of the test require working with local certificates,
112     # contacting OSCP or performing requests
113     "test_generic_data_sign_legacy"
114     "test_generic_data_sign"
115     "test_cms_v3_sign"
116     "test_detached_cms_with_self_reported_timestamp"
117     "test_detached_cms_with_tst"
118     "test_detached_cms_with_content_tst"
119     "test_detached_cms_with_wrong_content_tst"
120     "test_detached_with_malformed_content_tst"
121     "test_noop_attribute_prov"
122     "test_detached_cades_cms_with_tst"
123     "test_read_qr_config"
124     "test_no_changes_policy"
125     "test_bogus_metadata_manipulation"
126     "test_tamper_sig_obj"
127     "test_signed_file_diff_proxied_objs"
128     "test_pades_revinfo_live"
129     "test_diff_fallback_ok"
130     "test_no_diff_summary"
131     "test_ocsp_embed"
132     "test_ts_fetch_aiohttp"
133     "test_ts_fetch_requests"
134   ];
136   pythonImportsCheck = [
137     "pyhanko"
138   ];
140   meta = with lib; {
141     description = "Sign and stamp PDF files";
142     mainProgram = "pyhanko";
143     homepage = "https://github.com/MatthiasValvekens/pyHanko";
144     changelog = "https://github.com/MatthiasValvekens/pyHanko/blob/v${version}/docs/changelog.rst";
145     license = licenses.mit;
146     maintainers = with maintainers; [ wolfangaukang ];
147   };