diff mbox

[v2,2/7] gnu: python-pytest-xdist: Remove pre-compiled .pyc files from source.

Message ID 1476351811-31727-3-git-send-email-h.goebel@crazy-compilers.com
State New
Headers show

Commit Message

Hartmut Goebel Oct. 13, 2016, 9:43 a.m. UTC
* gnu/packages/python.scm (python-pytest-xdist,
  python2-pytest-xdist)[source]: Add snippet.
---
 gnu/packages/python.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 3c3a00c..eca60bc 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1764,7 +1764,15 @@  same arguments.")
        (uri (pypi-uri "pytest-xdist" version ".zip"))
        (sha256
         (base32
-         "08rn2l39ds60xshs4js787l84pfckksqklfq2wq9x8ig2aci2pja"))))
+         "08rn2l39ds60xshs4js787l84pfckksqklfq2wq9x8ig2aci2pja"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Remove pre-compiled .pyc files from source.
+           (for-each delete-file-recursively
+                     (find-files "." "__pycache__" #:directories? #t))
+           (for-each delete-file (find-files "." "\\.pyc$"))
+           #t))))
     (build-system python-build-system)
     (native-inputs
      `(("unzip" ,unzip)