Subject: [PATCH v2 20/24] gnu: python-wrapt: Enable tests.

From: Vinicius Monego <[email-masked]>
Date: Sat, 13 Nov 2021 20:02:26 +0000

* gnu/packages/python-xyz.scm (python-wrapt)[source]: Fetch from GitHub.
[arguments]<#:phases>: Override 'check phase.
---
 gnu/packages/python-xyz.scm | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 402053e96f..8fcc9583ab 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -10841,16 +10841,23 @@ Supported netlink families and protocols include:
     (version "1.13.3")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "wrapt" version))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/GrahamDumpleton/wrapt")
+             (commit version)))
+       (file-name (git-file-name name version))
        (sha256
-        (base32
-         "11f13zqgbql26g5bkfkqalckcdlz394g6dhx4y16cvk873a9rshz"))))
+        (base32 "05d7xs6rvaw9gpcvsvk7ckxiax1nrxcpv41vrqkkl7zq967d9bcj"))))
     (build-system python-build-system)
     (arguments
-     ;; Tests are not included in the tarball, they are only available in the
-     ;; git repository.
-     `(#:tests? #f))
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "unittest" "discover"
+                       "-s" "tests")))))))
     (home-page "https://github.com/GrahamDumpleton/wrapt")
     (synopsis "Module for decorators, wrappers and monkey patching")
     (description
-- 
2.30.2