1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
pytestCheckHook,
atpublic,
bidict,
black,
clickhouse-connect,
dask,
datafusion,
db-dtypes,
duckdb,
filelock,
geopandas,
google-cloud-bigquery,
google-cloud-bigquery-storage,
graphviz,
hypothesis,
multipledispatch,
numpy,
oracledb,
packaging,
pandas,
parsy,
pins,
poetry-core,
poetry-dynamic-versioning,
polars,
psycopg2,
pyarrow,
pyarrow-hotfix,
pydata-google-auth,
pydruid,
pymysql,
pyodbc,
pyspark,
pytest-benchmark,
pytest-httpserver,
pytest-mock,
pytest-randomly,
pytest-snapshot,
pytest-timeout,
pytest-xdist,
python-dateutil,
pytz,
regex,
rich,
shapely,
snowflake-connector-python,
sqlglot,
sqlite,
toolz,
trino-python-client,
typing-extensions,
}:
let
testBackends = [
"datafusion"
"duckdb"
"pandas"
"sqlite"
];
ibisTestingData = fetchFromGitHub {
name = "ibis-testing-data";
owner = "ibis-project";
repo = "testing-data";
# https://github.com/ibis-project/ibis/blob/9.1.0/nix/overlay.nix#L20-L26
rev = "6737d1cb5951cabaccd095a3ae62a93dbd11ecb9";
hash = "sha256-MoVTZPWh4KVlrICYACrgfeLdl/fqoa1iweNg3zUtdrs=";
};
in
buildPythonPackage rec {
pname = "ibis-framework";
version = "9.1.0";
pyproject = true;
disabled = pythonOlder "3.10";
src = fetchFromGitHub {
name = "ibis-source";
repo = "ibis";
owner = "ibis-project";
rev = "refs/tags/${version}";
hash = "sha256-GmzmXzYMs7K7B//is3ZoD4muPAkb0tM56zFBbsA+NEo=";
};
nativeBuildInputs = [
poetry-core
poetry-dynamic-versioning
];
dontBypassPoetryDynamicVersioning = true;
env.POETRY_DYNAMIC_VERSIONING_BYPASS = lib.head (lib.strings.splitString "-" version);
propagatedBuildInputs = [
atpublic
bidict
multipledispatch
numpy
pandas
parsy
pyarrow
pyarrow-hotfix
python-dateutil
pytz
rich
sqlglot
toolz
typing-extensions
];
nativeCheckInputs = [
pytestCheckHook
black
filelock
hypothesis
pytest-benchmark
pytest-httpserver
pytest-mock
pytest-randomly
pytest-snapshot
pytest-timeout
pytest-xdist
] ++ lib.concatMap (name: passthru.optional-dependencies.${name}) testBackends;
pytestFlagsArray = [
"--dist=loadgroup"
"-m"
"'${lib.concatStringsSep " or " testBackends} or core'"
];
disabledTests = [
# tries to download duckdb extensions
"test_attach_sqlite"
"test_connect_extensions"
"test_load_extension"
"test_read_sqlite"
"test_register_sqlite"
# requires network connection
"test_s3_403_fallback"
# requires pytest 8.2+
"test_roundtrip_delta"
];
# patch out tests that check formatting with black
postPatch = ''
find ibis/tests -type f -name '*.py' -exec sed -i \
-e '/^ *assert_decompile_roundtrip/d' \
-e 's/^\( *\)code = ibis.decompile(expr, format=True)/\1code = ibis.decompile(expr)/g' {} +
'';
preCheck = ''
HOME="$TMPDIR"
export IBIS_TEST_DATA_DIRECTORY="ci/ibis-testing-data"
# copy the test data to a directory
ln -s "${ibisTestingData}" "$IBIS_TEST_DATA_DIRECTORY"
'';
postCheck = ''
rm -r "$IBIS_TEST_DATA_DIRECTORY"
'';
pythonImportsCheck = [ "ibis" ] ++ map (backend: "ibis.backends.${backend}") testBackends;
passthru = {
optional-dependencies = {
bigquery = [
db-dtypes
google-cloud-bigquery
google-cloud-bigquery-storage
pydata-google-auth
];
clickhouse = [ clickhouse-connect ];
dask = [
dask
regex
packaging
];
datafusion = [ datafusion ];
druid = [ pydruid ];
duckdb = [ duckdb ];
flink = [ ];
geospatial = [
geopandas
shapely
];
mssql = [ pyodbc ];
mysql = [ pymysql ];
oracle = [
oracledb
packaging
];
pandas = [
regex
packaging
];
polars = [
polars
packaging
];
postgres = [ psycopg2 ];
pyspark = [
pyspark
packaging
];
snowflake = [ snowflake-connector-python ];
sqlite = [ regex ];
trino = [ trino-python-client ];
visualization = [ graphviz ];
decompiler = [ black ];
examples = [ pins ] ++ pins.optional-dependencies.gcs;
};
};
meta = with lib; {
description = "Productivity-centric Python Big Data Framework";
homepage = "https://github.com/ibis-project/ibis";
changelog = "https://github.com/ibis-project/ibis/blob/${version}/docs/release_notes.md";
license = licenses.asl20;
maintainers = with maintainers; [ cpcloud ];
};
}
|