guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: gnu: python: Remove unnecessary installed tests.


From: Ludovic Courtès
Subject: 02/03: gnu: python: Remove unnecessary installed tests.
Date: Tue, 10 May 2016 14:51:10 +0000 (UTC)

civodul pushed a commit to branch core-updates
in repository guix.

commit 9ffe61b0ee38b0df88868706d5918e944a626cd9
Author: Ludovic Courtès <address@hidden>
Date:   Tue May 10 09:03:55 2016 +0200

    gnu: python: Remove unnecessary installed tests.
    
    * gnu/packages/python.scm (python-2)[arguments]: Add 'remove-tests'
    phase.
---
 gnu/packages/python.scm |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 4824ff3..f09ff96 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -201,6 +201,28 @@
                           (utime file circa-1980 circa-1980)
                           #t))
                #t)))
+          (add-after 'install 'remove-tests
+            ;; Remove 25 MiB of unneeded unit tests.  Keep test_support.*
+            ;; because these files are used by some libraries out there.
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((out (assoc-ref outputs "out")))
+                (match (scandir (string-append out "/lib")
+                                (lambda (name)
+                                  (string-prefix? "python" name)))
+                  ((pythonX.Y)
+                   (let ((testdir (string-append out "/lib/" pythonX.Y
+                                                 "/test")))
+                     (with-directory-excursion testdir
+                       (for-each delete-file-recursively
+                                 (scandir testdir
+                                          (match-lambda
+                                            ((or "." "..") #f)
+                                            (file
+                                             (not
+                                              (string-prefix? "test_support."
+                                                              file))))))
+                       (call-with-output-file "__init__.py" (const #t))
+                       #t)))))))
           (add-after 'install 'move-tk-inter
             (lambda* (#:key outputs #:allow-other-keys)
               ;; When Tkinter support is built move it to a separate output so



reply via email to

[Prev in Thread] Current Thread [Next in Thread]