aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanketsu <hanketsu@egregore.fun>2025-03-01 12:33:45 +0100
committerHanketsu <hanketsu@egregore.fun>2025-06-13 00:04:36 +0200
commit447bccbfa2951fa748a161969a2c146337ae42e5 (patch)
tree72db47e7358fd6cd061229909d868ab0349ad5d3
parentd788fcae67ea9ee6adc965db2ff6815cdbef80c1 (diff)
battering: Add python-pyhanko.
* battering/packages/python-xyz.scm (python-pyhanko): New variable.
-rw-r--r--battering/packages/python-xyz.scm61
1 files changed, 61 insertions, 0 deletions
diff --git a/battering/packages/python-xyz.scm b/battering/packages/python-xyz.scm
index d6897cf..daa8837 100644
--- a/battering/packages/python-xyz.scm
+++ b/battering/packages/python-xyz.scm
@@ -504,3 +504,64 @@ subset of the PEP 257 conventions")
developers to access and use XML and JSON documents as simple objects rather
than using DOM.")
(license license:expat)))
+
+(define-public python-pyhanko
+ (package
+ (name "python-pyhanko")
+ (version "0.25.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/MatthiasValvekens/pyHanko")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "02pryyw9n2hip3mmznsgaz0cd7ks7mpksf6nh9xvsmh3jr1h568w"))
+ (modules '((guix build utils)))
+ ;; TODO: enable these tests when python-pcks11
+ (snippet
+ '(with-directory-excursion "pyhanko_tests"
+ (delete-file "test_pkcs11.py")))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-asn1crypto
+ python-qrcode
+ python-tzlocal
+ python-pyhanko-certvalidator
+ python-click
+ python-requests
+ python-pyyaml
+ python-cryptography
+ python-defusedxml
+ python-fonttools
+ python-uharfbuzz
+ python-pillow
+ python-barcode
+ python-aiohttp
+ python-xsdata))
+ (native-inputs (list python-pytest
+ python-requests-mock
+ python-freezegun
+ python-certomancer
+ python-certomancer-csc-dummy
+ python-pytest-cov
+ python-pytest-asyncio
+ python-pytest-aiohttp
+ poppler-qt6 ;; pdftoppm
+ python-setuptools
+ python-wheel
+ nss-certs-for-test))
+ (arguments
+ (list
+ ;; These tests respectively require internet and fail because of a RuntimeError.
+ #:test-flags ''("-k" "not test_ts_fetch and not [pyloop] and not [pyloop-response_obj")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'check 'set-pdftoppm-path
+ (lambda _
+ (setenv "PDFTOPPM_PATH" (string-append #$poppler-qt6 "/bin/pdftoppm")))))))
+ (home-page "https://github.com/MatthiasValvekens/pyHanko")
+ (synopsis "Sign and stamp PDF files.")
+ (description
+ "PyHanko is a tool for signing and stamping PDF files.")
+ (license license:expat)))