diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-05-10 09:03:55 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-05-10 16:50:46 +0200 |
commit | 9ffe61b0ee38b0df88868706d5918e944a626cd9 (patch) | |
tree | 9a365dcaaed20f59616e393d58573926f40e52e0 | |
parent | a8938c88580f071ce74146eef9258e3b1afe48a8 (diff) | |
download | guix-9ffe61b0ee38b0df88868706d5918e944a626cd9.tar.gz |
gnu: python: Remove unnecessary installed tests.
* gnu/packages/python.scm (python-2)[arguments]: Add 'remove-tests' phase.
-rw-r--r-- | gnu/packages/python.scm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 4824ff3eaa..f09ff9694f 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 |