guix-commits
[Top][All Lists]
Advanced

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

07/97: guix: python-build-system: Delete .egg-info file created in phase


From: Hartmut Goebel
Subject: 07/97: guix: python-build-system: Delete .egg-info file created in phase check.
Date: Tue, 18 Oct 2016 20:13:15 +0000 (UTC)

htgoebel pushed a commit to branch wip-python-build-system
in repository guix.

commit 4273144b5f7fa4c6a096b989214bcb3a9b6107a3
Author: Hartmut Goebel <address@hidden>
Date:   Fri Oct 7 17:17:00 2016 +0200

    guix: python-build-system: Delete .egg-info file created in phase check.
    
    * guix/build/python-build-system.scm (check): Delete .egg-info dirs
      which did not exist prior to calling setup.py but afterwards.
---
 guix/build/python-build-system.scm |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/build/python-build-system.scm 
b/guix/build/python-build-system.scm
index 1950b3b..e85df40 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -67,7 +67,15 @@
 (define* (check #:key tests? test-target use-setuptools? #:allow-other-keys)
   "Run the test suite of a given Python package."
   (if tests?
-    (call-setuppy test-target '() use-setuptools?)
+      ;; Running `setup.py test` creates an additional .egg-info directory in
+      ;; build/lib in some cases, e.g. if the source is in a sub-directory
+      ;; (given with `package_dir`). This will by copied to the output, too,
+      ;; so we need to remove.
+      (let ((before (find-files "build" "\\.egg-info$" #:directories? #t)))
+        (call-setuppy test-target '() use-setuptools?)
+        (let* ((after (find-files "build" "\\.egg-info$" #:directories? #t))
+               (inter (lset-difference eqv? after before)))
+          (for-each delete-file-recursively inter)))
     #t))
 
 (define (get-python-version python)



reply via email to

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