@@ -1,10 +1,23 @@
1−{ lib, buildPythonPackage, fetchPypi, fetchpatch, isPy27, pythonAtLeast
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, pythonOlder
5+, pytestCheckHook
6+, atpublic
7+, cached-property
8+, clickhouse-driver
9+, click
10+, dask
211, graphviz
12+, importlib-metadata
313, multipledispatch
414, numpy
515, pandas
16+, parsy
617, pyarrow
718, pytest
19+, pytest-mock
20+, pytest-xdist
821, pytz
922, regex
1023, requests
@@ -12,54 +25,117 @@
1225, tables
1326, toolz
1427}:
28+let
29+ # ignore tests for which dependencies are not available
30+ backends = [
31+ "csv"
32+ "dask"
33+ "hdf5"
34+ "pandas"
35+ "parquet"
36+ "sqlite"
37+ ];
38+
39+ backendsString = lib.concatStringsSep " " backends;
40+
41+ ibisTestingData = fetchFromGitHub {
42+ owner = "ibis-project";
43+ repo = "testing-data";
44+ rev = "743201a35c6b968cf55b054f9d28949ea15d1f0a";
45+ sha256 = "sha256-xuSE6wHP3aF8lnEE2SuFbTRBu49ecRmc1F3HPcszptI=";
46+ };
47+in
1548
1649buildPythonPackage rec {
1750 pname = "ibis-framework";
18− version = "1.3.0";
19− disabled = isPy27 || pythonAtLeast "3.8";
51+ version = "2.1.1";
52+ disabled = pythonOlder "3.7";
2053
21− src = fetchPypi {
22− inherit pname version;
23− sha256 = "1my94a11jzg1hv6ln8wxklbqrg6z5l2l77vr89aq0829yyxacmv7";
54+ src = fetchFromGitHub {
55+ repo = "ibis";
56+ owner = "ibis-project";
57+ rev = version;
58+ sha256 = "sha256-n3fR6wvcSfIo7760seB+5SxtoYSqQmqkzZ9VlNQF200=";
2459 };
2560
26− patches = [
27− # fix tests for pandas 1.1
28− (fetchpatch {
29− url = "https://github.com/ibis-project/ibis/commit/53ef3cefc4ae90d61f3612310cb36da2bcd11305.diff";
30− sha256 = "1i5yjmqridjqpggiinsjaz5spcxca5bd48vy7a0mj4mm1b5flw2m";
31− })
32− ];
33−
3461 propagatedBuildInputs = [
62+ atpublic
63+ cached-property
64+ clickhouse-driver
65+ dask
66+ graphviz
3567 multipledispatch
3668 numpy
3769 pandas
70+ parsy
71+ pyarrow
3872 pytz
3973 regex
40− toolz
41− sqlalchemy
4274 requests
43− graphviz
75+ sqlalchemy
4476 tables
45− pyarrow
46− ];
77+ toolz
78+ ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
4779
4880 checkInputs = [
81+ pytestCheckHook
82+ click
4983 pytest
84+ pytest-mock
85+ pytest-xdist
86+ ];
87+
88+ # these tests are broken upstream: https://github.com/ibis-project/ibis/issues/3291
89+ disabledTests = [
90+ "test_summary_numeric"
91+ "test_summary_non_numeric"
92+ "test_batting_most_hits"
93+ "test_join_with_window_function"
94+ "test_where_long"
95+ "test_quantile_groupby"
96+ "test_summary_numeric"
97+ "test_summary_numeric_group_by"
98+ "test_summary_non_numeric"
99+ "test_searched_case_column"
100+ "test_simple_case_column"
101+ "test_summary_non_numeric_group_by"
50102 ];
51103
52− # ignore tests which require test dataset, or frameworks not available
53− checkPhase = ''
54− pytest ibis \
55− --ignore=ibis/tests/all \
56− --ignore=ibis/{sql,spark}
104+ pytestFlagsArray = [
105+ "--numprocesses $NIX_BUILD_CORES"
106+ "ibis/tests"
107+ "ibis/backends/tests"
108+ "ibis/backends/{${lib.concatStringsSep "," backends}}/tests"
109+ ];
110+
111+ preCheck = ''
112+ set -euo pipefail
113+
114+ export IBIS_TEST_DATA_DIRECTORY
115+ IBIS_TEST_DATA_DIRECTORY="$(mktemp -d)"
116+
117+ # copy the test data to a writable directory
118+ cp -r ${ibisTestingData}/* "$IBIS_TEST_DATA_DIRECTORY"
119+
120+ find "$IBIS_TEST_DATA_DIRECTORY" -type d -exec chmod u+rwx {} +
121+ find "$IBIS_TEST_DATA_DIRECTORY" -type f -exec chmod u+rw {} +
122+
123+ # load data
124+ for backend in ${backendsString}; do
125+ python ci/datamgr.py "$backend" &
126+ done
127+
128+ wait
129+
130+ export PYTEST_BACKENDS="${backendsString}"
57131 '';
58132
133+ pythonImportsCheck = [ "ibis" ] ++ (map (backend: "ibis.backends.${backend}") backends);
134+
59135 meta = with lib; {
60136 description = "Productivity-centric Python Big Data Framework";
61137 homepage = "https://github.com/ibis-project/ibis";
62138 license = licenses.asl20;
63− maintainers = [ maintainers.costrouc ];
139+ maintainers = with maintainers; [ costrouc cpcloud ];
64140 };
65141}