1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, pipInstallHook
6, writeText
7, blessed
8, docutils
9, libcxx
10, llvm
11, pytestCheckHook
12, typesentry
13}:
14
15buildPythonPackage rec {
16 pname = "datatable";
17 # python 3.10+ support is not in the 1.0.0 release
18 version = "unstable-2022-12-15";
19 format = "pyproject";
20
21 src = fetchFromGitHub {
22 owner = "h2oai";
23 repo = pname;
24 rev = "9522f0833d3e965656396de4fffebd882d39c25d";
25 hash = "sha256-lEXQwhx2msnJkkRrTkAwYttlYTISyH/Z7dSalqRrOhI=";
26 };
27
28 postPatch = ''
29 # tarball doesn't appear to have been shipped totally ready-to-build
30 substituteInPlace ci/ext.py \
31 --replace \
32 'shell_cmd(["git"' \
33 '"0000000000000000000000000000000000000000" or shell_cmd(["git"'
34 # TODO revert back to use ${version} when bumping to the next stable release
35 echo '1.0' > VERSION.txt
36
37 # don't make assumptions about architecture
38 sed -i '/-m64/d' ci/ext.py
39 '';
40 DT_RELEASE = "1";
41
42 propagatedBuildInputs = [ typesentry blessed ];
43 buildInputs = [ llvm pipInstallHook ];
44 nativeCheckInputs = [ docutils pytestCheckHook ];
45
46 LLVM = llvm;
47 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1";
48
49 # test suite is very cpu intensive, only run small subset to ensure package is working as expected
50 pytestFlagsArray = [ "tests/test-sets.py" ];
51
52 disabledTests = [
53 # skip tests which are irrelevant to our installation or use way too much memory
54 "test_xfunction_paths"
55 "test_fread_from_cmd2"
56 "test_cast_huge_to_str"
57 "test_create_large_string_column"
58 ];
59 pythonImportsCheck = [ "datatable" ];
60
61 meta = with lib; {
62 description = "data.table for Python";
63 homepage = "https://github.com/h2oai/datatable";
64 license = licenses.mpl20;
65 maintainers = with maintainers; [ abbradar ];
66 };
67}