2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
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,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2022-01-23 02:10:13 +00:00
|
|
|
let
|
2024-06-05 15:53:02 +00:00
|
|
|
testBackends = [
|
|
|
|
"datafusion"
|
|
|
|
"duckdb"
|
|
|
|
"pandas"
|
|
|
|
"sqlite"
|
|
|
|
];
|
2022-01-23 02:10:13 +00:00
|
|
|
|
|
|
|
ibisTestingData = fetchFromGitHub {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "ibis-testing-data";
|
2022-01-23 02:10:13 +00:00
|
|
|
owner = "ibis-project";
|
|
|
|
repo = "testing-data";
|
2024-06-20 14:57:18 +00:00
|
|
|
# https://github.com/ibis-project/ibis/blob/9.1.0/nix/overlay.nix#L20-L26
|
|
|
|
rev = "6737d1cb5951cabaccd095a3ae62a93dbd11ecb9";
|
|
|
|
hash = "sha256-MoVTZPWh4KVlrICYACrgfeLdl/fqoa1iweNg3zUtdrs=";
|
2022-01-23 02:10:13 +00:00
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ibis-framework";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "9.1.0";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
disabled = pythonOlder "3.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
src = fetchFromGitHub {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "ibis-source";
|
2022-01-23 02:10:13 +00:00
|
|
|
repo = "ibis";
|
|
|
|
owner = "ibis-project";
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-GmzmXzYMs7K7B//is3ZoD4muPAkb0tM56zFBbsA+NEo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
2023-08-22 20:05:09 +00:00
|
|
|
poetry-dynamic-versioning
|
2023-02-16 17:41:37 +00:00
|
|
|
];
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dontBypassPoetryDynamicVersioning = true;
|
|
|
|
env.POETRY_DYNAMIC_VERSIONING_BYPASS = lib.head (lib.strings.splitString "-" version);
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-01-23 02:10:13 +00:00
|
|
|
atpublic
|
2023-04-29 16:46:19 +00:00
|
|
|
bidict
|
2020-04-24 23:36:52 +00:00
|
|
|
multipledispatch
|
|
|
|
numpy
|
|
|
|
pandas
|
2022-01-23 02:10:13 +00:00
|
|
|
parsy
|
2023-08-22 20:05:09 +00:00
|
|
|
pyarrow
|
2024-02-29 20:09:43 +00:00
|
|
|
pyarrow-hotfix
|
2023-04-29 16:46:19 +00:00
|
|
|
python-dateutil
|
2020-04-24 23:36:52 +00:00
|
|
|
pytz
|
2022-09-22 12:36:57 +00:00
|
|
|
rich
|
2023-04-29 16:46:19 +00:00
|
|
|
sqlglot
|
2022-01-23 02:10:13 +00:00
|
|
|
toolz
|
2023-04-29 16:46:19 +00:00
|
|
|
typing-extensions
|
2024-02-29 20:09:43 +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
|
2024-02-29 20:09:43 +00:00
|
|
|
black
|
|
|
|
filelock
|
2023-02-16 17:41:37 +00:00
|
|
|
hypothesis
|
2022-04-27 09:35:20 +00:00
|
|
|
pytest-benchmark
|
2023-04-29 16:46:19 +00:00
|
|
|
pytest-httpserver
|
2022-01-23 02:10:13 +00:00
|
|
|
pytest-mock
|
2022-05-18 14:49:53 +00:00
|
|
|
pytest-randomly
|
2023-02-16 17:41:37 +00:00
|
|
|
pytest-snapshot
|
2024-05-15 15:35:15 +00:00
|
|
|
pytest-timeout
|
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
|
|
|
|
|
|
|
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'"
|
2024-02-29 20:09:43 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2023-04-29 16:46:19 +00:00
|
|
|
# tries to download duckdb extensions
|
2024-05-15 15:35:15 +00:00
|
|
|
"test_attach_sqlite"
|
|
|
|
"test_connect_extensions"
|
|
|
|
"test_load_extension"
|
2024-02-29 20:09:43 +00:00
|
|
|
"test_read_sqlite"
|
2024-05-15 15:35:15 +00:00
|
|
|
"test_register_sqlite"
|
2024-06-20 14:57:18 +00:00
|
|
|
# requires network connection
|
2024-02-29 20:09:43 +00:00
|
|
|
"test_s3_403_fallback"
|
2024-06-20 14:57:18 +00:00
|
|
|
# requires pytest 8.2+
|
|
|
|
"test_roundtrip_delta"
|
2022-01-23 02:10:13 +00:00
|
|
|
];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
# 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' {} +
|
|
|
|
'';
|
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
preCheck = ''
|
2023-04-29 16:46:19 +00:00
|
|
|
HOME="$TMPDIR"
|
|
|
|
export IBIS_TEST_DATA_DIRECTORY="ci/ibis-testing-data"
|
2022-09-22 12:36:57 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# copy the test data to a directory
|
2023-08-22 20:05:09 +00:00
|
|
|
ln -s "${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
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ibis" ] ++ map (backend: "ibis.backends.${backend}") testBackends;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
passthru = {
|
2022-06-16 17:23:12 +00:00
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
bigquery = [
|
|
|
|
db-dtypes
|
|
|
|
google-cloud-bigquery
|
|
|
|
google-cloud-bigquery-storage
|
|
|
|
pydata-google-auth
|
|
|
|
];
|
2024-06-20 14:57:18 +00:00
|
|
|
clickhouse = [ clickhouse-connect ];
|
2024-06-05 15:53:02 +00:00
|
|
|
dask = [
|
|
|
|
dask
|
|
|
|
regex
|
2024-06-20 14:57:18 +00:00
|
|
|
packaging
|
2024-06-05 15:53:02 +00:00
|
|
|
];
|
2022-05-18 14:49:53 +00:00
|
|
|
datafusion = [ datafusion ];
|
2024-06-20 14:57:18 +00:00
|
|
|
druid = [ pydruid ];
|
|
|
|
duckdb = [ duckdb ];
|
2023-08-22 20:05:09 +00:00
|
|
|
flink = [ ];
|
2024-06-05 15:53:02 +00:00
|
|
|
geospatial = [
|
|
|
|
geopandas
|
|
|
|
shapely
|
|
|
|
];
|
2024-06-20 14:57:18 +00:00
|
|
|
mssql = [ pyodbc ];
|
|
|
|
mysql = [ pymysql ];
|
2024-06-05 15:53:02 +00:00
|
|
|
oracle = [
|
|
|
|
oracledb
|
|
|
|
packaging
|
|
|
|
];
|
2024-06-20 14:57:18 +00:00
|
|
|
pandas = [
|
|
|
|
regex
|
|
|
|
packaging
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
polars = [
|
|
|
|
polars
|
|
|
|
packaging
|
|
|
|
];
|
2024-06-20 14:57:18 +00:00
|
|
|
postgres = [ psycopg2 ];
|
2024-06-05 15:53:02 +00:00
|
|
|
pyspark = [
|
|
|
|
pyspark
|
|
|
|
packaging
|
|
|
|
];
|
2024-06-20 14:57:18 +00:00
|
|
|
snowflake = [ snowflake-connector-python ];
|
|
|
|
sqlite = [ regex ];
|
|
|
|
trino = [ trino-python-client ];
|
2024-02-29 20:09:43 +00:00
|
|
|
visualization = [ graphviz ];
|
2023-04-29 16:46:19 +00:00
|
|
|
decompiler = [ black ];
|
2024-02-29 20:09:43 +00:00
|
|
|
examples = [ pins ] ++ pins.optional-dependencies.gcs;
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
};
|
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";
|
2023-04-29 16:46:19 +00:00
|
|
|
changelog = "https://github.com/ibis-project/ibis/blob/${version}/docs/release_notes.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|