all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: Guix-devel <guix-devel@gnu.org>
Subject: [PATCH] Fix h5py.
Date: Thu, 8 Oct 2015 13:44:44 +0200	[thread overview]
Message-ID: <idj37xl37pv.fsf@bimsb-sys02.mdc-berlin.net> (raw)

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

Hi Guix,

python-h5py is currently broken.

   guix environment --ad-hoc python-2.7.10 python2-h5py
   python
   >>> import h5py
   [weird error]

The immediate reason here is that an Egg archive is built and installed
instead of a directory.  Python doesn’t seem to know how to import
modules whose contents are trapped in an Egg archive (or is this only
the case when setuptools are not in the profile?).

I found that removing ‘python-setuptools’ from the ‘native-inputs’ field
changes the behaviour such that no Egg archive is built and the library
files are installed plainly.

Another problem with h5py was that it didn’t actually build against our
hdf5 library, because it looked for the library and the headers under
‘/opt/local’ and ‘/usr/local’.  I fixed this by adding an additional
build phase.

The commit message is a little ugly, but I think it is correct.  I’m not
a Pythonista but it seems that python-h5py now works fine (at least
there are no weird error messages anymore).

~~ Ricardo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-python-h5py-python2-h5py-Correct-inputs.patch --]
[-- Type: text/x-patch, Size: 1837 bytes --]

From 5f368af582d3586a7b4e3a353d9bbd75eeb83a61 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Thu, 8 Oct 2015 13:30:23 +0200
Subject: [PATCH 1/2] gnu: python-h5py, python2-h5py: Correct inputs.

* gnu/packages/python.scm (python-h5py)
  [inputs]: Remove python-cython and python-numpy.
  [propagated-inputs]: New field.
  [native-inputs]: Drop python-setuptools and add python-cython.
  (python2-h5py): Replace "inputs" with "propagated-inputs".
---
 gnu/packages/python.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 46fcb4a..1865477 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -596,12 +596,12 @@ and verifies that it matches the intended target hostname.")
        (base32
         "0q4f9l8grf6pwp64xbv8bmyxx416s7h4522nnxac056ap3savbps"))))
     (build-system python-build-system)
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)))
     (inputs
-     `(("python-cython" ,python-cython)
-       ("python-numpy" ,python-numpy)
-       ("hdf5" ,hdf5)))
+     `(("hdf5" ,hdf5)))
     (native-inputs
-     `(("python-setuptools" ,python-setuptools)))
+     `(("python-cython" ,python-cython)))
     (arguments `(#:tests? #f)) ; no test target
     (home-page "http://www.h5py.org/")
     (synopsis "Read and write HDF5 files from Python")
@@ -616,11 +616,11 @@ concepts.")
 (define-public python2-h5py
   (let ((h5py (package-with-python2 python-h5py)))
     (package (inherit h5py)
-      (inputs
+      (propagated-inputs
        `(("python2-numpy" ,python2-numpy)
          ,@(alist-delete
             "python-numpy"
-            (package-inputs h5py)))))))
+            (package-propagated-inputs h5py)))))))
 
 (define-public python-lockfile
   (package
-- 
2.1.0


             reply	other threads:[~2015-10-08 11:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 11:44 Ricardo Wurmus [this message]
2015-10-08 11:49 ` [PATCH] Fix h5py Ricardo Wurmus
2015-10-08 14:56   ` Ludovic Courtès
2015-10-08 11:52 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=idj37xl37pv.fsf@bimsb-sys02.mdc-berlin.net \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.