diff mbox series

[bug#52595,1/5] gnu: python-future: Fix sanity check.

Message ID 6f948e621fa47df5e1e138923b334096e29d4fdf.camel@gmail.com
State Accepted
Headers show
Series Update Ren'py to 7.4.11 | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Liliana Marie Prikler Dec. 17, 2021, 5:56 p.m. UTC
* gnu/packages/python-xyz.scm (python-future): Exclude winreg and tkinter from
sanity check.
---
 gnu/packages/python-xyz.scm | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 13d883c26d..3970153894 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14780,7 +14780,24 @@  (define-public python-future
     ;; Many tests connect to the network or are otherwise flawed.
     ;; https://github.com/PythonCharmers/python-future/issues/210
     (arguments
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'sanity-check
+           (let ((sanity-check (assoc-ref %standard-phases 'sanity-check)))
+             (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
+               (let* ((files (find-files (site-packages inputs outputs)
+                                         "top_level\\.txt"))
+                      (backups (map (lambda (f) (string-append f ".bak"))
+                                    files)))
+                 (for-each copy-file files backups)
+                 (substitute* files
+                   ;; Nobody be usin' winreg on Guix
+                   ;; Also, don't force users to have tkinter when they don't
+                   ;; need it
+                   (("(winreg|tkinter)") ""))
+                 (apply sanity-check args)
+                 (for-each rename-file backups files))))))))
     (home-page "https://python-future.org")
     (synopsis "Single-source support for Python 3 and 2")
     (description