Patchwork [2/5] gnu: python-pytest-xdist: Remove python byte-code files from source.

login
register
mail settings
Submitter Hartmut Goebel
Date Oct. 10, 2016, 1:10 p.m.
Message ID <1476105003-29538-3-git-send-email-h.goebel@crazy-compilers.com>
Download mbox | patch
Permalink /patch/16392/
State New
Headers show

Comments

Hartmut Goebel - Oct. 10, 2016, 1:10 p.m.
* gnu/packages/python.scm (python-pytest-xdist): Add source snippet.
---
 gnu/packages/python.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Danny Milosavljevic - Oct. 11, 2016, 8:24 p.m.
On Mon, 10 Oct 2016 15:10:00 +0200
Hartmut Goebel <h.goebel@crazy-compilers.com> wrote:

> +        '(begin
> +           ;; Source archive contains .pyc files
> +           (for-each delete-file-recursively
> +                     (find-files "." "__pychache__" #:directories? #t))

                                         ^^^^^^^^^^ should this be "__pycache__" ?
Leo Famulari - Oct. 12, 2016, 3:56 p.m.
On Mon, Oct 10, 2016 at 03:10:00PM +0200, Hartmut Goebel wrote:
> * gnu/packages/python.scm (python-pytest-xdist): Add source snippet.

* 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 --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index f1e9264..345c6a7 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
> +           ;; Source archive contains .pyc files

Can you make this comment into a complete sentence? Something like "Remove
pre-compiled .pyc files from source."?

> +           (for-each delete-file-recursively
> +                     (find-files "." "__pychache__" #:directories? #t))

As Danny pointed out, it should probably be "__pycache__".

LGTM with these changes.

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index f1e9264..345c6a7 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
+           ;; Source archive contains .pyc files
+           (for-each delete-file-recursively
+                     (find-files "." "__pychache__" #:directories? #t))
+           (for-each delete-file (find-files "." "\\.pyc$"))
+           #t))))
     (build-system python-build-system)
     (native-inputs
      `(("unzip" ,unzip)