2019-10-17 07:40:21 +01:00
|
|
|
{ stdenv, lib, fetchPypi, python, buildPythonPackage, isPy38
|
2019-06-06 18:46:37 +01:00
|
|
|
, cython, bzip2, lzo, numpy, numexpr, hdf5, six, c-blosc, mock }:
|
2014-06-14 17:24:50 +01:00
|
|
|
|
2019-10-14 08:56:10 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2014-06-14 17:24:50 +01:00
|
|
|
buildPythonPackage rec {
|
2019-11-07 00:31:56 +00:00
|
|
|
version = "3.6.1";
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "tables";
|
2014-06-14 17:24:50 +01:00
|
|
|
|
2018-06-23 14:27:58 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-11-07 00:31:56 +00:00
|
|
|
sha256 = "0j8vnxh2m5n0cyk9z3ndcj5n1zj5rdxgc1gb78bqlyn2lyw75aa9";
|
2014-06-14 17:24:50 +01:00
|
|
|
};
|
|
|
|
|
2019-10-27 16:18:24 +00:00
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
|
|
|
buildInputs = [ hdf5 bzip2 lzo c-blosc ];
|
2019-06-06 18:46:37 +01:00
|
|
|
propagatedBuildInputs = [ numpy numexpr six mock ];
|
2014-06-14 17:24:50 +01:00
|
|
|
|
2019-10-27 16:18:24 +00:00
|
|
|
# When doing `make distclean`, ignore docs
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile --replace "src doc" "src"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Regenerate C code with Cython
|
|
|
|
preBuild = ''
|
|
|
|
make distclean
|
|
|
|
'';
|
|
|
|
|
2014-06-14 17:24:50 +01:00
|
|
|
# The setup script complains about missing run-paths, but they are
|
|
|
|
# actually set.
|
2019-10-14 08:56:10 +01:00
|
|
|
setupPyBuildFlags = [
|
|
|
|
"--hdf5=${getDev hdf5}"
|
|
|
|
"--lzo=${getDev lzo}"
|
|
|
|
"--bzip2=${getDev bzip2}"
|
|
|
|
"--blosc=${getDev c-blosc}"
|
|
|
|
];
|
2014-06-14 17:24:50 +01:00
|
|
|
# Run the test suite.
|
|
|
|
# It requires the build path to be in the python search path.
|
|
|
|
# These tests take quite some time.
|
|
|
|
# If the hdf5 library is built with zlib then there is only one
|
|
|
|
# test-failure. That is the same failure as described in the following
|
|
|
|
# github issue:
|
|
|
|
# https://github.com/PyTables/PyTables/issues/269
|
|
|
|
checkPhase = ''
|
2018-06-23 14:27:58 +01:00
|
|
|
${python.interpreter} <<EOF
|
2014-06-14 17:24:50 +01:00
|
|
|
import sysconfig
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
f = "lib.{platform}-{version[0]}.{version[1]}"
|
|
|
|
lib = f.format(platform=sysconfig.get_platform(),
|
|
|
|
version=sys.version_info)
|
|
|
|
build = os.path.join(os.getcwd(), 'build', lib)
|
|
|
|
sys.path.insert(0, build)
|
|
|
|
import tables
|
|
|
|
r = tables.test()
|
|
|
|
if not r.wasSuccessful():
|
|
|
|
sys.exit(1)
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Disable tests until the failure described above is fixed.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Hierarchical datasets for Python";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.pytables.org/";
|
2014-06-25 21:32:54 +01:00
|
|
|
license = stdenv.lib.licenses.bsd2;
|
2014-06-14 17:24:50 +01:00
|
|
|
};
|
|
|
|
}
|