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