1{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder
2, pipInstallHook, writeText
3, blessed
4, docutils
5, libcxx
6, llvm
7, pytestCheckHook
8, typesentry
9, isPy310
10}:
11
12buildPythonPackage rec {
13 pname = "datatable";
14 version = "0.11.0";
15 disabled = pythonOlder "3.5";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "19c602711e00f72e9ae296d8fa742d46da037c2d3a2d254bdf68f817a8da76bb";
20 };
21 # authors seem to have created their own build system
22 format = "other";
23
24 postPatch = ''
25 # tarball doesn't appear to have been shipped totally ready-to-build
26 substituteInPlace ci/ext.py \
27 --replace \
28 'shell_cmd(["git"' \
29 '"0000000000000000000000000000000000000000" or shell_cmd(["git"'
30 echo '${version}' > VERSION.txt
31
32 # don't make assumptions about architecture
33 sed -i '/-m64/d' ci/ext.py
34 '';
35 DT_RELEASE = "1";
36
37 buildPhase = ''
38 python ci/ext.py wheel
39 '';
40
41 propagatedBuildInputs = [ typesentry blessed ];
42 buildInputs = [ llvm pipInstallHook ];
43 checkInputs = [ docutils pytestCheckHook ];
44
45 LLVM = llvm;
46 NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1";
47
48 # test suite is very cpu intensive, only run small subset to ensure package is working as expected
49 pytestFlagsArray = [ "tests/test-sets.py" ];
50
51 disabledTests = [
52 # skip tests which are irrelevant to our installation or use way too much memory
53 "test_xfunction_paths"
54 "test_fread_from_cmd2"
55 "test_cast_huge_to_str"
56 "test_create_large_string_column"
57 ];
58 pythonImportsCheck = [ "datatable" ];
59
60 meta = with lib; {
61 description = "data.table for Python";
62 homepage = "https://github.com/h2oai/datatable";
63 license = licenses.mpl20;
64 maintainers = with maintainers; [ abbradar ];
65 # uses custom build system and adds -Wunused-variable -Werror
66 # warning: ‘dt::expr::doc_first’ defined but not used [-Wunused-variable]
67 broken = isPy310;
68 };
69}