2022-01-23 02:10:13 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-06-26 10:26:21 +00:00
|
|
|
, fetchpatch
|
2022-01-23 02:10:13 +00:00
|
|
|
, pythonOlder
|
|
|
|
, pytestCheckHook
|
|
|
|
, atpublic
|
|
|
|
, cached-property
|
|
|
|
, click
|
2022-05-18 14:49:53 +00:00
|
|
|
, clickhouse-cityhash
|
|
|
|
, clickhouse-driver
|
2022-01-23 02:10:13 +00:00
|
|
|
, dask
|
2022-04-27 09:35:20 +00:00
|
|
|
, datafusion
|
|
|
|
, duckdb
|
|
|
|
, duckdb-engine
|
2022-05-18 14:49:53 +00:00
|
|
|
, geoalchemy2
|
|
|
|
, geopandas
|
|
|
|
, graphviz-nox
|
2022-01-23 02:10:13 +00:00
|
|
|
, importlib-metadata
|
2022-05-18 14:49:53 +00:00
|
|
|
, lz4
|
2020-04-24 23:36:52 +00:00
|
|
|
, multipledispatch
|
|
|
|
, numpy
|
2022-05-18 14:49:53 +00:00
|
|
|
, packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
, pandas
|
2022-01-23 02:10:13 +00:00
|
|
|
, parsy
|
2022-02-20 05:27:41 +00:00
|
|
|
, poetry-core
|
2022-04-27 09:35:20 +00:00
|
|
|
, poetry-dynamic-versioning
|
2022-05-18 14:49:53 +00:00
|
|
|
, psycopg2
|
2020-04-24 23:36:52 +00:00
|
|
|
, pyarrow
|
2022-04-27 09:35:20 +00:00
|
|
|
, pydantic
|
2022-05-18 14:49:53 +00:00
|
|
|
, pymysql
|
|
|
|
, pyspark
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytest-benchmark
|
2022-05-18 14:49:53 +00:00
|
|
|
, pytest-randomly
|
2022-01-23 02:10:13 +00:00
|
|
|
, pytest-mock
|
|
|
|
, pytest-xdist
|
2022-04-27 09:35:20 +00:00
|
|
|
, python
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytz
|
|
|
|
, regex
|
2022-05-18 14:49:53 +00:00
|
|
|
, shapely
|
2020-04-24 23:36:52 +00:00
|
|
|
, sqlalchemy
|
2022-04-27 09:35:20 +00:00
|
|
|
, sqlite
|
|
|
|
, tabulate
|
2020-04-24 23:36:52 +00:00
|
|
|
, toolz
|
|
|
|
}:
|
2022-01-23 02:10:13 +00:00
|
|
|
let
|
2022-05-18 14:49:53 +00:00
|
|
|
testBackends = [
|
2022-01-23 02:10:13 +00:00
|
|
|
"dask"
|
2022-04-27 09:35:20 +00:00
|
|
|
"datafusion"
|
|
|
|
"duckdb"
|
2022-01-23 02:10:13 +00:00
|
|
|
"pandas"
|
|
|
|
"sqlite"
|
|
|
|
];
|
|
|
|
|
|
|
|
ibisTestingData = fetchFromGitHub {
|
|
|
|
owner = "ibis-project";
|
|
|
|
repo = "testing-data";
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "a88a4b3c3b54a88e7f77e59de70f5bf20fb62f19";
|
|
|
|
sha256 = "sha256-BnRhVwPcWFwiBJ2ySgiiuUdnF4gesnTq1/dLcuvc868=";
|
2022-01-23 02:10:13 +00:00
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ibis-framework";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "3.0.2";
|
2022-02-20 05:27:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "ibis";
|
|
|
|
owner = "ibis-project";
|
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
hash = "sha256-7ywDMAHQAl39kiHfxVkq7voUEKqbb9Zq8qlaug7+ukI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/ibis-project/ibis/commit/a6f64c6c32b49098d39bb205952cbce4bdfea657.patch";
|
|
|
|
sha256 = "sha256-puVMjiJXWk8C9yhuXPD9HKrgUBYcYmUPacQz5YO5xYQ=";
|
|
|
|
includes = [ "pyproject.toml" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-01-23 02:10:13 +00:00
|
|
|
atpublic
|
|
|
|
cached-property
|
2022-04-27 09:35:20 +00:00
|
|
|
importlib-metadata
|
2020-04-24 23:36:52 +00:00
|
|
|
multipledispatch
|
|
|
|
numpy
|
2022-05-18 14:49:53 +00:00
|
|
|
packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
pandas
|
2022-01-23 02:10:13 +00:00
|
|
|
parsy
|
2022-04-27 09:35:20 +00:00
|
|
|
poetry-dynamic-versioning
|
|
|
|
pydantic
|
2020-04-24 23:36:52 +00:00
|
|
|
pytz
|
|
|
|
regex
|
2022-04-27 09:35:20 +00:00
|
|
|
tabulate
|
2022-01-23 02:10:13 +00:00
|
|
|
toolz
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
2022-01-23 02:10:13 +00:00
|
|
|
pytestCheckHook
|
|
|
|
click
|
2022-04-27 09:35:20 +00:00
|
|
|
pytest-benchmark
|
2022-01-23 02:10:13 +00:00
|
|
|
pytest-mock
|
2022-05-18 14:49:53 +00:00
|
|
|
pytest-randomly
|
2022-01-23 02:10:13 +00:00
|
|
|
pytest-xdist
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ lib.concatMap (name: passthru.optional-dependencies.${name}) testBackends;
|
2022-01-23 02:10:13 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
preBuild = ''
|
|
|
|
# setup.py exists only for developer convenience and is automatically generated
|
|
|
|
rm setup.py
|
|
|
|
'';
|
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
pytestFlagsArray = [
|
2022-04-27 09:35:20 +00:00
|
|
|
"--dist=loadgroup"
|
|
|
|
"-m"
|
2022-05-18 14:49:53 +00:00
|
|
|
"'${lib.concatStringsSep " or " testBackends} or core'"
|
2022-01-23 02:10:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
set -eo pipefail
|
2022-01-23 02:10:13 +00:00
|
|
|
|
|
|
|
export IBIS_TEST_DATA_DIRECTORY
|
|
|
|
IBIS_TEST_DATA_DIRECTORY="$(mktemp -d)"
|
|
|
|
|
|
|
|
# copy the test data to a writable directory
|
|
|
|
cp -r ${ibisTestingData}/* "$IBIS_TEST_DATA_DIRECTORY"
|
|
|
|
|
|
|
|
find "$IBIS_TEST_DATA_DIRECTORY" -type d -exec chmod u+rwx {} +
|
|
|
|
find "$IBIS_TEST_DATA_DIRECTORY" -type f -exec chmod u+rw {} +
|
|
|
|
|
|
|
|
# load data
|
2022-05-18 14:49:53 +00:00
|
|
|
for backend in ${lib.concatStringsSep " " testBackends}; do
|
2022-04-27 09:35:20 +00:00
|
|
|
${python.interpreter} ci/datamgr.py load "$backend"
|
2022-01-23 02:10:13 +00:00
|
|
|
done
|
2022-04-27 09:35:20 +00:00
|
|
|
'';
|
2022-01-23 02:10:13 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
postCheck = ''
|
|
|
|
rm -r "$IBIS_TEST_DATA_DIRECTORY"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"ibis"
|
2022-05-18 14:49:53 +00:00
|
|
|
] ++ map (backend: "ibis.backends.${backend}") testBackends;
|
|
|
|
|
|
|
|
passthru = {
|
2022-06-16 17:23:12 +00:00
|
|
|
optional-dependencies = {
|
2022-05-18 14:49:53 +00:00
|
|
|
clickhouse = [ clickhouse-cityhash clickhouse-driver lz4 ];
|
|
|
|
dask = [ dask pyarrow ];
|
|
|
|
datafusion = [ datafusion ];
|
|
|
|
duckdb = [ duckdb duckdb-engine sqlalchemy ];
|
|
|
|
geospatial = [ geoalchemy2 geopandas shapely ];
|
|
|
|
mysql = [ pymysql sqlalchemy ];
|
|
|
|
pandas = [ ];
|
|
|
|
postgres = [ psycopg2 sqlalchemy ];
|
|
|
|
pyspark = [ pyarrow pyspark ];
|
|
|
|
sqlite = [ sqlalchemy sqlite ];
|
|
|
|
visualization = [ graphviz-nox ];
|
|
|
|
};
|
|
|
|
};
|
2022-01-23 02:10:13 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Productivity-centric Python Big Data Framework";
|
|
|
|
homepage = "https://github.com/ibis-project/ibis";
|
|
|
|
license = licenses.asl20;
|
2022-01-23 02:10:13 +00:00
|
|
|
maintainers = with maintainers; [ costrouc cpcloud ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|