From 96e5ab89864c50037842880890d52a7c4a9b8570 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sat, 30 Apr 2022 11:28:31 -0400 Subject: [PATCH 1/2] python3Packages.ibis-framework: allow setting features for backend deps --- .../python-modules/ibis-framework/default.nix | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/ibis-framework/default.nix b/pkgs/development/python-modules/ibis-framework/default.nix index dee63fb0856d..cf018e8b7cc8 100644 --- a/pkgs/development/python-modules/ibis-framework/default.nix +++ b/pkgs/development/python-modules/ibis-framework/default.nix @@ -5,37 +5,45 @@ , pytestCheckHook , atpublic , cached-property -, clickhouse-driver , click +, clickhouse-cityhash +, clickhouse-driver , dask , datafusion , duckdb , duckdb-engine +, geoalchemy2 +, geopandas , graphviz , importlib-metadata +, 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 -, requests +, shapely , sqlalchemy , sqlite , tabulate , toolz }: let - # ignore tests for which dependencies are not available - backends = [ + testBackends = [ "dask" "datafusion" "duckdb" @@ -70,24 +78,16 @@ buildPythonPackage rec { propagatedBuildInputs = [ atpublic cached-property - clickhouse-driver - dask - datafusion - duckdb - duckdb-engine - graphviz importlib-metadata multipledispatch numpy + packaging pandas parsy poetry-dynamic-versioning - pyarrow pydantic pytz regex - requests - sqlalchemy tabulate toolz ]; @@ -97,9 +97,9 @@ buildPythonPackage rec { click pytest-benchmark pytest-mock + pytest-randomly pytest-xdist - sqlite - ]; + ] ++ lib.concatMap (name: passthru.extras-require.${name}) testBackends; preBuild = '' # setup.py exists only for developer convenience and is automatically generated @@ -109,7 +109,7 @@ buildPythonPackage rec { pytestFlagsArray = [ "--dist=loadgroup" "-m" - "'${lib.concatStringsSep " or " backends} or core'" + "'${lib.concatStringsSep " or " testBackends} or core'" ]; preCheck = '' @@ -125,7 +125,7 @@ buildPythonPackage rec { find "$IBIS_TEST_DATA_DIRECTORY" -type f -exec chmod u+rw {} + # load data - for backend in ${lib.concatStringsSep " " backends}; do + for backend in ${lib.concatStringsSep " " testBackends}; do ${python.interpreter} ci/datamgr.py load "$backend" done ''; @@ -136,7 +136,23 @@ buildPythonPackage rec { pythonImportsCheck = [ "ibis" - ] ++ (map (backend: "ibis.backends.${backend}") backends); + ] ++ map (backend: "ibis.backends.${backend}") testBackends; + + passthru = { + extras-require = { + 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 ]; + }; + }; meta = with lib; { description = "Productivity-centric Python Big Data Framework"; From 7bfe1e3b52944e520109ca94c1df3d1f2826a128 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 3 May 2022 05:17:13 -0400 Subject: [PATCH 2/2] python3Packages.ibis-framework: depend on graphviz-nox instead of graphviz --- pkgs/development/python-modules/ibis-framework/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/ibis-framework/default.nix b/pkgs/development/python-modules/ibis-framework/default.nix index cf018e8b7cc8..c5dfcc13e5c4 100644 --- a/pkgs/development/python-modules/ibis-framework/default.nix +++ b/pkgs/development/python-modules/ibis-framework/default.nix @@ -14,7 +14,7 @@ , duckdb-engine , geoalchemy2 , geopandas -, graphviz +, graphviz-nox , importlib-metadata , lz4 , multipledispatch