diff mbox series

[bug#39932,1/3] gnu: python-xyz: Add python-distlib.

Message ID 20200305192204.14973-1-kuba@kadziolka.net
State Accepted
Headers show
Series python-virtualenv: Update to 20.0.8. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Maja Kądziołka March 5, 2020, 7:22 p.m. UTC
* gnu/packages/python-xyz.scm (python-distlib): New variable.
---
 gnu/packages/python-xyz.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

Ludovic Courtès March 8, 2020, 8:18 p.m. UTC | #1
Hello,

Jakub Kądziołka <kuba@kadziolka.net> skribis:

> * gnu/packages/python-xyz.scm (python-distlib): New variable.

[...]

> +       (modify-phases %standard-phases
> +         (add-before 'build 'no-/bin/sh
> +           (lambda _
> +             (substitute* '("distlib/scripts.py" "tests/test_scripts.py")
> +               (("/bin/sh") (which "sh")))))
> +         (add-before 'check 'prepare-test-env
> +           (lambda _
> +             (setenv "HOME" "/tmp")
> +             ;; NOTE: Any value works, the variable just has to be present.
> +             (setenv "SKIP_ONLINE" "1"))))))

Please return #t from both phases, as is conventional.

Apart from that, all 3 patches LGTM!

Thanks,
Ludo’.
Maja Kądziołka March 8, 2020, 11:22 p.m. UTC | #2
On Sun, Mar 08, 2020 at 09:18:12PM +0100, Ludovic Courtès wrote:
> Hello,
> 
> Jakub Kądziołka <kuba@kadziolka.net> skribis:
> 
> > * gnu/packages/python-xyz.scm (python-distlib): New variable.
> 
> [...]
> 
> > +       (modify-phases %standard-phases
> > +         (add-before 'build 'no-/bin/sh
> > +           (lambda _
> > +             (substitute* '("distlib/scripts.py" "tests/test_scripts.py")
> > +               (("/bin/sh") (which "sh")))))
> > +         (add-before 'check 'prepare-test-env
> > +           (lambda _
> > +             (setenv "HOME" "/tmp")
> > +             ;; NOTE: Any value works, the variable just has to be present.
> > +             (setenv "SKIP_ONLINE" "1"))))))
> 
> Please return #t from both phases, as is conventional.
Argh, I'm always forgetting about that. It would be nice to have a lint
for this...

> Apart from that, all 3 patches LGTM!
Thanks! I pushed the commits, the last one got a hash of
94d57ba3399aeb1b34d52e5e866c609f5a18ec2b
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3cd1686d28..2dfda3d26d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4410,6 +4410,38 @@  by pycodestyle.")
 (define-public python2-autopep8
   (package-with-python2 python-autopep8))
 
+(define-public python-distlib
+  (package
+    (name "python-distlib")
+    (version "0.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "distlib" version ".zip"))
+       (sha256
+        (base32
+         "08fyi2r246733vharl2yckw20rilci28r91mzrnnvcr638inw5if"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'no-/bin/sh
+           (lambda _
+             (substitute* '("distlib/scripts.py" "tests/test_scripts.py")
+               (("/bin/sh") (which "sh")))))
+         (add-before 'check 'prepare-test-env
+           (lambda _
+             (setenv "HOME" "/tmp")
+             ;; NOTE: Any value works, the variable just has to be present.
+             (setenv "SKIP_ONLINE" "1"))))))
+    (native-inputs `(("unzip" ,unzip)))
+    (home-page "https://bitbucket.org/pypa/distlib")
+    (synopsis "Distribution utilities")
+    (description "Distlib is a library which implements low-level functions that
+relate to packaging and distribution of Python software.  It is intended to be
+used as the basis for third-party packaging tools.")
+    (license license:psfl)))
+
 (define-public python-distutils-extra
   (package
     (name "python-distutils-extra")