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
|
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pythonOlder
, pytestCheckHook
, atpublic
, click
, clickhouse-cityhash
, clickhouse-driver
, dask
, datafusion
, duckdb
, duckdb-engine
, filelock
, geoalchemy2
, geopandas
, graphviz-nox
, lz4
, multipledispatch
, numpy
, packaging
, pandas
, parsy
, poetry-core
, poetry-dynamic-versioning
, psycopg2
, pyarrow
, pydantic
, pymysql
, pyspark
, pytest-benchmark
, pytest-randomly
, pytest-mock
, pytest-xdist
, python
, pytz
, regex
, rich
, rsync
, shapely
, sqlalchemy
, sqlglot
, sqlite
, toolz
}:
let
testBackends = [
"datafusion"
"duckdb"
"pandas"
"sqlite"
];
ibisTestingData = fetchFromGitHub {
owner = "ibis-project";
repo = "testing-data";
rev = "3c39abfdb4b284140ff481e8f9fbb128b35f157a";
sha256 = "sha256-BZWi4kEumZemQeYoAtlUSw922p+R6opSWp/bmX0DjAo=";
};
in
buildPythonPackage rec {
pname = "ibis-framework";
version = "3.2.0";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
repo = "ibis";
owner = "ibis-project";
rev = version;
hash = "sha256-YRP1nGJs4btqXQirm0GfEDKNPCVXexVrwQ6sE8JtD2o=";
};
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
atpublic
multipledispatch
numpy
packaging
pandas
parsy
poetry-dynamic-versioning
pydantic
pytz
regex
rich
toolz
];
nativeCheckInputs = [
pytestCheckHook
click
filelock
pytest-benchmark
pytest-mock
pytest-randomly
pytest-xdist
rsync
] ++ lib.concatMap (name: passthru.optional-dependencies.${name}) testBackends;
preBuild = ''
# setup.py exists only for developer convenience and is automatically generated
# it gets in the way in nixpkgs so we remove it
rm setup.py
'';
pytestFlagsArray = [
"--dist=loadgroup"
"-m"
"'${lib.concatStringsSep " or " testBackends} or core'"
# this test fails on nixpkgs datafusion version (0.4.0), but works on
# datafusion 0.6.0
"-k"
"'not datafusion-no_op'"
];
preCheck = ''
set -eo pipefail
export IBIS_TEST_DATA_DIRECTORY
IBIS_TEST_DATA_DIRECTORY="ci/ibis-testing-data"
mkdir -p "$IBIS_TEST_DATA_DIRECTORY"
# copy the test data to a directory
rsync --chmod=Du+rwx,Fu+rw --archive "${ibisTestingData}/" "$IBIS_TEST_DATA_DIRECTORY"
'';
postCheck = ''
rm -r "$IBIS_TEST_DATA_DIRECTORY"
'';
pythonImportsCheck = [
"ibis"
] ++ map (backend: "ibis.backends.${backend}") testBackends;
passthru = {
optional-dependencies = {
clickhouse = [ clickhouse-cityhash clickhouse-driver lz4 sqlglot ];
dask = [ dask pyarrow ];
datafusion = [ datafusion ];
duckdb = [ duckdb duckdb-engine pyarrow sqlalchemy sqlglot ];
geospatial = [ geoalchemy2 geopandas shapely ];
mysql = [ sqlalchemy pymysql sqlglot ];
pandas = [ ];
postgres = [ psycopg2 sqlalchemy sqlglot ];
pyspark = [ pyarrow pyspark ];
sqlite = [ sqlalchemy sqlite sqlglot ];
visualization = [ graphviz-nox ];
};
};
meta = with lib; {
description = "Productivity-centric Python Big Data Framework";
homepage = "https://github.com/ibis-project/ibis";
license = licenses.asl20;
maintainers = with maintainers; [ costrouc cpcloud ];
};
}
|