1{ stdenv, fetchurl, python, buildPythonPackage
2, cython, bzip2, lzo, numpy, numexpr, hdf5 }:
3
4buildPythonPackage rec {
5 version = "3.2.2";
6 name = "tables-${version}";
7
8 src = fetchurl {
9 url = "mirror://pypi/t/tables/${name}.tar.gz";
10 sha256 = "3564b351a71ec1737b503b001eb7ceae1f65d5d6e3ffe1ea75aafba10f37fa84";
11 };
12
13 buildInputs = [ hdf5 cython bzip2 lzo ];
14 propagatedBuildInputs = [ numpy numexpr ];
15
16 # The setup script complains about missing run-paths, but they are
17 # actually set.
18 setupPyBuildFlags =
19 [ "--hdf5=${hdf5}"
20 "--lzo=${lzo}"
21 "--bzip2=${bzip2.dev}"
22 ];
23
24 # Run the test suite.
25 # It requires the build path to be in the python search path.
26 # These tests take quite some time.
27 # If the hdf5 library is built with zlib then there is only one
28 # test-failure. That is the same failure as described in the following
29 # github issue:
30 # https://github.com/PyTables/PyTables/issues/269
31 checkPhase = ''
32 ${python}/bin/${python.executable} <<EOF
33 import sysconfig
34 import sys
35 import os
36 f = "lib.{platform}-{version[0]}.{version[1]}"
37 lib = f.format(platform=sysconfig.get_platform(),
38 version=sys.version_info)
39 build = os.path.join(os.getcwd(), 'build', lib)
40 sys.path.insert(0, build)
41 import tables
42 r = tables.test()
43 if not r.wasSuccessful():
44 sys.exit(1)
45 EOF
46 '';
47
48 # Disable tests until the failure described above is fixed.
49 doCheck = false;
50
51 meta = {
52 description = "Hierarchical datasets for Python";
53 homepage = "http://www.pytables.org/";
54 license = stdenv.lib.licenses.bsd2;
55 };
56}