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
|
|
|
|
, 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-08-21 13:32:41 +00:00
|
|
|
, filelock
|
2022-05-18 14:49:53 +00:00
|
|
|
, geoalchemy2
|
|
|
|
, geopandas
|
|
|
|
, graphviz-nox
|
|
|
|
, 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-09-22 12:36:57 +00:00
|
|
|
, rich
|
2022-08-21 13:32:41 +00:00
|
|
|
, rsync
|
2022-05-18 14:49:53 +00:00
|
|
|
, shapely
|
2020-04-24 23:36:52 +00:00
|
|
|
, sqlalchemy
|
2022-09-22 12:36:57 +00:00
|
|
|
, sqlglot
|
2022-04-27 09:35:20 +00:00
|
|
|
, sqlite
|
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-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-08-21 13:32:41 +00:00
|
|
|
rev = "3c39abfdb4b284140ff481e8f9fbb128b35f157a";
|
|
|
|
sha256 = "sha256-BZWi4kEumZemQeYoAtlUSw922p+R6opSWp/bmX0DjAo=";
|
2022-01-23 02:10:13 +00:00
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ibis-framework";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "3.2.0";
|
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-09-22 12:36:57 +00:00
|
|
|
hash = "sha256-YRP1nGJs4btqXQirm0GfEDKNPCVXexVrwQ6sE8JtD2o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
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
|
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-09-22 12:36:57 +00:00
|
|
|
rich
|
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
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-23 02:10:13 +00:00
|
|
|
pytestCheckHook
|
|
|
|
click
|
2022-08-21 13:32:41 +00:00
|
|
|
filelock
|
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-08-21 13:32:41 +00:00
|
|
|
rsync
|
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
|
2022-08-21 13:32:41 +00:00
|
|
|
# it gets in the way in nixpkgs so we remove it
|
2022-02-20 05:27:41 +00:00
|
|
|
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-08-21 13:32:41 +00:00
|
|
|
# this test fails on nixpkgs datafusion version (0.4.0), but works on
|
|
|
|
# datafusion 0.6.0
|
|
|
|
"-k"
|
|
|
|
"'not datafusion-no_op'"
|
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
|
2022-09-22 12:36:57 +00:00
|
|
|
IBIS_TEST_DATA_DIRECTORY="ci/ibis-testing-data"
|
|
|
|
|
|
|
|
mkdir -p "$IBIS_TEST_DATA_DIRECTORY"
|
2022-01-23 02:10:13 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# copy the test data to a directory
|
|
|
|
rsync --chmod=Du+rwx,Fu+rw --archive "${ibisTestingData}/" "$IBIS_TEST_DATA_DIRECTORY"
|
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-09-22 12:36:57 +00:00
|
|
|
clickhouse = [ clickhouse-cityhash clickhouse-driver lz4 sqlglot ];
|
2022-05-18 14:49:53 +00:00
|
|
|
dask = [ dask pyarrow ];
|
|
|
|
datafusion = [ datafusion ];
|
2022-09-22 12:36:57 +00:00
|
|
|
duckdb = [ duckdb duckdb-engine pyarrow sqlalchemy sqlglot ];
|
2022-05-18 14:49:53 +00:00
|
|
|
geospatial = [ geoalchemy2 geopandas shapely ];
|
2022-09-22 12:36:57 +00:00
|
|
|
mysql = [ sqlalchemy pymysql sqlglot ];
|
2022-05-18 14:49:53 +00:00
|
|
|
pandas = [ ];
|
2022-09-22 12:36:57 +00:00
|
|
|
postgres = [ psycopg2 sqlalchemy sqlglot ];
|
2022-05-18 14:49:53 +00:00
|
|
|
pyspark = [ pyarrow pyspark ];
|
2022-09-22 12:36:57 +00:00
|
|
|
sqlite = [ sqlalchemy sqlite sqlglot ];
|
2022-05-18 14:49:53 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|