1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pipInstallHook,
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 = [
43 typesentry
44 blessed
45 ];
46 buildInputs = [
47 llvm
48 pipInstallHook
49 ];
50 nativeCheckInputs = [
51 docutils
52 pytestCheckHook
53 ];
54
55 LLVM = llvm;
56 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1";
57
58 # test suite is very cpu intensive, only run small subset to ensure package is working as expected
59 pytestFlagsArray = [ "tests/test-sets.py" ];
60
61 disabledTests = [
62 # skip tests which are irrelevant to our installation or use way too much memory
63 "test_xfunction_paths"
64 "test_fread_from_cmd2"
65 "test_cast_huge_to_str"
66 "test_create_large_string_column"
67 ];
68 pythonImportsCheck = [ "datatable" ];
69
70 meta = with lib; {
71 description = "data.table for Python";
72 homepage = "https://github.com/h2oai/datatable";
73 license = licenses.mpl20;
74 maintainers = with maintainers; [ abbradar ];
75 };
76}