1{ lib, fetchPypi, python, buildPythonPackage
2, cython, bzip2, lzo, numpy, numexpr, hdf5, six, c-blosc, mock }:
3
4buildPythonPackage rec {
5 version = "3.5.2";
6 pname = "tables";
7
8 src = fetchPypi {
9 inherit pname version;
10 sha256 = "1hikrki0hx94ass31pn0jyz9iy0zhnkjacfk86m21cxsc8if685j";
11 };
12
13 buildInputs = [ hdf5 cython bzip2 lzo c-blosc ];
14 propagatedBuildInputs = [ numpy numexpr six mock ];
15
16 # The setup script complains about missing run-paths, but they are
17 # actually set.
18 setupPyBuildFlags = [
19 "--hdf5=${lib.getDev hdf5}"
20 "--lzo=${lib.getDev lzo}"
21 "--bzip2=${lib.getDev bzip2}"
22 "--blosc=${lib.getDev c-blosc}"
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.interpreter} <<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 = with lib; {
52 description = "Hierarchical datasets for Python";
53 homepage = "http://www.pytables.org/";
54 license = licenses.bsd2;
55 };
56}