unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add python-scikit-bio.
@ 2016-04-21 13:21 Ben Woodcroft
  2016-04-21 13:21 ` [PATCH 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
                   ` (11 more replies)
  0 siblings, 12 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

Thanks in advance for comments.
ben

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 01/10] gnu: Add python2-pytest-cache.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
@ 2016-04-21 13:21 ` Ben Woodcroft
  2016-04-21 13:21 ` [PATCH 02/10] gnu: Add python-bz2file Ben Woodcroft
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-pytest-cache)[properties]: New field.
(python2-pytest-cache): New variable.
---
 gnu/packages/python.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0379352..ecd16c5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2015, 2016 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2015 Ben Woodcroft <donttrustben@gmail.com>
+;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2015, 2016 Erik Edrosa <erik.edrosa@gmail.com>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Kyle Meyer <kyle@kyleam.com>
@@ -6965,7 +6965,17 @@ minimal and fast API targetting the following uses:
     (description "The pytest-cache plugin provides tools to rerun failures from
 the last py.test invocation.")
     (home-page "https://bitbucket.org/hpk42/pytest-cache/")
-    (license license:expat)))
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-pytest-cache))))))
+
+(define-public python2-pytest-cache
+  (let ((base (package-with-python2
+                  (strip-python2-variant python-pytest-cache))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ,@(package-native-inputs base))))))
 
 (define-public python-pytest-localserver
   (package
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 02/10] gnu: Add python-bz2file.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
  2016-04-21 13:21 ` [PATCH 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
@ 2016-04-21 13:21 ` Ben Woodcroft
  2016-04-21 15:43   ` Efraim Flashner
  2016-04-21 18:24   ` Hartmut Goebel
  2016-04-21 13:21 ` [PATCH 03/10] gnu: Add python-pytest-pep8 Ben Woodcroft
                   ` (9 subsequent siblings)
  11 siblings, 2 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-bz2file, python2-bz2file): New
variables.
---
 gnu/packages/python.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ecd16c5..9c3a9fd 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8677,6 +8677,46 @@ LDFLAGS and parse the output to build extensions with setup.py.")
 (define-public python2-pkgconfig
   (package-with-python2 python-pkgconfig))
 
+(define-public python-bz2file
+  (package
+    (name "python-bz2file")
+    (version "0.98")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/b/bz2file/bz2file-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "126s53fkpx04f33a829yqqk8fj4png3qwg4m66cvlmhmwc8zihb4"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; python setup.py test does not work as of 0.98
+         ;; but there is only the one test file
+         (replace 'check
+           (lambda _ (zero? (system* "python" "test_bz2file.py")))))))
+    (home-page "https://github.com/nvawda/bz2file")
+    (synopsis "Read and write bzip2-compressed files")
+    (description
+     "Bz2file is a Python library for reading and writing bzip2-compressed
+files.  It contains a drop-in replacement for the file interface in the
+standard library's bz2 module, including features from the latest development
+version of CPython that are not available in older releases.")
+    (license asl2.0)
+    (properties `((python2-variant . ,(delay python2-bz2file))))))
+
+(define-public python2-bz2file
+  (let ((base (package-with-python2
+               (strip-python2-variant python-bz2file))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 03/10] gnu: Add python-pytest-pep8.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
  2016-04-21 13:21 ` [PATCH 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
  2016-04-21 13:21 ` [PATCH 02/10] gnu: Add python-bz2file Ben Woodcroft
@ 2016-04-21 13:21 ` Ben Woodcroft
  2016-04-21 18:26   ` Hartmut Goebel
  2016-04-21 13:21 ` [PATCH 04/10] gnu: Add python-pytest-flakes Ben Woodcroft
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-pytest-pep8, python2-pytest-pep8): New
variables.
---
 gnu/packages/python.scm | 63 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 9c3a9fd..b5d1005 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8717,6 +8717,69 @@ version of CPython that are not available in older releases.")
       (native-inputs
        `(("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-pytest-pep8
+  (package
+    (name "python-pytest-pep8")
+    (version "1.0.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/p/pytest-pep8/pytest-pep8-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'remove-failing-test
+           ;; Ignore the known test failure.
+           ;; https://bitbucket.org/pytest-dev/pytest-pep8/issues/8/test-failure
+           (lambda _
+             (substitute* "test_pep8.py"
+               (("^def test_ok_verbose") "def dont_run"))
+             #t))
+         (add-after 'install 'post-install-check
+           ;; 'setup.py test' does not run tests
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "PYTHONPATH"
+                       (string-append
+                        (getenv "PYTHONPATH")
+                        ":"
+                        out
+                        "/lib/python"
+                        (string-take (string-take-right
+                                      (assoc-ref inputs "python") 5) 3)
+                        "/site-packages"))
+               (zero?
+                (system*
+                 (string-append out "/bin/py.test") "test_pep8.py"))))))))
+    (propagated-inputs
+     `(("python-pytest-cache", python-pytest-cache)
+       ("python-pytest" ,python-pytest)
+       ("python-pep8" ,python-pep8)))
+    (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
+    (synopsis "Pytest plugin to check PEP8 requirements")
+    (description
+     "Pytest-pep8 is a py.test plugin for efficiently checking compliance to
+the PEP8 style guide.  If you type @code{py.test --pep8} every file ending in
+@code{.py} will be discovered and PEP8-checked, starting from the command line
+arguments.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-pytest-pep8))))))
+
+(define-public python2-pytest-pep8
+  (let ((base (package-with-python2
+               (strip-python2-variant python-pytest-pep8))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 04/10] gnu: Add python-pytest-flakes.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (2 preceding siblings ...)
  2016-04-21 13:21 ` [PATCH 03/10] gnu: Add python-pytest-pep8 Ben Woodcroft
@ 2016-04-21 13:21 ` Ben Woodcroft
  2016-04-21 18:26   ` Hartmut Goebel
  2016-04-21 13:21 ` [PATCH 05/10] gnu: Add python-future Ben Woodcroft
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-pytest-flakes,
python2-pytest-flakes): New variables.
---
 gnu/packages/python.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b5d1005..28b1ee0 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8780,6 +8780,66 @@ arguments.")
       (native-inputs
        `(("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-pytest-flakes
+  (package
+    (name "python-pytest-flakes")
+    (version "1.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/p/pytest-flakes/pytest-flakes-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'post-install-check
+           ;; 'setup.py test' does not run tests
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "PYTHONPATH"
+                       (string-append
+                        (getenv "PYTHONPATH")
+                        ":"
+                        out
+                        "/lib/python"
+                        (string-take (string-take-right
+                                      (assoc-ref inputs "python") 5) 3)
+                        "/site-packages"))
+               (zero?
+                (system*
+                 "py.test" "test_flakes.py"))))))))
+    (native-inputs
+     `(("python-pytest-pep8" ,python-pytest-pep8)))
+    (propagated-inputs
+     `(("python-pytest-cache" ,python-pytest-cache)
+       ("python-pytest" ,python-pytest)
+       ("python-pyflakes" ,python-pyflakes)))
+    (home-page
+     "https://github.com/fschulze/pytest-flakes")
+    (synopsis "Pytest plugin to check source code with pyflakes")
+    (description
+     "Pytest-pyflakes is a py.test plugin for efficiently checking python source
+with pyflakes.  If you type @code{py.test --flakes} every file ending in
+@code{.py} will be discovered and run through pyflakes, starting from the
+command line arguments.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-pytest-flakes))))))
+
+(define-public python2-pytest-flakes
+  (let ((base (package-with-python2
+                 (strip-python2-variant python-pytest-flakes))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(,@(package-native-inputs base)
+         ("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 05/10] gnu: Add python-future.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (3 preceding siblings ...)
  2016-04-21 13:21 ` [PATCH 04/10] gnu: Add python-pytest-flakes Ben Woodcroft
@ 2016-04-21 13:21 ` Ben Woodcroft
  2016-04-21 13:21 ` [PATCH 06/10] gnu: Add python-cachecontrol Ben Woodcroft
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-future, python2-future): New
variables.
---
 gnu/packages/python.scm | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 28b1ee0..54c3202 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8833,13 +8833,46 @@ command line arguments.")
 
 (define-public python2-pytest-flakes
   (let ((base (package-with-python2
-                 (strip-python2-variant python-pytest-flakes))))
+               (strip-python2-variant python-pytest-flakes))))
     (package
       (inherit base)
       (native-inputs
        `(,@(package-native-inputs base)
          ("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-future
+  (package
+    (name "python-future")
+    (version "0.15.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/f/future/future-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "15wvcfzssc68xqnqi1dq4fhd0848hwi9jn42hxyvlqna40zijfrx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f)) ; Tests connect to the network
+    (home-page "http://python-future.org")
+    (synopsis "Single-source support for Python 3 and 2")
+    (description
+     "@code{python-future} is the missing compatibility layer between Python 2 and
+Python 3.  It allows you to use a single, clean Python 3.x-compatible codebase
+to support both Python 2 and Python 3 with minimal overhead.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-future))))))
+
+(define-public python2-future
+  (let ((base (package-with-python2
+               (strip-python2-variant python-future))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 06/10] gnu: Add python-cachecontrol.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (4 preceding siblings ...)
  2016-04-21 13:21 ` [PATCH 05/10] gnu: Add python-future Ben Woodcroft
@ 2016-04-21 13:21 ` Ben Woodcroft
  2016-04-21 13:21 ` [PATCH 07/10] gnu: python-tornado: Use 'python2-variant' Ben Woodcroft
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-cachecontrol,
python2-cachecontrol): New variables.
---
 gnu/packages/python.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 54c3202..0fc65fe 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8873,6 +8873,40 @@ to support both Python 2 and Python 3 with minimal overhead.")
       (inherit base)
       (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-cachecontrol
+  (package
+    (name "python-cachecontrol")
+    (version "0.11.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/C/CacheControl/CacheControl-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "15bn8xll6z15h0zqhfjy1n8dn8p0fcb4m0rhnfanq63z7r2wpprp"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-requests" ,python-requests)
+       ("python-lockfile" ,python-lockfile)))
+    (home-page "https://github.com/ionrock/cachecontrol")
+    (synopsis "httplib2 caching for requests")
+    (description "CacheControl is a port of the caching algorithms in httplib2
+for use with requests session object.  It was written because httplib2's
+better support for caching is often mitigated by its lack of threadsafety.
+The same is true of requests in terms of caching.")
+    (license asl2.0)
+    (properties `((python2-variant . ,(delay python2-cachecontrol))))))
+
+(define-public python2-cachecontrol
+  (let ((base (package-with-python2
+               (strip-python2-variant python-cachecontrol))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 07/10] gnu: python-tornado: Use 'python2-variant'.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (5 preceding siblings ...)
  2016-04-21 13:21 ` [PATCH 06/10] gnu: Add python-cachecontrol Ben Woodcroft
@ 2016-04-21 13:21 ` Ben Woodcroft
  2016-04-21 13:21 ` [PATCH 08/10] gnu: python-ipython: " Ben Woodcroft
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-tornado)[properties]: New field.
(python2-tornado): Build with 'strip-python2-variant'.
---
 gnu/packages/python.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0fc65fe..f26592e 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -4936,10 +4936,12 @@ originally developed at FriendFeed.  By using non-blocking network I/O,
 Tornado can scale to tens of thousands of open connections, making it ideal
 for long polling, WebSockets, and other applications that require a long-lived
 connection to each user.")
-    (license asl2.0)))
+    (license asl2.0)
+    (properties `((python2-variant . ,(delay python2-tornado))))))
 
 (define-public python2-tornado
-  (let ((tornado (package-with-python2 python-tornado)))
+  (let ((tornado (package-with-python2
+                  (strip-python2-variant python-tornado))))
     (package (inherit tornado)
       (inputs
        `(("python2-backport-ssl-match-hostname"
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 08/10] gnu: python-ipython: Use 'python2-variant'.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (6 preceding siblings ...)
  2016-04-21 13:21 ` [PATCH 07/10] gnu: python-tornado: Use 'python2-variant' Ben Woodcroft
@ 2016-04-21 13:21 ` Ben Woodcroft
  2016-04-21 15:14   ` Ricardo Wurmus
  2016-04-21 13:22 ` [PATCH 09/10] gnu: Add python-natsort Ben Woodcroft
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:21 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-ipython)[properties]: New field.
(python2-ipython): Use 'strip-python2-variant'.
---
 gnu/packages/python.scm | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index f26592e..ea9f47a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -4359,29 +4359,21 @@ without using the configuration machinery.")
 Powerful interactive shells, a browser-based notebook, support for interactive
 data visualization, embeddable interpreters and tools for parallel
 computing.")
-    (license bsd-3)))
+    (license bsd-3)
+    (properties `((python2-variant . ,(delay python2-ipython))))))
 
 (define-public python2-ipython
-  (let ((ipython (package-with-python2 python-ipython)))
+  (let ((base (package-with-python2
+               (strip-python2-variant python-ipython))))
     (package
-      (inherit ipython)
+      (inherit base)
       ;; FIXME: some tests are failing
-      (arguments
-       `(#:tests? #f ,@(package-arguments ipython)))
-      ;; Make sure we use custom python2-NAME packages.
       ;; FIXME: add pyreadline once available.
-      (propagated-inputs
-       `(("python2-terminado" ,python2-terminado)
-         ,@(alist-delete "python-terminado"
-                         (package-propagated-inputs ipython))))
+      (arguments
+       `(#:tests? #f ,@(package-arguments base)))
       (inputs
-       `(("python2-jsonschema" ,python2-jsonschema)
-         ("python2-mock" ,python2-mock)
-         ("python2-matplotlib" ,python2-matplotlib)
-         ("python2-numpy" ,python2-numpy)
-         ("python2-requests" ,python2-requests)
-         ,@(fold alist-delete (package-inputs ipython)
-                 '("python-jsonschema" "python-matplotlib" "python-numpy" "python-requests")))))))
+       `(("python2-mock" ,python2-mock)
+         ,@(package-inputs base))))))
 
 (define-public python-isodate
   (package
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 09/10] gnu: Add python-natsort.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (7 preceding siblings ...)
  2016-04-21 13:21 ` [PATCH 08/10] gnu: python-ipython: " Ben Woodcroft
@ 2016-04-21 13:22 ` Ben Woodcroft
  2016-04-21 15:09   ` Ricardo Wurmus
  2016-04-21 13:22 ` [PATCH 10/10] gnu: Add python-scikit-bio Ben Woodcroft
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:22 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-natsort, python2-natsort): New
variables.
---
 gnu/packages/python.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ea9f47a..7aae6fc 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8901,6 +8901,50 @@ The same is true of requests in terms of caching.")
       (inherit base)
       (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-natsort
+  (package
+    (name "python-natsort")
+    (version "4.0.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/n/natsort/natsort-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0f8q66pyczgy1cm3nh8rkh7hgl9h49zx9r06mivg4y5sbzla6sy7"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-flakes" ,python-pytest-flakes)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-cache" ,python-pytest-cache)
+       ("python-hypothesis" ,python-hypothesis)
+       ("python-pytest-pep8", python-pytest-pep8)))
+    (home-page "https://github.com/SethMMorton/natsort")
+    (synopsis "Sort lists naturally")
+    (description "When you try to sort a list of strings that contain numbers,
+the normal python sort algorithm sorts lexicographically, so you might not get
+the results that you expect.  @code{natsort} provides a function
+@code{natsorted} that helps sort lists 'naturally', either as real
+numbers (i.e. signed/unsigned floats or ints), or as versions.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-natsort))))))
+
+(define-public python2-natsort
+  (let ((base (package-with-python2
+               (strip-python2-variant python-natsort))))
+    (package
+      (inherit base)
+      (native-inputs
+       (append (package-native-inputs base)
+               `(("python2-mock" ,python2-mock)
+                 ("python2-pathlib" ,python2-pathlib)
+                 ("python2-enum34" ,python2-enum34)
+                 ("python2-setuptools" ,python2-setuptools)))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 10/10] gnu: Add python-scikit-bio.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (8 preceding siblings ...)
  2016-04-21 13:22 ` [PATCH 09/10] gnu: Add python-natsort Ben Woodcroft
@ 2016-04-21 13:22 ` Ben Woodcroft
  2016-04-21 15:04   ` Ricardo Wurmus
                     ` (2 more replies)
  2016-04-24 13:01 ` [PATCH 2/2] " Ben Woodcroft
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
  11 siblings, 3 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-21 13:22 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-scikit-bio,
python2-scikit-bio): New variables.
---
 gnu/packages/python.scm | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 7aae6fc..b359422 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8945,6 +8945,97 @@ numbers (i.e. signed/unsigned floats or ints), or as versions.")
                  ("python2-enum34" ,python2-enum34)
                  ("python2-setuptools" ,python2-setuptools)))))))
 
+(define-public python-scikit-bio
+  (package
+    (name "python-scikit-bio")
+    (version "0.4.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/s/scikit-bio/scikit-bio-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "06nrcgfz6c3jb2dnaf1wnvx3dyww94p454c4126gvcvfgv6scczy"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Install procedure installs extraneous binaries.
+         (add-after 'install 'remove-extraneous-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (delete-file-recursively bin))
+             #t))
+         ;; `setup.py test' does not run tests, but there are many test
+         ;; failures anyway
+         ;; e.g. https://github.com/biocore/scikit-bio/issues/1308.  Run a
+         ;; simple import test instead.
+         (delete 'check)
+         (add-after 'install 'check-after-install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((pythonpath
+                    (string-append
+                     (getenv "PYTHONPATH")
+                     ":" (assoc-ref outputs "out")
+                     "/lib/python"
+                     (string-take (string-take-right
+                                   (assoc-ref inputs "python") 5) 3)
+                     "/site-packages")))
+               (setenv "PYTHONPATH" pythonpath)
+               (zero?
+                (with-directory-excursion "ci"
+                  (system*
+                   (string-append
+                    (assoc-ref inputs "python")
+                    "/bin/python")
+                   "-c"
+                   (string-append "import matplotlib; "
+                                  "matplotlib.use(\"Agg\"); "
+                                  "import skbio"))))))))))
+    (native-inputs
+     `(("python-nose" ,python-nose)
+       ("python-pep8" ,python-pep8)
+       ("python-flake8" ,python-flake8)
+       ("python-dateutil" ,python-dateutil-2)))
+    (propagated-inputs
+     `(("python-bz2file" ,python-bz2file)
+       ("python-lockfile" ,python-lockfile)
+       ("python-cachecontrol" ,python-cachecontrol)
+       ("python-contextlib2" ,python-contextlib2)
+       ("python-decorator" ,python-decorator)
+       ("python-future" ,python-future)
+       ("python-ipython" ,python-ipython)
+       ("python-matplotlib" ,python-matplotlib)
+       ("python-natsort" ,python-natsort)
+       ("python-numpy" ,python-numpy)
+       ("python-pandas" ,python-pandas)
+       ("python-scipy" ,python-scipy)
+       ("python-six" ,python-six)))
+    (home-page "http://scikit-bio.org")
+    (synopsis "Resources for bioinformatics")
+    (description
+     "Scikit-bio (canonically pronounced sigh-kit-buy-oh) is a library for
+working with biological data in Python, providing data structures, algorithms
+and educational resources.  It defines python packages for biological
+sequences, alignments, tree, visualisation, diversity calculation and File
+I/O.")
+    (license bsd-3)
+    (properties `((python2-variant . ,(delay python2-scikit-bio))))))
+
+(define-public python2-scikit-bio
+  (let ((base (package-with-python2
+               (strip-python2-variant python-scikit-bio))))
+    (package
+      (inherit base)
+      (native-inputs
+       (append (package-native-inputs base)
+               `(("python2-setuptools" ,python2-setuptools)
+                 ("python2-mock" ,python2-mock)))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH 10/10] gnu: Add python-scikit-bio.
  2016-04-21 13:22 ` [PATCH 10/10] gnu: Add python-scikit-bio Ben Woodcroft
@ 2016-04-21 15:04   ` Ricardo Wurmus
  2016-04-21 15:07   ` Ricardo Wurmus
  2016-04-21 15:09   ` Ricardo Wurmus
  2 siblings, 0 replies; 53+ messages in thread
From: Ricardo Wurmus @ 2016-04-21 15:04 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel


Hi Ben,

thanks for your patch.

> * gnu/packages/python.scm (python-scikit-bio,
> python2-scikit-bio): New variables.

I think this should be on one line.  In any case, breaking the line so
soon looks a bit weird.

> ---
>  gnu/packages/python.scm | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 91 insertions(+)
>
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index 7aae6fc..b359422 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -8945,6 +8945,97 @@ numbers (i.e. signed/unsigned floats or ints), or as versions.")
>                   ("python2-enum34" ,python2-enum34)
>                   ("python2-setuptools" ,python2-setuptools)))))))
>  
> +(define-public python-scikit-bio
> +  (package
> +    (name "python-scikit-bio")
> +    (version "0.4.2")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://pypi.python.org/packages/source/s/scikit-bio/scikit-bio-"
> +             version
> +             ".tar.gz"))
> +       (sha256
> +        (base32
> +         "06nrcgfz6c3jb2dnaf1wnvx3dyww94p454c4126gvcvfgv6scczy"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         ;; Install procedure installs extraneous binaries.
> +         (add-after 'install 'remove-extraneous-files
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin")))
> +               (delete-file-recursively bin))
> +             #t))
> +         ;; `setup.py test' does not run tests, but there are many test
> +         ;; failures anyway

What does it mean that “setup.py test” does not run tests?  Is there
another test target?

> +         ;; e.g. https://github.com/biocore/scikit-bio/issues/1308.  Run a
> +         ;; simple import test instead.
> +         (delete 'check)
> +         (add-after 'install 'check-after-install
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let ((pythonpath
> +                    (string-append
> +                     (getenv "PYTHONPATH")
> +                     ":" (assoc-ref outputs "out")
> +                     "/lib/python"
> +                     (string-take (string-take-right
> +                                   (assoc-ref inputs "python") 5) 3)
> +                     "/site-packages")))
> +               (setenv "PYTHONPATH" pythonpath)

I would not use a let here and replace “pythonpath” with the
“(string-append...)” for the new PYTHONPATH.

> +               (zero?
> +                (with-directory-excursion "ci"
> +                  (system*
> +                   (string-append
> +                    (assoc-ref inputs "python")
> +                    "/bin/python")

You can use “python” directly, or “(which "python")”.  The PATH should
include it at this point.

> +                   "-c"
> +                   (string-append "import matplotlib; "
> +                                  "matplotlib.use(\"Agg\"); "
> +                                  "import skbio"))))))))))
> +    (native-inputs
> +     `(("python-nose" ,python-nose)
> +       ("python-pep8" ,python-pep8)
> +       ("python-flake8" ,python-flake8)
> +       ("python-dateutil" ,python-dateutil-2)))
> +    (propagated-inputs
> +     `(("python-bz2file" ,python-bz2file)
> +       ("python-lockfile" ,python-lockfile)
> +       ("python-cachecontrol" ,python-cachecontrol)
> +       ("python-contextlib2" ,python-contextlib2)
> +       ("python-decorator" ,python-decorator)
> +       ("python-future" ,python-future)
> +       ("python-ipython" ,python-ipython)
> +       ("python-matplotlib" ,python-matplotlib)
> +       ("python-natsort" ,python-natsort)
> +       ("python-numpy" ,python-numpy)
> +       ("python-pandas" ,python-pandas)
> +       ("python-scipy" ,python-scipy)
> +       ("python-six" ,python-six)))
> +    (home-page "http://scikit-bio.org")
> +    (synopsis "Resources for bioinformatics")
> +    (description
> +     "Scikit-bio (canonically pronounced sigh-kit-buy-oh) is a library for
> +working with biological data in Python, providing data structures, algorithms
> +and educational resources.  It defines python packages for biological
> +sequences, alignments, tree, visualisation, diversity calculation and File
> +I/O.")

Please capitalise “python” throughout and replace “File” with “file”.
I’d also remove “(canonically pronounced sigh-kit-buy-oh)”.

> +    (license bsd-3)
> +    (properties `((python2-variant . ,(delay python2-scikit-bio))))))
> +
> +(define-public python2-scikit-bio
> +  (let ((base (package-with-python2
> +               (strip-python2-variant python-scikit-bio))))
> +    (package
> +      (inherit base)
> +      (native-inputs
> +       (append (package-native-inputs base)
> +               `(("python2-setuptools" ,python2-setuptools)
> +                 ("python2-mock" ,python2-mock)))))))
> +

Looks good to me.

~~ Ricardo

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 10/10] gnu: Add python-scikit-bio.
  2016-04-21 13:22 ` [PATCH 10/10] gnu: Add python-scikit-bio Ben Woodcroft
  2016-04-21 15:04   ` Ricardo Wurmus
@ 2016-04-21 15:07   ` Ricardo Wurmus
  2016-04-21 15:09   ` Ricardo Wurmus
  2 siblings, 0 replies; 53+ messages in thread
From: Ricardo Wurmus @ 2016-04-21 15:07 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel


Ben Woodcroft <donttrustben@gmail.com> writes:

> * gnu/packages/python.scm (python-scikit-bio,
> python2-scikit-bio): New variables.

One more thing: how about placing this in “bioinformatics.scm” instead?
“python.scm” is already so very big because it contains a lot of stuff
that just happens to be written in Python.

~~ Ricardo

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 09/10] gnu: Add python-natsort.
  2016-04-21 13:22 ` [PATCH 09/10] gnu: Add python-natsort Ben Woodcroft
@ 2016-04-21 15:09   ` Ricardo Wurmus
  0 siblings, 0 replies; 53+ messages in thread
From: Ricardo Wurmus @ 2016-04-21 15:09 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel


Ben Woodcroft <donttrustben@gmail.com> writes:

> * gnu/packages/python.scm (python-natsort, python2-natsort): New
> variables.
> ---
>  gnu/packages/python.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index ea9f47a..7aae6fc 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -8901,6 +8901,50 @@ The same is true of requests in terms of caching.")
>        (inherit base)
>        (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
>  
> +(define-public python-natsort
> +  (package
> +    (name "python-natsort")
> +    (version "4.0.4")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://pypi.python.org/packages/source/n/natsort/natsort-"
> +             version
> +             ".tar.gz"))

Could you use “(pypi-uri "natsort" version)” instead?

> +       (sha256
> +        (base32
> +         "0f8q66pyczgy1cm3nh8rkh7hgl9h49zx9r06mivg4y5sbzla6sy7"))))
> +    (build-system python-build-system)
> +    (native-inputs
> +     `(("python-pytest" ,python-pytest)
> +       ("python-pytest-flakes" ,python-pytest-flakes)
> +       ("python-pytest-cov" ,python-pytest-cov)
> +       ("python-pytest-cache" ,python-pytest-cache)
> +       ("python-hypothesis" ,python-hypothesis)
> +       ("python-pytest-pep8", python-pytest-pep8)))
> +    (home-page "https://github.com/SethMMorton/natsort")
> +    (synopsis "Sort lists naturally")
> +    (description "When you try to sort a list of strings that contain numbers,
> +the normal python sort algorithm sorts lexicographically, so you might not get
> +the results that you expect.  @code{natsort} provides a function
> +@code{natsorted} that helps sort lists 'naturally', either as real
> +numbers (i.e. signed/unsigned floats or ints), or as versions.")
> +    (license license:expat)
> +    (properties `((python2-variant . ,(delay python2-natsort))))))
> +
> +(define-public python2-natsort
> +  (let ((base (package-with-python2
> +               (strip-python2-variant python-natsort))))
> +    (package
> +      (inherit base)
> +      (native-inputs
> +       (append (package-native-inputs base)
> +               `(("python2-mock" ,python2-mock)
> +                 ("python2-pathlib" ,python2-pathlib)
> +                 ("python2-enum34" ,python2-enum34)
> +                 ("python2-setuptools" ,python2-setuptools)))))))
> +
>  (define-public python-cysignals
>    (package
>      (name "python-cysignals")

The rest looks fine to me.

~~ Ricardo

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 10/10] gnu: Add python-scikit-bio.
  2016-04-21 13:22 ` [PATCH 10/10] gnu: Add python-scikit-bio Ben Woodcroft
  2016-04-21 15:04   ` Ricardo Wurmus
  2016-04-21 15:07   ` Ricardo Wurmus
@ 2016-04-21 15:09   ` Ricardo Wurmus
  2 siblings, 0 replies; 53+ messages in thread
From: Ricardo Wurmus @ 2016-04-21 15:09 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel


Ben Woodcroft <donttrustben@gmail.com> writes:

> * gnu/packages/python.scm (python-scikit-bio,
> python2-scikit-bio): New variables.
> ---
>  gnu/packages/python.scm | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 91 insertions(+)
>
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index 7aae6fc..b359422 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -8945,6 +8945,97 @@ numbers (i.e. signed/unsigned floats or ints), or as versions.")
>                   ("python2-enum34" ,python2-enum34)
>                   ("python2-setuptools" ,python2-setuptools)))))))
>  
> +(define-public python-scikit-bio
> +  (package
> +    (name "python-scikit-bio")
> +    (version "0.4.2")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://pypi.python.org/packages/source/s/scikit-bio/scikit-bio-"
> +             version
> +             ".tar.gz"))

Here, too: please use “(pypi-uri...)” if possible.

~~ Ricardo

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 08/10] gnu: python-ipython: Use 'python2-variant'.
  2016-04-21 13:21 ` [PATCH 08/10] gnu: python-ipython: " Ben Woodcroft
@ 2016-04-21 15:14   ` Ricardo Wurmus
  2016-04-24 13:11     ` Ben Woodcroft
  2016-04-24 13:12     ` Ben Woodcroft
  0 siblings, 2 replies; 53+ messages in thread
From: Ricardo Wurmus @ 2016-04-21 15:14 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel


Ben Woodcroft <donttrustben@gmail.com> writes:

> * gnu/packages/python.scm (python-ipython)[properties]: New field.
> (python2-ipython): Use 'strip-python2-variant'.

The commit message should mention the changes to the “inputs” and
“propagated-input” fields because it isn’t obvious whether the list of
inputs actually stays the same.

~~ Ricardo

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 02/10] gnu: Add python-bz2file.
  2016-04-21 13:21 ` [PATCH 02/10] gnu: Add python-bz2file Ben Woodcroft
@ 2016-04-21 15:43   ` Efraim Flashner
  2016-04-21 18:24   ` Hartmut Goebel
  1 sibling, 0 replies; 53+ messages in thread
From: Efraim Flashner @ 2016-04-21 15:43 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 2568 bytes --]

On Thu, Apr 21, 2016 at 11:21:53PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-bz2file, python2-bz2file): New
> variables.
> ---
>  gnu/packages/python.scm | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index ecd16c5..9c3a9fd 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -8677,6 +8677,46 @@ LDFLAGS and parse the output to build extensions with setup.py.")
>  (define-public python2-pkgconfig
>    (package-with-python2 python-pkgconfig))
>  
> +(define-public python-bz2file
> +  (package
> +    (name "python-bz2file")
> +    (version "0.98")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://pypi.python.org/packages/source/b/bz2file/bz2file-"
> +             version
> +             ".tar.gz"))

(uri (pypi-uri "bz2file" version))

> +       (sha256
> +        (base32
> +         "126s53fkpx04f33a829yqqk8fj4png3qwg4m66cvlmhmwc8zihb4"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         ;; python setup.py test does not work as of 0.98
> +         ;; but there is only the one test file
> +         (replace 'check
> +           (lambda _ (zero? (system* "python" "test_bz2file.py")))))))
> +    (home-page "https://github.com/nvawda/bz2file")
> +    (synopsis "Read and write bzip2-compressed files")
> +    (description
> +     "Bz2file is a Python library for reading and writing bzip2-compressed
> +files.  It contains a drop-in replacement for the file interface in the
> +standard library's bz2 module, including features from the latest development
> +version of CPython that are not available in older releases.")
> +    (license asl2.0)
> +    (properties `((python2-variant . ,(delay python2-bz2file))))))
> +
> +(define-public python2-bz2file
> +  (let ((base (package-with-python2
> +               (strip-python2-variant python-bz2file))))
> +    (package
> +      (inherit base)
> +      (native-inputs
> +       `(("python2-setuptools" ,python2-setuptools))))))
> +
>  (define-public python-cysignals
>    (package
>      (name "python-cysignals")
> -- 
> 2.5.0
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 02/10] gnu: Add python-bz2file.
  2016-04-21 13:21 ` [PATCH 02/10] gnu: Add python-bz2file Ben Woodcroft
  2016-04-21 15:43   ` Efraim Flashner
@ 2016-04-21 18:24   ` Hartmut Goebel
  2016-04-24 13:17     ` Ben Woodcroft
  1 sibling, 1 reply; 53+ messages in thread
From: Hartmut Goebel @ 2016-04-21 18:24 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1167 bytes --]

Am 21.04.2016 um 15:21 schrieb Ben Woodcroft:
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         ;; python setup.py test does not work as of 0.98
> +         ;; but there is only the one test file
> +         (replace 'check
> +           (lambda _ (zero? (system* "python" "test_bz2file.py")))))))

I wonder if this is actually working. The python-3 package does not
include "python" (except if this was changed the last days).

> +    (description
> +     "Bz2file is a Python library for reading and writing bzip2-compressed
> +files.  It contains a drop-in replacement for the file interface in the

I do not understand "replacement for the file interface". If this like
the "zipfile" module?


-- 
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software
Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/feiertagsarbeit-bei-teletrust
Kolumne:
http://www.cissp-gefluester.de/2012-09-steht-ein-manta-fahrer-vor-der-uni


[-- Attachment #1.2: Type: text/html, Size: 2631 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2430 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 03/10] gnu: Add python-pytest-pep8.
  2016-04-21 13:21 ` [PATCH 03/10] gnu: Add python-pytest-pep8 Ben Woodcroft
@ 2016-04-21 18:26   ` Hartmut Goebel
  2016-04-24 13:21     ` Ben Woodcroft
  0 siblings, 1 reply; 53+ messages in thread
From: Hartmut Goebel @ 2016-04-21 18:26 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1377 bytes --]

Am 21.04.2016 um 15:21 schrieb Ben Woodcroft:
> +         (add-after 'install 'post-install-check
> +           ;; 'setup.py test' does not run tests
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let ((out (assoc-ref outputs "out")))
> +               (setenv "PYTHONPATH"
> +                       (string-append
> +                        (getenv "PYTHONPATH")
> +                        ":"
> +                        out
> +                        "/lib/python"
> +                        (string-take (string-take-right
> +                                      (assoc-ref inputs "python") 5) 3)
> +                        "/site-packages"))
> +               (zero?
> +                (system*
> +                 (string-append out "/bin/py.test") "test_pep8.py"))))))))

Have you tried if the tests are run when moving the test-file into a new
subdirectory "tests/"? This would result in much less code.

-- 
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software
Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/feiertagsarbeit-bei-teletrust
Kolumne:
http://www.cissp-gefluester.de/2012-09-steht-ein-manta-fahrer-vor-der-uni


[-- Attachment #1.2: Type: text/html, Size: 2512 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2430 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 04/10] gnu: Add python-pytest-flakes.
  2016-04-21 13:21 ` [PATCH 04/10] gnu: Add python-pytest-flakes Ben Woodcroft
@ 2016-04-21 18:26   ` Hartmut Goebel
  0 siblings, 0 replies; 53+ messages in thread
From: Hartmut Goebel @ 2016-04-21 18:26 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1443 bytes --]

Am 21.04.2016 um 15:21 schrieb Ben Woodcroft:
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'install 'post-install-check
> +           ;; 'setup.py test' does not run tests
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let ((out (assoc-ref outputs "out")))
> +               (setenv "PYTHONPATH"
> +                       (string-append
> +                        (getenv "PYTHONPATH")
> +                        ":"
> +                        out
> +                        "/lib/python"
> +                        (string-take (string-take-right
> +                                      (assoc-ref inputs "python") 5) 3)
> +                        "/site-packages"))
> +               (zero?
> +                (system*
> +                 "py.test" "test_flakes.py"))))))))

Again: Have you tried if the tests are run when moving the test-file
into a new subdirectory "tests/"? This would result in much less code.

-- 
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software
Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/feiertagsarbeit-bei-teletrust
Kolumne:
http://www.cissp-gefluester.de/2012-09-steht-ein-manta-fahrer-vor-der-uni


[-- Attachment #1.2: Type: text/html, Size: 2577 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2430 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 2/2] gnu: Add python-scikit-bio.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (9 preceding siblings ...)
  2016-04-21 13:22 ` [PATCH 10/10] gnu: Add python-scikit-bio Ben Woodcroft
@ 2016-04-24 13:01 ` Ben Woodcroft
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
  11 siblings, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:01 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-scikit-bio, python2-scikit-bio):
New variables.
---
 gnu/packages/bioinformatics.scm | 84 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 899ce1c..fa67f3b 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -3339,6 +3339,90 @@ optimize the sequencing depth, or to screen multiple libraries to avoid low
 complexity samples.")
     (license license:gpl3+)))
 
+(define-public python-scikit-bio
+  (package
+    (name "python-scikit-bio")
+    (version "0.4.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "scikit-bio" version))
+       (sha256
+        (base32
+         "06nrcgfz6c3jb2dnaf1wnvx3dyww94p454c4126gvcvfgv6scczy"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Install procedure installs extraneous binaries.
+         (add-after 'install 'remove-extraneous-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (delete-file-recursively bin))
+             #t))
+         ;; Tests are intended to be run using 'make test' not 'setup.py
+         ;; test', but there are many test failures anyway
+         ;; e.g. https://github.com/biocore/scikit-bio/issues/1308.  Run a
+         ;; simple import test instead.
+         (delete 'check)
+         (add-after 'install 'check-after-install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "PYTHONPATH"
+                     (string-append
+                      (getenv "PYTHONPATH")
+                      ":" (assoc-ref outputs "out")
+                      "/lib/python"
+                      (string-take (string-take-right
+                                    (assoc-ref inputs "python") 5) 3)
+                      "/site-packages"))
+             (zero?
+              (with-directory-excursion "ci"
+                (system*
+                 "python"
+                 "-c"
+                 (string-append "import matplotlib; "
+                                "matplotlib.use(\"Agg\"); "
+                                "import skbio")))))))))
+    (native-inputs
+     `(("python-nose" ,python-nose)
+       ("python-pep8" ,python-pep8)
+       ("python-flake8" ,python-flake8)
+       ("python-dateutil" ,python-dateutil-2)))
+    (propagated-inputs
+     `(("python-bz2file" ,python-bz2file)
+       ("python-lockfile" ,python-lockfile)
+       ("python-cachecontrol" ,python-cachecontrol)
+       ("python-contextlib2" ,python-contextlib2)
+       ("python-decorator" ,python-decorator)
+       ("python-future" ,python-future)
+       ("python-ipython" ,python-ipython)
+       ("python-matplotlib" ,python-matplotlib)
+       ("python-natsort" ,python-natsort)
+       ("python-numpy" ,python-numpy)
+       ("python-pandas" ,python-pandas)
+       ("python-scipy" ,python-scipy)
+       ("python-six" ,python-six)))
+    (home-page "http://scikit-bio.org")
+    (synopsis "Resources for bioinformatics")
+    (description
+     "Scikit-bio is a library for working with biological data in Python,
+providing data structures, algorithms and educational resources.  It defines
+Python packages for biological sequences, alignments, tree, visualisation,
+diversity calculation and file I/O.")
+    (license license:bsd-3)
+    (properties `((python2-variant . ,(delay python2-scikit-bio))))))
+
+(define-public python2-scikit-bio
+  (let ((base (package-with-python2
+               (strip-python2-variant python-scikit-bio))))
+    (package
+      (inherit base)
+      (native-inputs
+       (append (package-native-inputs base)
+               `(("python2-setuptools" ,python2-setuptools)
+                 ("python2-mock" ,python2-mock)))))))
+
 (define-public sra-tools
   (package
     (name "sra-tools")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2] Add python-scikit-bio.
  2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
                   ` (10 preceding siblings ...)
  2016-04-24 13:01 ` [PATCH 2/2] " Ben Woodcroft
@ 2016-04-24 13:06 ` Ben Woodcroft
  2016-04-24 13:06   ` [PATCH v2 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
                     ` (9 more replies)
  11 siblings, 10 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

Apologies, still trying to get used to git send-email; please ignore the 2
patches just sent separate to this iteration.

Thanks,
ben

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 01/10] gnu: Add python2-pytest-cache.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:22     ` Leo Famulari
  2016-04-24 13:06   ` [PATCH v2 02/10] gnu: Add python-bz2file Ben Woodcroft
                     ` (8 subsequent siblings)
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-pytest-cache)[properties]: New field.
(python2-pytest-cache): New variable.
---
 gnu/packages/python.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0379352..ecd16c5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2015, 2016 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2015 Ben Woodcroft <donttrustben@gmail.com>
+;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2015, 2016 Erik Edrosa <erik.edrosa@gmail.com>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Kyle Meyer <kyle@kyleam.com>
@@ -6965,7 +6965,17 @@ minimal and fast API targetting the following uses:
     (description "The pytest-cache plugin provides tools to rerun failures from
 the last py.test invocation.")
     (home-page "https://bitbucket.org/hpk42/pytest-cache/")
-    (license license:expat)))
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-pytest-cache))))))
+
+(define-public python2-pytest-cache
+  (let ((base (package-with-python2
+                  (strip-python2-variant python-pytest-cache))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ,@(package-native-inputs base))))))
 
 (define-public python-pytest-localserver
   (package
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 02/10] gnu: Add python-bz2file.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
  2016-04-24 13:06   ` [PATCH v2 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:27     ` Leo Famulari
  2016-04-24 13:06   ` [PATCH v2 03/10] gnu: Add python-pytest-pep8 Ben Woodcroft
                     ` (7 subsequent siblings)
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-bz2file, python2-bz2file): New
variables.
---
 gnu/packages/python.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ecd16c5..c07dae6 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8677,6 +8677,43 @@ LDFLAGS and parse the output to build extensions with setup.py.")
 (define-public python2-pkgconfig
   (package-with-python2 python-pkgconfig))
 
+(define-public python-bz2file
+  (package
+    (name "python-bz2file")
+    (version "0.98")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "bz2file" version))
+       (sha256
+        (base32
+         "126s53fkpx04f33a829yqqk8fj4png3qwg4m66cvlmhmwc8zihb4"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; python setup.py test does not work as of 0.98
+         ;; but there is only the one test file
+         (replace 'check
+           (lambda _ (zero? (system* "python" "test_bz2file.py")))))))
+    (home-page "https://github.com/nvawda/bz2file")
+    (synopsis "Read and write bzip2-compressed files")
+    (description
+     "Bz2file is a Python library for reading and writing bzip2-compressed
+files.  It contains a drop-in replacement for the I/O interface in the
+standard library's @code{bz2} module, including features from the latest
+development version of CPython that are not available in older releases.")
+    (license asl2.0)
+    (properties `((python2-variant . ,(delay python2-bz2file))))))
+
+(define-public python2-bz2file
+  (let ((base (package-with-python2
+               (strip-python2-variant python-bz2file))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 03/10] gnu: Add python-pytest-pep8.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
  2016-04-24 13:06   ` [PATCH v2 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
  2016-04-24 13:06   ` [PATCH v2 02/10] gnu: Add python-bz2file Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-24 17:04     ` Efraim Flashner
  2016-04-24 13:06   ` [PATCH v2 04/10] gnu: Add python-pytest-flakes Ben Woodcroft
                     ` (6 subsequent siblings)
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-pytest-pep8, python2-pytest-pep8): New
variables.
---
 gnu/packages/python.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index c07dae6..b1a4969 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8714,6 +8714,66 @@ development version of CPython that are not available in older releases.")
       (native-inputs
        `(("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-pytest-pep8
+  (package
+    (name "python-pytest-pep8")
+    (version "1.0.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-pep8" version))
+       (sha256
+        (base32
+         "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'remove-failing-test
+           ;; Ignore the known test failure.
+           ;; https://bitbucket.org/pytest-dev/pytest-pep8/issues/8/test-failure
+           (lambda _
+             (substitute* "test_pep8.py"
+               (("^def test_ok_verbose") "def dont_run"))
+             #t))
+         (add-after 'install 'post-install-check
+           ;; 'setup.py test' does not run tests
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "PYTHONPATH"
+                       (string-append
+                        (getenv "PYTHONPATH")
+                        ":"
+                        out
+                        "/lib/python"
+                        (string-take (string-take-right
+                                      (assoc-ref inputs "python") 5) 3)
+                        "/site-packages"))
+               (zero?
+                (system*
+                 (string-append out "/bin/py.test") "test_pep8.py"))))))))
+    (propagated-inputs
+     `(("python-pytest-cache", python-pytest-cache)
+       ("python-pytest" ,python-pytest)
+       ("python-pep8" ,python-pep8)))
+    (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
+    (synopsis "Pytest plugin to check PEP8 requirements")
+    (description
+     "Pytest-pep8 is a py.test plugin for efficiently checking compliance to
+the PEP8 style guide.  If you type @code{py.test --pep8} every file ending in
+@code{.py} will be discovered and PEP8-checked, starting from the command line
+arguments.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-pytest-pep8))))))
+
+(define-public python2-pytest-pep8
+  (let ((base (package-with-python2
+               (strip-python2-variant python-pytest-pep8))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 04/10] gnu: Add python-pytest-flakes.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
                     ` (2 preceding siblings ...)
  2016-04-24 13:06   ` [PATCH v2 03/10] gnu: Add python-pytest-pep8 Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:34     ` Leo Famulari
  2016-04-24 13:06   ` [PATCH v2 05/10] gnu: Add python-future Ben Woodcroft
                     ` (5 subsequent siblings)
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-pytest-flakes,
python2-pytest-flakes): New variables.
---
 gnu/packages/python.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b1a4969..4175fad 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8774,6 +8774,51 @@ arguments.")
       (native-inputs
        `(("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-pytest-flakes
+  (package
+    (name "python-pytest-flakes")
+    (version "1.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-flakes" version))
+       (sha256
+        (base32
+         "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'post-install-check
+           ;; 'setup.py test' does not run tests
+           (lambda _
+             (zero? (system* "py.test" "test_flakes.py")))))))
+    (native-inputs
+     `(("python-pytest-pep8" ,python-pytest-pep8)))
+    (propagated-inputs
+     `(("python-pytest-cache" ,python-pytest-cache)
+       ("python-pytest" ,python-pytest)
+       ("python-pyflakes" ,python-pyflakes)))
+    (home-page
+     "https://github.com/fschulze/pytest-flakes")
+    (synopsis "Pytest plugin to check source code with pyflakes")
+    (description
+     "Pytest-pyflakes is a py.test plugin for efficiently checking python source
+with pyflakes.  If you type @code{py.test --flakes} every file ending in
+@code{.py} will be discovered and run through pyflakes, starting from the
+command line arguments.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-pytest-flakes))))))
+
+(define-public python2-pytest-flakes
+  (let ((base (package-with-python2
+                 (strip-python2-variant python-pytest-flakes))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(,@(package-native-inputs base)
+         ("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 05/10] gnu: Add python-future.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
                     ` (3 preceding siblings ...)
  2016-04-24 13:06   ` [PATCH v2 04/10] gnu: Add python-pytest-flakes Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:30     ` Leo Famulari
  2016-04-24 13:06   ` [PATCH v2 06/10] gnu: Add python-cachecontrol Ben Woodcroft
                     ` (4 subsequent siblings)
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-future, python2-future): New
variables.
---
 gnu/packages/python.scm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 4175fad..28eebf1 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8812,13 +8812,43 @@ command line arguments.")
 
 (define-public python2-pytest-flakes
   (let ((base (package-with-python2
-                 (strip-python2-variant python-pytest-flakes))))
+               (strip-python2-variant python-pytest-flakes))))
     (package
       (inherit base)
       (native-inputs
        `(,@(package-native-inputs base)
          ("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-future
+  (package
+    (name "python-future")
+    (version "0.15.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "future" version))
+       (sha256
+        (base32
+         "15wvcfzssc68xqnqi1dq4fhd0848hwi9jn42hxyvlqna40zijfrx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f)) ; Tests connect to the network
+    (home-page "http://python-future.org")
+    (synopsis "Single-source support for Python 3 and 2")
+    (description
+     "@code{python-future} is the missing compatibility layer between Python 2 and
+Python 3.  It allows you to use a single, clean Python 3.x-compatible codebase
+to support both Python 2 and Python 3 with minimal overhead.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-future))))))
+
+(define-public python2-future
+  (let ((base (package-with-python2
+               (strip-python2-variant python-future))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 06/10] gnu: Add python-cachecontrol.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
                     ` (4 preceding siblings ...)
  2016-04-24 13:06   ` [PATCH v2 05/10] gnu: Add python-future Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:35     ` Leo Famulari
  2016-04-24 13:06   ` [PATCH v2 07/10] gnu: python-tornado: Use 'python2-variant' Ben Woodcroft
                     ` (3 subsequent siblings)
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-cachecontrol, python2-cachecontrol):
New variables.
---
 gnu/packages/python.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 28eebf1..ccd4a28 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8849,6 +8849,37 @@ to support both Python 2 and Python 3 with minimal overhead.")
       (inherit base)
       (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-cachecontrol
+  (package
+    (name "python-cachecontrol")
+    (version "0.11.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "CacheControl" version))
+       (sha256
+        (base32
+         "15bn8xll6z15h0zqhfjy1n8dn8p0fcb4m0rhnfanq63z7r2wpprp"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-requests" ,python-requests)
+       ("python-lockfile" ,python-lockfile)))
+    (home-page "https://github.com/ionrock/cachecontrol")
+    (synopsis "httplib2 caching for requests")
+    (description "CacheControl is a port of the caching algorithms in httplib2
+for use with requests session object.  It was written because httplib2's
+better support for caching is often mitigated by its lack of threadsafety.
+The same is true of requests in terms of caching.")
+    (license asl2.0)
+    (properties `((python2-variant . ,(delay python2-cachecontrol))))))
+
+(define-public python2-cachecontrol
+  (let ((base (package-with-python2
+               (strip-python2-variant python-cachecontrol))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 07/10] gnu: python-tornado: Use 'python2-variant'.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
                     ` (5 preceding siblings ...)
  2016-04-24 13:06   ` [PATCH v2 06/10] gnu: Add python-cachecontrol Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:36     ` Leo Famulari
  2016-04-24 13:06   ` [PATCH v2 08/10] gnu: python-ipython: " Ben Woodcroft
                     ` (2 subsequent siblings)
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-tornado)[properties]: New field.
(python2-tornado): Build with 'strip-python2-variant'.
---
 gnu/packages/python.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ccd4a28..ee2cab8 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -4936,10 +4936,12 @@ originally developed at FriendFeed.  By using non-blocking network I/O,
 Tornado can scale to tens of thousands of open connections, making it ideal
 for long polling, WebSockets, and other applications that require a long-lived
 connection to each user.")
-    (license asl2.0)))
+    (license asl2.0)
+    (properties `((python2-variant . ,(delay python2-tornado))))))
 
 (define-public python2-tornado
-  (let ((tornado (package-with-python2 python-tornado)))
+  (let ((tornado (package-with-python2
+                  (strip-python2-variant python-tornado))))
     (package (inherit tornado)
       (inputs
        `(("python2-backport-ssl-match-hostname"
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 08/10] gnu: python-ipython: Use 'python2-variant'.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
                     ` (6 preceding siblings ...)
  2016-04-24 13:06   ` [PATCH v2 07/10] gnu: python-tornado: Use 'python2-variant' Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:48     ` Leo Famulari
  2016-04-24 13:06   ` [PATCH v2 09/10] gnu: Add python-natsort Ben Woodcroft
  2016-04-24 13:06   ` [PATCH v2 10/10] gnu: Add python-scikit-bio Ben Woodcroft
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-ipython)[properties]: New field.
(python2-ipython): Use 'strip-python2-variant'.
[inputs, propagated-inputs]: Do not redefine inherited values.
---
 gnu/packages/python.scm | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ee2cab8..40d28b1 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -4359,29 +4359,21 @@ without using the configuration machinery.")
 Powerful interactive shells, a browser-based notebook, support for interactive
 data visualization, embeddable interpreters and tools for parallel
 computing.")
-    (license bsd-3)))
+    (license bsd-3)
+    (properties `((python2-variant . ,(delay python2-ipython))))))
 
 (define-public python2-ipython
-  (let ((ipython (package-with-python2 python-ipython)))
+  (let ((base (package-with-python2
+               (strip-python2-variant python-ipython))))
     (package
-      (inherit ipython)
+      (inherit base)
       ;; FIXME: some tests are failing
-      (arguments
-       `(#:tests? #f ,@(package-arguments ipython)))
-      ;; Make sure we use custom python2-NAME packages.
       ;; FIXME: add pyreadline once available.
-      (propagated-inputs
-       `(("python2-terminado" ,python2-terminado)
-         ,@(alist-delete "python-terminado"
-                         (package-propagated-inputs ipython))))
+      (arguments
+       `(#:tests? #f ,@(package-arguments base)))
       (inputs
-       `(("python2-jsonschema" ,python2-jsonschema)
-         ("python2-mock" ,python2-mock)
-         ("python2-matplotlib" ,python2-matplotlib)
-         ("python2-numpy" ,python2-numpy)
-         ("python2-requests" ,python2-requests)
-         ,@(fold alist-delete (package-inputs ipython)
-                 '("python-jsonschema" "python-matplotlib" "python-numpy" "python-requests")))))))
+       `(("python2-mock" ,python2-mock)
+         ,@(package-inputs base))))))
 
 (define-public python-isodate
   (package
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 09/10] gnu: Add python-natsort.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
                     ` (7 preceding siblings ...)
  2016-04-24 13:06   ` [PATCH v2 08/10] gnu: python-ipython: " Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:41     ` Leo Famulari
  2016-04-24 13:06   ` [PATCH v2 10/10] gnu: Add python-scikit-bio Ben Woodcroft
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-natsort, python2-natsort): New
variables.
---
 gnu/packages/python.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 40d28b1..8ae7566 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8874,6 +8874,47 @@ The same is true of requests in terms of caching.")
       (inherit base)
       (native-inputs `(("python2-setuptools" ,python2-setuptools))))))
 
+(define-public python-natsort
+  (package
+    (name "python-natsort")
+    (version "4.0.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "natsort" version))
+       (sha256
+        (base32
+         "0f8q66pyczgy1cm3nh8rkh7hgl9h49zx9r06mivg4y5sbzla6sy7"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-flakes" ,python-pytest-flakes)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-cache" ,python-pytest-cache)
+       ("python-hypothesis" ,python-hypothesis)
+       ("python-pytest-pep8", python-pytest-pep8)))
+    (home-page "https://github.com/SethMMorton/natsort")
+    (synopsis "Sort lists naturally")
+    (description "When you try to sort a list of strings that contain numbers,
+the normal python sort algorithm sorts lexicographically, so you might not get
+the results that you expect.  @code{natsort} provides a function
+@code{natsorted} that helps sort lists 'naturally', either as real
+numbers (i.e. signed/unsigned floats or ints), or as versions.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-natsort))))))
+
+(define-public python2-natsort
+  (let ((base (package-with-python2
+               (strip-python2-variant python-natsort))))
+    (package
+      (inherit base)
+      (native-inputs
+       (append (package-native-inputs base)
+               `(("python2-mock" ,python2-mock)
+                 ("python2-pathlib" ,python2-pathlib)
+                 ("python2-enum34" ,python2-enum34)
+                 ("python2-setuptools" ,python2-setuptools)))))))
+
 (define-public python-cysignals
   (package
     (name "python-cysignals")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 10/10] gnu: Add python-scikit-bio.
  2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
                     ` (8 preceding siblings ...)
  2016-04-24 13:06   ` [PATCH v2 09/10] gnu: Add python-natsort Ben Woodcroft
@ 2016-04-24 13:06   ` Ben Woodcroft
  2016-04-25 18:47     ` Leo Famulari
  9 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:06 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/python.scm (python-scikit-bio, python2-scikit-bio):
New variables.
---
 gnu/packages/bioinformatics.scm | 84 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 899ce1c..fa67f3b 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -3339,6 +3339,90 @@ optimize the sequencing depth, or to screen multiple libraries to avoid low
 complexity samples.")
     (license license:gpl3+)))
 
+(define-public python-scikit-bio
+  (package
+    (name "python-scikit-bio")
+    (version "0.4.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "scikit-bio" version))
+       (sha256
+        (base32
+         "06nrcgfz6c3jb2dnaf1wnvx3dyww94p454c4126gvcvfgv6scczy"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Install procedure installs extraneous binaries.
+         (add-after 'install 'remove-extraneous-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (delete-file-recursively bin))
+             #t))
+         ;; Tests are intended to be run using 'make test' not 'setup.py
+         ;; test', but there are many test failures anyway
+         ;; e.g. https://github.com/biocore/scikit-bio/issues/1308.  Run a
+         ;; simple import test instead.
+         (delete 'check)
+         (add-after 'install 'check-after-install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "PYTHONPATH"
+                     (string-append
+                      (getenv "PYTHONPATH")
+                      ":" (assoc-ref outputs "out")
+                      "/lib/python"
+                      (string-take (string-take-right
+                                    (assoc-ref inputs "python") 5) 3)
+                      "/site-packages"))
+             (zero?
+              (with-directory-excursion "ci"
+                (system*
+                 "python"
+                 "-c"
+                 (string-append "import matplotlib; "
+                                "matplotlib.use(\"Agg\"); "
+                                "import skbio")))))))))
+    (native-inputs
+     `(("python-nose" ,python-nose)
+       ("python-pep8" ,python-pep8)
+       ("python-flake8" ,python-flake8)
+       ("python-dateutil" ,python-dateutil-2)))
+    (propagated-inputs
+     `(("python-bz2file" ,python-bz2file)
+       ("python-lockfile" ,python-lockfile)
+       ("python-cachecontrol" ,python-cachecontrol)
+       ("python-contextlib2" ,python-contextlib2)
+       ("python-decorator" ,python-decorator)
+       ("python-future" ,python-future)
+       ("python-ipython" ,python-ipython)
+       ("python-matplotlib" ,python-matplotlib)
+       ("python-natsort" ,python-natsort)
+       ("python-numpy" ,python-numpy)
+       ("python-pandas" ,python-pandas)
+       ("python-scipy" ,python-scipy)
+       ("python-six" ,python-six)))
+    (home-page "http://scikit-bio.org")
+    (synopsis "Resources for bioinformatics")
+    (description
+     "Scikit-bio is a library for working with biological data in Python,
+providing data structures, algorithms and educational resources.  It defines
+Python packages for biological sequences, alignments, tree, visualisation,
+diversity calculation and file I/O.")
+    (license license:bsd-3)
+    (properties `((python2-variant . ,(delay python2-scikit-bio))))))
+
+(define-public python2-scikit-bio
+  (let ((base (package-with-python2
+               (strip-python2-variant python-scikit-bio))))
+    (package
+      (inherit base)
+      (native-inputs
+       (append (package-native-inputs base)
+               `(("python2-setuptools" ,python2-setuptools)
+                 ("python2-mock" ,python2-mock)))))))
+
 (define-public sra-tools
   (package
     (name "sra-tools")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH 08/10] gnu: python-ipython: Use 'python2-variant'.
  2016-04-21 15:14   ` Ricardo Wurmus
@ 2016-04-24 13:11     ` Ben Woodcroft
  2016-04-24 13:12     ` Ben Woodcroft
  1 sibling, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:11 UTC (permalink / raw)
  To: Ricardo Wurmus, Ben Woodcroft; +Cc: Guix-devel



On 22/04/16 01:14, Ricardo Wurmus wrote:
> Ben Woodcroft <donttrustben@gmail.com> writes:
>
>> * gnu/packages/python.scm (python-ipython)[properties]: New field.
>> (python2-ipython): Use 'strip-python2-variant'.
> The commit message should mention the changes to the “inputs” and
> “propagated-input” fields because it isn’t obvious whether the list of
> inputs actually stays the same.

I still struggle with commit messages, does this sound OK as it is in v2?

     gnu: python-ipython: Use 'python2-variant'.

     * gnu/packages/python.scm (python-ipython)[properties]: New field.
     (python2-ipython): Use 'strip-python2-variant'.
     [inputs, propagated-inputs]: Do not redefine inherited values.

Thanks,
ben

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 08/10] gnu: python-ipython: Use 'python2-variant'.
  2016-04-21 15:14   ` Ricardo Wurmus
  2016-04-24 13:11     ` Ben Woodcroft
@ 2016-04-24 13:12     ` Ben Woodcroft
  1 sibling, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:12 UTC (permalink / raw)
  To: Ricardo Wurmus, Ben Woodcroft; +Cc: Guix-devel



On 22/04/16 01:14, Ricardo Wurmus wrote:
> Ben Woodcroft <donttrustben@gmail.com> writes:
>
>> * gnu/packages/python.scm (python-ipython)[properties]: New field.
>> (python2-ipython): Use 'strip-python2-variant'.
> The commit message should mention the changes to the “inputs” and
> “propagated-input” fields because it isn’t obvious whether the list of
> inputs actually stays the same.

I still struggle with commit messages, does this sound OK as it is in v2?

     gnu: python-ipython: Use 'python2-variant'.

     * gnu/packages/python.scm (python-ipython)[properties]: New field.
     (python2-ipython): Use 'strip-python2-variant'.
     [inputs, propagated-inputs]: Do not redefine inherited values.

Thanks,
ben

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 02/10] gnu: Add python-bz2file.
  2016-04-21 18:24   ` Hartmut Goebel
@ 2016-04-24 13:17     ` Ben Woodcroft
  0 siblings, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:17 UTC (permalink / raw)
  To: Hartmut Goebel, guix-devel

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

Hi Hartmut,

Thanks for your comments.

On 22/04/16 04:24, Hartmut Goebel wrote:
> Am 21.04.2016 um 15:21 schrieb Ben Woodcroft:
>> +    (arguments
>> +     `(#:phases
>> +       (modify-phases %standard-phases
>> +         ;; python setup.py test does not work as of 0.98
>> +         ;; but there is only the one test file
>> +         (replace 'check
>> +           (lambda _ (zero? (system* "python" "test_bz2file.py")))))))
>
> I wonder if this is actually working. The python-3 package does not 
> include "python" (except if this was changed the last days).

As I understand, python-wrapper, which provides python as a symlink to 
python3, as a native input. And, it works.

>> +    (description
>> +     "Bz2file is a Python library for reading and writing bzip2-compressed
>> +files.  It contains a drop-in replacement for the file interface in the
>
> I do not understand "replacement for the file interface". If this like 
> the "zipfile" module? 

Better now?

     (description
      "Bz2file is a Python library for reading and writing bzip2-compressed
files.  It contains a drop-in replacement for the I/O interface in the
standard library's @code{bz2} module, including features from the latest
development version of CPython that are not available in older releases.")


ta,
ben

[-- Attachment #2: Type: text/html, Size: 2338 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 03/10] gnu: Add python-pytest-pep8.
  2016-04-21 18:26   ` Hartmut Goebel
@ 2016-04-24 13:21     ` Ben Woodcroft
  0 siblings, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 13:21 UTC (permalink / raw)
  To: Hartmut Goebel, guix-devel

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]



On 22/04/16 04:26, Hartmut Goebel wrote:
> Am 21.04.2016 um 15:21 schrieb Ben Woodcroft:
>> +         (add-after 'install 'post-install-check
>> +           ;; 'setup.py test' does not run tests
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             (let ((out (assoc-ref outputs "out")))
>> +               (setenv "PYTHONPATH"
>> +                       (string-append
>> +                        (getenv "PYTHONPATH")
>> +                        ":"
>> +                        out
>> +                        "/lib/python"
>> +                        (string-take (string-take-right
>> +                                      (assoc-ref inputs "python") 5) 3)
>> +                        "/site-packages"))
>> +               (zero?
>> +                (system*
>> +                 (string-append out "/bin/py.test") "test_pep8.py"))))))))
>
> Have you tried if the tests are run when moving the test-file into a 
> new subdirectory "tests/"? This would result in much less code.

I'm afraid not. I'm no pythonista, but these tests are written for 
pytest, not in the more vanilla unittest which setup.py expects, I 
think. I tested moving it to tests out as you suggest, to no avail.

Thanks,
ben

[-- Attachment #2: Type: text/html, Size: 1870 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 03/10] gnu: Add python-pytest-pep8.
  2016-04-24 13:06   ` [PATCH v2 03/10] gnu: Add python-pytest-pep8 Ben Woodcroft
@ 2016-04-24 17:04     ` Efraim Flashner
  2016-04-24 23:42       ` Ben Woodcroft
  2016-04-24 23:45       ` Ben Woodcroft
  0 siblings, 2 replies; 53+ messages in thread
From: Efraim Flashner @ 2016-04-24 17:04 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 3642 bytes --]

On Sun, Apr 24, 2016 at 11:06:17PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-pytest-pep8, python2-pytest-pep8): New
> variables.
> ---
>  gnu/packages/python.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 60 insertions(+)
> 
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index c07dae6..b1a4969 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -8714,6 +8714,66 @@ development version of CPython that are not available in older releases.")
>        (native-inputs
>         `(("python2-setuptools" ,python2-setuptools))))))
>  
> +(define-public python-pytest-pep8
> +  (package
> +    (name "python-pytest-pep8")
> +    (version "1.0.6")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (pypi-uri "pytest-pep8" version))
> +       (sha256
> +        (base32
> +         "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-before 'build 'remove-failing-test
> +           ;; Ignore the known test failure.
> +           ;; https://bitbucket.org/pytest-dev/pytest-pep8/issues/8/test-failure
> +           (lambda _
> +             (substitute* "test_pep8.py"
> +               (("^def test_ok_verbose") "def dont_run"))
> +             #t))
> +         (add-after 'install 'post-install-check
> +           ;; 'setup.py test' does not run tests
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let ((out (assoc-ref outputs "out")))
> +               (setenv "PYTHONPATH"
> +                       (string-append
> +                        (getenv "PYTHONPATH")
> +                        ":"
> +                        out
> +                        "/lib/python"

some of the previous lines should be combined into one line

> +                        (string-take (string-take-right
> +                                      (assoc-ref inputs "python") 5) 3)
> +                        "/site-packages"))
> +               (zero?
> +                (system*
> +                 (string-append out "/bin/py.test") "test_pep8.py"))))))))
> +    (propagated-inputs
> +     `(("python-pytest-cache", python-pytest-cache)
> +       ("python-pytest" ,python-pytest)
> +       ("python-pep8" ,python-pep8)))

Are you sure all of these need to be propagated?

> +    (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
> +    (synopsis "Pytest plugin to check PEP8 requirements")
> +    (description
> +     "Pytest-pep8 is a py.test plugin for efficiently checking compliance to
> +the PEP8 style guide.  If you type @code{py.test --pep8} every file ending in
> +@code{.py} will be discovered and PEP8-checked, starting from the command line
> +arguments.")
> +    (license license:expat)
> +    (properties `((python2-variant . ,(delay python2-pytest-pep8))))))
> +
> +(define-public python2-pytest-pep8
> +  (let ((base (package-with-python2
> +               (strip-python2-variant python-pytest-pep8))))
> +    (package
> +      (inherit base)
> +      (native-inputs
> +       `(("python2-setuptools" ,python2-setuptools))))))
> +
>  (define-public python-cysignals
>    (package
>      (name "python-cysignals")
> -- 
> 2.5.0
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 03/10] gnu: Add python-pytest-pep8.
  2016-04-24 17:04     ` Efraim Flashner
@ 2016-04-24 23:42       ` Ben Woodcroft
  2016-04-24 23:45       ` Ben Woodcroft
  1 sibling, 0 replies; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 23:42 UTC (permalink / raw)
  To: Efraim Flashner, Ben Woodcroft; +Cc: Guix-devel



On 25/04/16 03:04, Efraim Flashner wrote:
> On Sun, Apr 24, 2016 at 11:06:17PM +1000, Ben Woodcroft wrote:
[..]
>> +             (let ((out (assoc-ref outputs "out")))
>> +               (setenv "PYTHONPATH"
>> +                       (string-append
>> +                        (getenv "PYTHONPATH")
>> +                        ":"
>> +                        out
>> +                        "/lib/python"
> some of the previous lines should be combined into one line

I think this is a matter of style, but I've amended it to below, which I 
assume is OK - I have no strong opinions.

+               (setenv
+                "PYTHONPATH"
+                (string-append (getenv "PYTHONPATH")":" out "/lib/python"
+                               (string-take (string-take-right
+                                      (assoc-ref inputs "python") 5) 3)
+                               "/site-packages"))

>
>> +                        (string-take (string-take-right
>> +                                      (assoc-ref inputs "python") 5) 3)
>> +                        "/site-packages"))
>> +               (zero?
>> +                (system*
>> +                 (string-append out "/bin/py.test") "test_pep8.py"))))))))
>> +    (propagated-inputs
>> +     `(("python-pytest-cache", python-pytest-cache)
>> +       ("python-pytest" ,python-pytest)
>> +       ("python-pep8" ,python-pep8)))
> Are you sure all of these need to be propagated?

That's what the install_requires in setup.py is telling me.

Thanks,
ben

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 03/10] gnu: Add python-pytest-pep8.
  2016-04-24 17:04     ` Efraim Flashner
  2016-04-24 23:42       ` Ben Woodcroft
@ 2016-04-24 23:45       ` Ben Woodcroft
  2016-04-25  8:43         ` Ricardo Wurmus
  1 sibling, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-24 23:45 UTC (permalink / raw)
  To: Efraim Flashner, Ben Woodcroft; +Cc: Guix-devel



On 25/04/16 03:04, Efraim Flashner wrote:
> On Sun, Apr 24, 2016 at 11:06:17PM +1000, Ben Woodcroft wrote:
[..]
>> +           ;; 'setup.py test' does not run tests
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             (let ((out (assoc-ref outputs "out")))
>> +               (setenv "PYTHONPATH"
>> +                       (string-append
>> +                        (getenv "PYTHONPATH")
>> +                        ":"
>> +                        out
>> +                        "/lib/python"
> some of the previous lines should be combined into one line

I think this is a matter of style, but I've amended it to below, which I 
assume is OK - I have no strong opinions.

+               (setenv
+                "PYTHONPATH"
+                (string-append (getenv "PYTHONPATH")":" out "/lib/python"
+                               (string-take (string-take-right
+                                      (assoc-ref inputs "python") 5) 3)
+                               "/site-packages"))

[..]

>> +    (propagated-inputs
>> +     `(("python-pytest-cache", python-pytest-cache)
>> +       ("python-pytest" ,python-pytest)
>> +       ("python-pep8" ,python-pep8)))
> Are you sure all of these need to be propagated?

That's what the install_requires in setup.py is telling me.

[..]

Thanks,
ben

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 03/10] gnu: Add python-pytest-pep8.
  2016-04-24 23:45       ` Ben Woodcroft
@ 2016-04-25  8:43         ` Ricardo Wurmus
  2016-04-25 12:36           ` Ben Woodcroft
  0 siblings, 1 reply; 53+ messages in thread
From: Ricardo Wurmus @ 2016-04-25  8:43 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel


Ben Woodcroft <donttrustben@gmail.com> writes:

>>> +    (propagated-inputs
>>> +     `(("python-pytest-cache", python-pytest-cache)
>>> +       ("python-pytest" ,python-pytest)
>>> +       ("python-pep8" ,python-pep8)))
>> Are you sure all of these need to be propagated?
>
> That's what the install_requires in setup.py is telling me.

Doesn’t this mean that these packages are only needed at build time?
Could they not be made native-inputs then?

~~ Ricardo

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 03/10] gnu: Add python-pytest-pep8.
  2016-04-25  8:43         ` Ricardo Wurmus
@ 2016-04-25 12:36           ` Ben Woodcroft
  2016-04-25 18:19             ` Leo Famulari
  0 siblings, 1 reply; 53+ messages in thread
From: Ben Woodcroft @ 2016-04-25 12:36 UTC (permalink / raw)
  To: Ricardo Wurmus, Ben Woodcroft; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

On 25/04/16 18:43, Ricardo Wurmus wrote:
> Ben Woodcroft <donttrustben@gmail.com> writes:
>
>>>> +    (propagated-inputs
>>>> +     `(("python-pytest-cache", python-pytest-cache)
>>>> +       ("python-pytest" ,python-pytest)
>>>> +       ("python-pep8" ,python-pep8)))
>>> Are you sure all of these need to be propagated?
>> That's what the install_requires in setup.py is telling me.
> Doesn’t this mean that these packages are only needed at build time?
> Could they not be made native-inputs then?
|
I don't believe so.

http://pythonhosted.org/setuptools/setuptools.html#new-and-changed-setup-keywords

 >install_requires|
>    A string or list of strings specifying what other  distributions need to be installed when this one is.

ben

[-- Attachment #2: Type: text/html, Size: 1679 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 03/10] gnu: Add python-pytest-pep8.
  2016-04-25 12:36           ` Ben Woodcroft
@ 2016-04-25 18:19             ` Leo Famulari
  2016-04-25 20:07               ` proper Python inputs (was: gnu: Add python-pytest-pep8.) Hartmut Goebel
  0 siblings, 1 reply; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:19 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Mon, Apr 25, 2016 at 10:36:54PM +1000, Ben Woodcroft wrote:
> On 25/04/16 18:43, Ricardo Wurmus wrote:
> >Ben Woodcroft <donttrustben@gmail.com> writes:
> >
> >>>>+    (propagated-inputs
> >>>>+     `(("python-pytest-cache", python-pytest-cache)
> >>>>+       ("python-pytest" ,python-pytest)
> >>>>+       ("python-pep8" ,python-pep8)))
> >>>Are you sure all of these need to be propagated?
> >>That's what the install_requires in setup.py is telling me.
> >Doesn’t this mean that these packages are only needed at build time?
> >Could they not be made native-inputs then?
> |
> I don't believe so.
> 
> http://pythonhosted.org/setuptools/setuptools.html#new-and-changed-setup-keywords
> 
> >install_requires|
> >   A string or list of strings specifying what other  distributions need to be installed when this one is.

This seems like an unusual case, since the package in question appears
to be a build-time tool. So, it would make sense to have things like
python-pytest available during python-pytest-pep8's run-time.

If we have a use case for python-pytest-pep8, it could be worthwhile to
see if it will work without propagating these anyways; I've noticed some
Python packages have a way to link to non-propagated-inputs.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 01/10] gnu: Add python2-pytest-cache.
  2016-04-24 13:06   ` [PATCH v2 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
@ 2016-04-25 18:22     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:22 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:15PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-pytest-cache)[properties]: New field.
> (python2-pytest-cache): New variable.

LGTM!

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 02/10] gnu: Add python-bz2file.
  2016-04-24 13:06   ` [PATCH v2 02/10] gnu: Add python-bz2file Ben Woodcroft
@ 2016-04-25 18:27     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:27 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:16PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-bz2file, python2-bz2file): New
> variables.

LGTM!

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 05/10] gnu: Add python-future.
  2016-04-24 13:06   ` [PATCH v2 05/10] gnu: Add python-future Ben Woodcroft
@ 2016-04-25 18:30     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:30 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:19PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-future, python2-future): New
> variables.

Thanks!

> +    (arguments
> +     `(#:tests? #f)) ; Tests connect to the network

Is it only a handful of tests? Can we disable those tests?

If not, it's worth an upstream bug report, in my opinion.

One way or another, I don't think this should block packaging if
python-future's seems to work when used by another package.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 04/10] gnu: Add python-pytest-flakes.
  2016-04-24 13:06   ` [PATCH v2 04/10] gnu: Add python-pytest-flakes Ben Woodcroft
@ 2016-04-25 18:34     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:34 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:18PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-pytest-flakes,
> python2-pytest-flakes): New variables.

Thanks!

> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'install 'post-install-check
> +           ;; 'setup.py test' does not run tests
> +           (lambda _
> +             (zero? (system* "py.test" "test_flakes.py")))))))

Does it work if you replace the check phase? Or does the check phase do
something worthwhile? Or do the tests only work after install? Can you
answer this in the code comment? ;)

> +    (native-inputs
> +     `(("python-pytest-pep8" ,python-pytest-pep8)))
> +    (propagated-inputs
> +     `(("python-pytest-cache" ,python-pytest-cache)
> +       ("python-pytest" ,python-pytest)
> +       ("python-pyflakes" ,python-pyflakes)))

I think this could get messy in practice. If, during the build of some
other package, multiple packages try to propagate pytest, we just have
to hope that whichever pytest passes the conflict resolution mechanism
works as expected.

Can you check if it still works when these are "regular" inputs?

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 06/10] gnu: Add python-cachecontrol.
  2016-04-24 13:06   ` [PATCH v2 06/10] gnu: Add python-cachecontrol Ben Woodcroft
@ 2016-04-25 18:35     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:35 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:20PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-cachecontrol, python2-cachecontrol):
> New variables.

LGTM!

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 07/10] gnu: python-tornado: Use 'python2-variant'.
  2016-04-24 13:06   ` [PATCH v2 07/10] gnu: python-tornado: Use 'python2-variant' Ben Woodcroft
@ 2016-04-25 18:36     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:36 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:21PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-tornado)[properties]: New field.
> (python2-tornado): Build with 'strip-python2-variant'.

Thanks for doing this "housekeeping"!

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 09/10] gnu: Add python-natsort.
  2016-04-24 13:06   ` [PATCH v2 09/10] gnu: Add python-natsort Ben Woodcroft
@ 2016-04-25 18:41     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:41 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:23PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-natsort, python2-natsort): New
> variables.

Thanks!

> +    (synopsis "Sort lists naturally")

How about "Sort lists naturally rather than lexicographically"?

> +(define-public python2-natsort
> +  (let ((base (package-with-python2
> +               (strip-python2-variant python-natsort))))
> +    (package
> +      (inherit base)
> +      (native-inputs
> +       (append (package-native-inputs base)
> +               `(("python2-mock" ,python2-mock)
> +                 ("python2-pathlib" ,python2-pathlib)
> +                 ("python2-enum34" ,python2-enum34)
> +                 ("python2-setuptools" ,python2-setuptools)))))))

Is it possible to use the technique used in 59f151ec54? I think it's
best if all variants of this type are written the same way.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 10/10] gnu: Add python-scikit-bio.
  2016-04-24 13:06   ` [PATCH v2 10/10] gnu: Add python-scikit-bio Ben Woodcroft
@ 2016-04-25 18:47     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:47 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:24PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-scikit-bio, python2-scikit-bio):
> New variables.

Thanks!

> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         ;; Install procedure installs extraneous binaries.
> +         (add-after 'install 'remove-extraneous-files
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin")))
> +               (delete-file-recursively bin))
> +             #t))

That's interesting. How are they extraneous? Would nobody want to use
them?

> +         ;; Tests are intended to be run using 'make test' not 'setup.py
> +         ;; test', but there are many test failures anyway
> +         ;; e.g. https://github.com/biocore/scikit-bio/issues/1308.  Run a
> +         ;; simple import test instead.
> +         (delete 'check)
> +         (add-after 'install 'check-after-install

Are the tests broken, or does scikit-bio simply not work with the
current version of pandas?

More context:
https://github.com/biocore/scikit-bio/pull/1325

> +(define-public python2-scikit-bio
> +  (let ((base (package-with-python2
> +               (strip-python2-variant python-scikit-bio))))
> +    (package
> +      (inherit base)
> +      (native-inputs
> +       (append (package-native-inputs base)
> +               `(("python2-setuptools" ,python2-setuptools)
> +                 ("python2-mock" ,python2-mock)))))))

Same suggestion as for python-natsort.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 08/10] gnu: python-ipython: Use 'python2-variant'.
  2016-04-24 13:06   ` [PATCH v2 08/10] gnu: python-ipython: " Ben Woodcroft
@ 2016-04-25 18:48     ` Leo Famulari
  0 siblings, 0 replies; 53+ messages in thread
From: Leo Famulari @ 2016-04-25 18:48 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

On Sun, Apr 24, 2016 at 11:06:22PM +1000, Ben Woodcroft wrote:
> * gnu/packages/python.scm (python-ipython)[properties]: New field.
> (python2-ipython): Use 'strip-python2-variant'.
> [inputs, propagated-inputs]: Do not redefine inherited values.

Thanks, LGTM!

^ permalink raw reply	[flat|nested] 53+ messages in thread

* proper Python inputs (was: gnu: Add python-pytest-pep8.)
  2016-04-25 18:19             ` Leo Famulari
@ 2016-04-25 20:07               ` Hartmut Goebel
  2016-04-26 14:19                 ` Ricardo Wurmus
  0 siblings, 1 reply; 53+ messages in thread
From: Hartmut Goebel @ 2016-04-25 20:07 UTC (permalink / raw)
  To: guix-devel

Am 25.04.2016 um 20:19 schrieb Leo Famulari:
> This seems like an unusual case, since the package in question appears
> to be a build-time tool. So, it would make sense to have things like
> python-pytest available during python-pytest-pep8's run-time.

> If we have a use case for python-pytest-pep8, it could be worthwhile
> to see if it will work without propagating these anyways; I've noticed
> some Python packages have a way to link to non-propagated-inputs. 

Reading this makes me *totally* confused about how to package Python for
Guix. I think, we should enhance the Guix Python Packaging guide to
clarify thinks for all.

1. Fact: If some Python package lists another package in
"install_requires", then this other Python package is required to run.
In a non Guix-environment, pip would install these other package, too.

2. Until 5 minutes ago I thought, that adding these other packages as
"normal" inputs is enough. But then I found that quite a bunch of
packages are using "propagated-inputs". So I tried to find out, what the
difference is:

  - "normal" inputs get added to PYTHONPATH via the .pth mechanism.

     Example: guix package -i python-execnet puts only
"execnet-1.4.1-py3.4.egg" into site-packages, plus
"python-execnet-1.4.1.pth", which adds the required package via a link
to "/gnu/store/....python-apipkg-1.4/..."

 - "Propagated" inputs are all linked into site-packages

    Example: guix package -i python-zope-interface puts zope-interface
and zope-event into site-packages.

 So this is not much of a difference: In both cases all required inputs
will be available in PYTHONPATH at run-time and can be imported.

3. But anyhow: Trouble is ahead: If some package aaa has a normal input
"zzz@1.2", while package bbb as normal input "zzz@1.1" and package ccc
as propagated input "zzz@1.3", we will end up with this in site-packages:

   - aaa.pth adding path to zzz@1.2
   - bbb.pth adding path to zzz@1.1
   - zzz-1.3.egg

  Which package "zzz" gets imported is somewhat arbitrary [2].

Is this intended? Did I miss something?

IMHO we should clarify his behavior and then bring all existing Python
packages in line and  document it in the manual.


[1]
<https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/?highlight=install_requires#install-requires>

[2] Not exactly, it depends on the lexical order of the filenames, but
this is implementation-dependent and AFAIK not documented.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: proper Python inputs (was: gnu: Add python-pytest-pep8.)
  2016-04-25 20:07               ` proper Python inputs (was: gnu: Add python-pytest-pep8.) Hartmut Goebel
@ 2016-04-26 14:19                 ` Ricardo Wurmus
  0 siblings, 0 replies; 53+ messages in thread
From: Ricardo Wurmus @ 2016-04-26 14:19 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel


Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 25.04.2016 um 20:19 schrieb Leo Famulari:
>> This seems like an unusual case, since the package in question appears
>> to be a build-time tool. So, it would make sense to have things like
>> python-pytest available during python-pytest-pep8's run-time.
>
>> If we have a use case for python-pytest-pep8, it could be worthwhile
>> to see if it will work without propagating these anyways; I've noticed
>> some Python packages have a way to link to non-propagated-inputs. 
>
> Reading this makes me *totally* confused about how to package Python for
> Guix. I think, we should enhance the Guix Python Packaging guide to
> clarify thinks for all.
>
> 1. Fact: If some Python package lists another package in
> "install_requires", then this other Python package is required to run.
> In a non Guix-environment, pip would install these other package, too.
>
> 2. Until 5 minutes ago I thought, that adding these other packages as
> "normal" inputs is enough. But then I found that quite a bunch of
> packages are using "propagated-inputs". So I tried to find out, what the
> difference is:
>
>   - "normal" inputs get added to PYTHONPATH via the .pth mechanism.
>
>      Example: guix package -i python-execnet puts only
> "execnet-1.4.1-py3.4.egg" into site-packages, plus
> "python-execnet-1.4.1.pth", which adds the required package via a link
> to "/gnu/store/....python-apipkg-1.4/..."
>
>  - "Propagated" inputs are all linked into site-packages
>
>     Example: guix package -i python-zope-interface puts zope-interface
> and zope-event into site-packages.
>
>  So this is not much of a difference: In both cases all required inputs
> will be available in PYTHONPATH at run-time and can be imported.
>
> 3. But anyhow: Trouble is ahead: If some package aaa has a normal input
> "zzz@1.2", while package bbb as normal input "zzz@1.1" and package ccc
> as propagated input "zzz@1.3", we will end up with this in site-packages:
>
>    - aaa.pth adding path to zzz@1.2
>    - bbb.pth adding path to zzz@1.1
>    - zzz-1.3.egg
>
>   Which package "zzz" gets imported is somewhat arbitrary [2].
>
> Is this intended? Did I miss something?

It’s not so easy as “pth” files aren’t necessarily evaluated.  Usually
we propagate inputs that need to be available at runtime.

This often causes problems here at work when people installed
“python2-numpy” a couple of months ago and then install “miso” which
propagates “python2-numpy”.  There are then at least two variants of
numpy in the profile leading to many collisions.

We’ve previously discussed alternatives to propagation:

    http://lists.gnu.org/archive/html/guix-devel/2016-02/msg00810.html

But so far there haven’t been any patch-ready solutions.  I’d really
like to fix this, though, as it’s uncomfortable to have to tell users to
either use manifests (thereby upgrading all of their applications in
their profile before installing something new) or to use separate
profiles for Python stuff.

~~ Ricardo

^ permalink raw reply	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2016-04-26 14:19 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-21 13:21 [PATCH] Add python-scikit-bio Ben Woodcroft
2016-04-21 13:21 ` [PATCH 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
2016-04-21 13:21 ` [PATCH 02/10] gnu: Add python-bz2file Ben Woodcroft
2016-04-21 15:43   ` Efraim Flashner
2016-04-21 18:24   ` Hartmut Goebel
2016-04-24 13:17     ` Ben Woodcroft
2016-04-21 13:21 ` [PATCH 03/10] gnu: Add python-pytest-pep8 Ben Woodcroft
2016-04-21 18:26   ` Hartmut Goebel
2016-04-24 13:21     ` Ben Woodcroft
2016-04-21 13:21 ` [PATCH 04/10] gnu: Add python-pytest-flakes Ben Woodcroft
2016-04-21 18:26   ` Hartmut Goebel
2016-04-21 13:21 ` [PATCH 05/10] gnu: Add python-future Ben Woodcroft
2016-04-21 13:21 ` [PATCH 06/10] gnu: Add python-cachecontrol Ben Woodcroft
2016-04-21 13:21 ` [PATCH 07/10] gnu: python-tornado: Use 'python2-variant' Ben Woodcroft
2016-04-21 13:21 ` [PATCH 08/10] gnu: python-ipython: " Ben Woodcroft
2016-04-21 15:14   ` Ricardo Wurmus
2016-04-24 13:11     ` Ben Woodcroft
2016-04-24 13:12     ` Ben Woodcroft
2016-04-21 13:22 ` [PATCH 09/10] gnu: Add python-natsort Ben Woodcroft
2016-04-21 15:09   ` Ricardo Wurmus
2016-04-21 13:22 ` [PATCH 10/10] gnu: Add python-scikit-bio Ben Woodcroft
2016-04-21 15:04   ` Ricardo Wurmus
2016-04-21 15:07   ` Ricardo Wurmus
2016-04-21 15:09   ` Ricardo Wurmus
2016-04-24 13:01 ` [PATCH 2/2] " Ben Woodcroft
2016-04-24 13:06 ` [PATCH v2] " Ben Woodcroft
2016-04-24 13:06   ` [PATCH v2 01/10] gnu: Add python2-pytest-cache Ben Woodcroft
2016-04-25 18:22     ` Leo Famulari
2016-04-24 13:06   ` [PATCH v2 02/10] gnu: Add python-bz2file Ben Woodcroft
2016-04-25 18:27     ` Leo Famulari
2016-04-24 13:06   ` [PATCH v2 03/10] gnu: Add python-pytest-pep8 Ben Woodcroft
2016-04-24 17:04     ` Efraim Flashner
2016-04-24 23:42       ` Ben Woodcroft
2016-04-24 23:45       ` Ben Woodcroft
2016-04-25  8:43         ` Ricardo Wurmus
2016-04-25 12:36           ` Ben Woodcroft
2016-04-25 18:19             ` Leo Famulari
2016-04-25 20:07               ` proper Python inputs (was: gnu: Add python-pytest-pep8.) Hartmut Goebel
2016-04-26 14:19                 ` Ricardo Wurmus
2016-04-24 13:06   ` [PATCH v2 04/10] gnu: Add python-pytest-flakes Ben Woodcroft
2016-04-25 18:34     ` Leo Famulari
2016-04-24 13:06   ` [PATCH v2 05/10] gnu: Add python-future Ben Woodcroft
2016-04-25 18:30     ` Leo Famulari
2016-04-24 13:06   ` [PATCH v2 06/10] gnu: Add python-cachecontrol Ben Woodcroft
2016-04-25 18:35     ` Leo Famulari
2016-04-24 13:06   ` [PATCH v2 07/10] gnu: python-tornado: Use 'python2-variant' Ben Woodcroft
2016-04-25 18:36     ` Leo Famulari
2016-04-24 13:06   ` [PATCH v2 08/10] gnu: python-ipython: " Ben Woodcroft
2016-04-25 18:48     ` Leo Famulari
2016-04-24 13:06   ` [PATCH v2 09/10] gnu: Add python-natsort Ben Woodcroft
2016-04-25 18:41     ` Leo Famulari
2016-04-24 13:06   ` [PATCH v2 10/10] gnu: Add python-scikit-bio Ben Woodcroft
2016-04-25 18:47     ` Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).