python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / python-modules / tables / default.nix
blobfbe99c6fa931a39f4bf6c1a3491f9beda083d819
1 { lib
2 , fetchPypi
3 , fetchpatch
4 , buildPythonPackage
5 , pythonOlder
6 , bzip2
7 , c-blosc
8 , cython
9 , hdf5
10 , lzo
11 , numpy
12 , numexpr
13 , packaging
14   # Test inputs
15 , pytestCheckHook
18 buildPythonPackage rec {
19   pname = "tables";
20   version = "3.7.0";
21   disabled = pythonOlder "3.5";
23   src = fetchPypi {
24     inherit pname version;
25     sha256 = "sha256-6SqIetbyqYPlZKaZAt5KdkXDAGn8AavTU+xdolXF4f4=";
26   };
28   nativeBuildInputs = [ cython ];
30   buildInputs = [
31     bzip2
32     c-blosc
33     hdf5
34     lzo
35   ];
36   propagatedBuildInputs = [
37     numpy
38     numexpr
39     packaging  # uses packaging.version at runtime
40   ];
42   # When doing `make distclean`, ignore docs
43   postPatch = ''
44     substituteInPlace Makefile --replace "src doc" "src"
45     # Force test suite to error when unittest runner fails
46     substituteInPlace tables/tests/test_suite.py \
47       --replace "return 0" "assert result.wasSuccessful(); return 0" \
48       --replace "return 1" "assert result.wasSuccessful(); return 1"
49   '';
51   # Regenerate C code with Cython
52   preBuild = ''
53     make distclean
54   '';
56   setupPyBuildFlags = [
57     "--hdf5=${lib.getDev hdf5}"
58     "--lzo=${lib.getDev lzo}"
59     "--bzip2=${lib.getDev bzip2}"
60     "--blosc=${lib.getDev c-blosc}"
61   ];
63   checkInputs = [ pytestCheckHook ];
64   preCheck = ''
65     cd ..
66   '';
67   # Runs the test suite as one single test via unittest. The whole "heavy" test suite supposedly takes ~5 hours to run.
68   pytestFlagsArray = [
69     "--pyargs"
70     "tables.tests.test_suite"
71   ];
73   pythonImportsCheck = [ "tables" ];
75   meta = with lib; {
76     description = "Hierarchical datasets for Python";
77     homepage = "https://www.pytables.org/";
78     license = licenses.bsd2;
79     maintainers = with maintainers; [ drewrisinger ];
80   };