diff mbox series

[bug#68431,3/3] gnu: python-requests-kerberos: Enable tests.

Message ID 87sf312j86.fsf@troyfigiel.com
State New
Headers show
Series Fix python-requests-kerberos build | expand

Commit Message

Troy Figiel Jan. 13, 2024, 6:04 p.m. UTC
* gnu/packages/python-web.scm (python-requests-kerberos): Enable tests.
[source]: Replace the PyPI release by the Github release.
[arguments]<#:phases>: Replace the default check phase with a pytest
invocation.
[native-inputs]: Add python-pytest and python-pytest-mock.
---
 gnu/packages/python-web.scm | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index e13716081f..7b25bee15a 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -3300,13 +3300,23 @@  (define-public python-requests-kerberos
   (package
     (name "python-requests-kerberos")
     (version "0.14.0")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "requests-kerberos" version))
-              (sha256
-               (base32
-                "1lbgjs779cjxhz07lfl9dbyp3qfh8a3ir2393042wfg518jd3afd"))))
+    ;; No tests in the PyPI tarball.
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/requests/requests-kerberos")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0s30pcnlir3j2jmf7yh065f294cf3x0x5i3ldskn8mm0a3657mv3"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (invoke "pytest" "-vv")))))))
     (propagated-inputs (list python-cryptography
                              python-pyspnego
                              python-requests
@@ -3316,6 +3326,7 @@  (define-public python-requests-kerberos
                              ;; code though.
                              python-gssapi
                              python-krb5))
+    (native-inputs (list python-pytest python-pytest-mock))
     (home-page "https://github.com/requests/requests-kerberos")
     (synopsis "Kerberos authentication handler for python-requests")
     (description "This package provides a Kerberos authentication handler for