mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
gnu: python: Remove unnecessary installed tests.
* gnu/packages/python.scm (python-2)[arguments]: Add 'remove-tests' phase.
This commit is contained in:
parent
a8938c8858
commit
9ffe61b0ee
1 changed files with 22 additions and 0 deletions
|
@ -201,6 +201,28 @@ (define-public python-2
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue