2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
2023-08-22 20:05:09 +00:00
|
|
|
, aiohttp
|
2022-04-27 09:35:20 +00:00
|
|
|
, asn1crypto
|
2023-08-22 20:05:09 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, certomancer
|
2022-04-27 09:35:20 +00:00
|
|
|
, click
|
|
|
|
, cryptography
|
2023-08-22 20:05:09 +00:00
|
|
|
, defusedxml
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fonttools
|
|
|
|
, freezegun
|
|
|
|
, oscrypto
|
|
|
|
, pillow
|
2022-04-27 09:35:20 +00:00
|
|
|
, pyhanko-certvalidator
|
2023-08-22 20:05:09 +00:00
|
|
|
, pytest-aiohttp
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-barcode
|
|
|
|
, python-pae
|
|
|
|
, python-pkcs11
|
|
|
|
, pythonOlder
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytz
|
|
|
|
, pyyaml
|
|
|
|
, qrcode
|
|
|
|
, requests
|
|
|
|
, requests-mock
|
2023-08-22 20:05:09 +00:00
|
|
|
, setuptools
|
|
|
|
, tzlocal
|
2022-04-27 09:35:20 +00:00
|
|
|
, uharfbuzz
|
2023-08-22 20:05:09 +00:00
|
|
|
, wheel
|
2024-01-02 11:29:13 +00:00
|
|
|
, xsdata
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyhanko";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.21.0";
|
|
|
|
pyproject = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MatthiasValvekens";
|
|
|
|
repo = "pyHanko";
|
2023-08-22 20:05:09 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-+RlrXuKMY89mO4iuFw7RLQABy+wLrAeHlEvTDCpBSqU=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace ' "pytest-runner",' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-03-15 16:39:30 +00:00
|
|
|
asn1crypto
|
2022-04-27 09:35:20 +00:00
|
|
|
click
|
2023-03-15 16:39:30 +00:00
|
|
|
cryptography
|
2022-04-27 09:35:20 +00:00
|
|
|
pyhanko-certvalidator
|
|
|
|
pytz
|
|
|
|
pyyaml
|
|
|
|
qrcode
|
2023-03-15 16:39:30 +00:00
|
|
|
requests
|
2022-04-27 09:35:20 +00:00
|
|
|
tzlocal
|
|
|
|
];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
passthru.optional-dependencies = {
|
2023-08-22 20:05:09 +00:00
|
|
|
extra-pubkey-algs = [
|
2023-03-15 16:39:30 +00:00
|
|
|
oscrypto
|
|
|
|
];
|
|
|
|
xmp = [
|
|
|
|
defusedxml
|
|
|
|
];
|
|
|
|
opentype = [
|
|
|
|
fonttools
|
|
|
|
uharfbuzz
|
|
|
|
];
|
|
|
|
image-support = [
|
|
|
|
pillow
|
|
|
|
python-barcode
|
|
|
|
];
|
|
|
|
pkcs11 = [
|
|
|
|
python-pkcs11
|
|
|
|
];
|
2023-08-22 20:05:09 +00:00
|
|
|
async-http = [
|
2023-03-15 16:39:30 +00:00
|
|
|
aiohttp
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
etsi = [
|
|
|
|
xsdata
|
|
|
|
];
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
aiohttp
|
|
|
|
certomancer
|
|
|
|
freezegun
|
|
|
|
python-pae
|
|
|
|
pytest-aiohttp
|
|
|
|
requests-mock
|
|
|
|
pytestCheckHook
|
2023-03-15 16:39:30 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# ModuleNotFoundError: No module named 'csc_dummy'
|
|
|
|
"pyhanko_tests/test_csc.py"
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Most of the test require working with local certificates,
|
|
|
|
# contacting OSCP or performing requests
|
|
|
|
"test_generic_data_sign_legacy"
|
|
|
|
"test_generic_data_sign"
|
|
|
|
"test_cms_v3_sign"
|
|
|
|
"test_detached_cms_with_self_reported_timestamp"
|
|
|
|
"test_detached_cms_with_tst"
|
|
|
|
"test_detached_cms_with_content_tst"
|
|
|
|
"test_detached_cms_with_wrong_content_tst"
|
|
|
|
"test_detached_with_malformed_content_tst"
|
|
|
|
"test_noop_attribute_prov"
|
|
|
|
"test_detached_cades_cms_with_tst"
|
|
|
|
"test_read_qr_config"
|
|
|
|
"test_no_changes_policy"
|
|
|
|
"test_bogus_metadata_manipulation"
|
|
|
|
"test_tamper_sig_obj"
|
|
|
|
"test_signed_file_diff_proxied_objs"
|
|
|
|
"test_pades_revinfo_live"
|
|
|
|
"test_diff_fallback_ok"
|
|
|
|
"test_no_diff_summary"
|
|
|
|
"test_ocsp_embed"
|
|
|
|
"test_ts_fetch_aiohttp"
|
|
|
|
"test_ts_fetch_requests"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyhanko"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Sign and stamp PDF files";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pyhanko";
|
2022-04-27 09:35:20 +00:00
|
|
|
homepage = "https://github.com/MatthiasValvekens/pyHanko";
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/MatthiasValvekens/pyHanko/blob/v${version}/docs/changelog.rst";
|
2022-04-27 09:35:20 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
|
|
|
};
|
|
|
|
}
|