Merge pull request #170756 from cpcloud/bump-ibis-framework

python3Packages.ibis-framework: 2.1.1 -> 3.0.2
This commit is contained in:
Robert Scott 2022-05-01 16:19:54 +01:00 committed by GitHub
commit b455605c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 190 additions and 47 deletions

View File

@ -0,0 +1,40 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
, duckdb
, hypothesis
, ipython-sql
, poetry-core
, sqlalchemy
}:
buildPythonPackage rec {
pname = "duckdb-engine";
version = "0.1.8";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
repo = "duckdb_engine";
owner = "Mause";
rev = version;
hash = "sha256-dnm1nveCjrXFjDRykHp39AeVx7sk7Q/XwGn6hxdydT4=";
};
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [ duckdb sqlalchemy ];
checkInputs = [ pytestCheckHook hypothesis ipython-sql ];
pythonImportsCheck = [ "duckdb_engine" ];
meta = with lib; {
description = "Very very very basic sqlalchemy driver for duckdb";
homepage = "https://github.com/Mause/duckdb_engine";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
};
}

View File

@ -8,6 +8,9 @@
, clickhouse-driver , clickhouse-driver
, click , click
, dask , dask
, datafusion
, duckdb
, duckdb-engine
, graphviz , graphviz
, importlib-metadata , importlib-metadata
, multipledispatch , multipledispatch
@ -15,50 +18,51 @@
, pandas , pandas
, parsy , parsy
, poetry-core , poetry-core
, poetry-dynamic-versioning
, pyarrow , pyarrow
, pytest , pydantic
, pytest-benchmark
, pytest-mock , pytest-mock
, pytest-xdist , pytest-xdist
, python
, pytz , pytz
, regex , regex
, requests , requests
, sqlalchemy , sqlalchemy
, tables , sqlite
, tabulate
, toolz , toolz
}: }:
let let
# ignore tests for which dependencies are not available # ignore tests for which dependencies are not available
backends = [ backends = [
"csv"
"dask" "dask"
"hdf5" "datafusion"
"duckdb"
"pandas" "pandas"
"parquet"
"sqlite" "sqlite"
]; ];
backendsString = lib.concatStringsSep " " backends;
ibisTestingData = fetchFromGitHub { ibisTestingData = fetchFromGitHub {
owner = "ibis-project"; owner = "ibis-project";
repo = "testing-data"; repo = "testing-data";
rev = "743201a35c6b968cf55b054f9d28949ea15d1f0a"; rev = "a88a4b3c3b54a88e7f77e59de70f5bf20fb62f19";
sha256 = "sha256-xuSE6wHP3aF8lnEE2SuFbTRBu49ecRmc1F3HPcszptI="; sha256 = "sha256-BnRhVwPcWFwiBJ2ySgiiuUdnF4gesnTq1/dLcuvc868=";
}; };
in in
buildPythonPackage rec { buildPythonPackage rec {
pname = "ibis-framework"; pname = "ibis-framework";
version = "2.1.1"; version = "3.0.2";
format = "pyproject"; format = "pyproject";
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.8";
src = fetchFromGitHub { src = fetchFromGitHub {
repo = "ibis"; repo = "ibis";
owner = "ibis-project"; owner = "ibis-project";
rev = version; rev = version;
hash = "sha256-n3fR6wvcSfIo7760seB+5SxtoYSqQmqkzZ9VlNQF200="; hash = "sha256-7ywDMAHQAl39kiHfxVkq7voUEKqbb9Zq8qlaug7+ukI=";
}; };
nativeBuildInputs = [ poetry-core ]; nativeBuildInputs = [ poetry-core ];
@ -68,65 +72,48 @@ buildPythonPackage rec {
cached-property cached-property
clickhouse-driver clickhouse-driver
dask dask
datafusion
duckdb
duckdb-engine
graphviz graphviz
importlib-metadata
multipledispatch multipledispatch
numpy numpy
pandas pandas
parsy parsy
poetry-dynamic-versioning
pyarrow pyarrow
pydantic
pytz pytz
regex regex
requests requests
sqlalchemy sqlalchemy
tables tabulate
toolz toolz
] ++ lib.optionals (pythonOlder "3.8" && lib.versionOlder version "3.0.0") [
importlib-metadata
]; ];
checkInputs = [ checkInputs = [
pytestCheckHook pytestCheckHook
click click
pytest pytest-benchmark
pytest-mock pytest-mock
pytest-xdist pytest-xdist
sqlite
]; ];
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'atpublic = ">=2.3,<3"' 'atpublic = ">=2.3"' \
--replace 'regex = "^2021.7.6"' 'regex = "*"'
'';
preBuild = '' preBuild = ''
# setup.py exists only for developer convenience and is automatically generated # setup.py exists only for developer convenience and is automatically generated
rm setup.py rm setup.py
''; '';
disabledTests = [
# These tests are broken upstream: https://github.com/ibis-project/ibis/issues/3291
"test_summary_numeric"
"test_summary_non_numeric"
"test_batting_most_hits"
"test_join_with_window_function"
"test_where_long"
"test_quantile_groupby"
"test_summary_numeric"
"test_summary_numeric_group_by"
"test_summary_non_numeric"
"test_searched_case_column"
"test_simple_case_column"
"test_summary_non_numeric_group_by"
];
pytestFlagsArray = [ pytestFlagsArray = [
"ibis/tests" "--dist=loadgroup"
"ibis/backends/tests" "-m"
"ibis/backends/{${lib.concatStringsSep "," backends}}/tests" "'${lib.concatStringsSep " or " backends} or core'"
]; ];
preCheck = '' preCheck = ''
set -euo pipefail set -eo pipefail
export IBIS_TEST_DATA_DIRECTORY export IBIS_TEST_DATA_DIRECTORY
IBIS_TEST_DATA_DIRECTORY="$(mktemp -d)" IBIS_TEST_DATA_DIRECTORY="$(mktemp -d)"
@ -138,13 +125,13 @@ buildPythonPackage rec {
find "$IBIS_TEST_DATA_DIRECTORY" -type f -exec chmod u+rw {} + find "$IBIS_TEST_DATA_DIRECTORY" -type f -exec chmod u+rw {} +
# load data # load data
for backend in ${backendsString}; do for backend in ${lib.concatStringsSep " " backends}; do
python ci/datamgr.py "$backend" & ${python.interpreter} ci/datamgr.py load "$backend"
done done
'';
wait postCheck = ''
'' + lib.optionalString (lib.versionOlder version "3.0.0") '' rm -r "$IBIS_TEST_DATA_DIRECTORY"
export PYTEST_BACKENDS="${backendsString}"
''; '';
pythonImportsCheck = [ pythonImportsCheck = [

View File

@ -0,0 +1,58 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, ipython
, ipython_genutils
, pandas
, prettytable
, pytest
, sqlalchemy
, sqlparse
}:
buildPythonPackage rec {
pname = "ipython-sql";
version = "0.4.0";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "catherinedevlin";
repo = "ipython-sql";
rev = "117764caf099d80100ed4b09fc004b55eed6f121";
hash = "sha256-ScQihsvRSnC7VIgy8Tzi1z4x6KIZo0SAeLPvHAVdrfA=";
};
postPatch = ''
substituteInPlace setup.py --replace 'prettytable<1' prettytable
'';
propagatedBuildInputs = [
ipython
ipython_genutils
prettytable
sqlalchemy
sqlparse
];
checkInputs = [ ipython pandas pytest ];
checkPhase = ''
runHook preCheck
# running with ipython is required because the tests use objects available
# only inside of ipython, for example the global `get_ipython()` function
ipython -c 'import pytest; pytest.main()'
runHook postCheck
'';
pythonImportsCheck = [ "sql" ];
meta = with lib; {
description = "Introduces a %sql (or %%sql) magic.";
homepage = "https://github.com/catherinedevlin/ipython-sql";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
};
}

View File

@ -0,0 +1,52 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
, dunamai
, jinja2
, markupsafe
, poetry-core
, pytest
, tomlkit
}:
buildPythonPackage rec {
pname = "poetry-dynamic-versioning";
version = "0.14.1";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "mtkennerly";
repo = pname;
rev = "v${version}";
hash = "sha256-J/93BFyp+XBy9TRAzAM64ZcMurHxcXDTukOGJE5yvBk=";
};
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
dunamai
tomlkit
jinja2
markupsafe
];
checkInputs = [ pytestCheckHook ];
disabledTests = [
# these require .git, but leaveDotGit = true doesn't help
"test__get_version__defaults"
"test__get_version__format_jinja"
];
pythonImportsCheck = [ "poetry_dynamic_versioning" ];
meta = with lib; {
description = "Plugin for Poetry to enable dynamic versioning based on VCS tags";
homepage = "https://github.com/mtkennerly/poetry-dynamic-versioning";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
};
}

View File

@ -2530,6 +2530,8 @@ in {
inherit (pkgs) duckdb; inherit (pkgs) duckdb;
}; };
duckdb-engine = callPackage ../development/python-modules/duckdb-engine { };
duecredit = callPackage ../development/python-modules/duecredit { }; duecredit = callPackage ../development/python-modules/duecredit { };
duet = callPackage ../development/python-modules/duet { }; duet = callPackage ../development/python-modules/duet { };
@ -4193,6 +4195,8 @@ in {
ipython = callPackage ../development/python-modules/ipython { }; ipython = callPackage ../development/python-modules/ipython { };
ipython-sql = callPackage ../development/python-modules/ipython-sql { };
ipyvue = callPackage ../development/python-modules/ipyvue { }; ipyvue = callPackage ../development/python-modules/ipyvue { };
ipyvuetify = callPackage ../development/python-modules/ipyvuetify { }; ipyvuetify = callPackage ../development/python-modules/ipyvuetify { };
@ -6509,6 +6513,8 @@ in {
poetry-core = callPackage ../development/python-modules/poetry-core { }; poetry-core = callPackage ../development/python-modules/poetry-core { };
poetry-dynamic-versioning = callPackage ../development/python-modules/poetry-dynamic-versioning { };
poetry-semver = callPackage ../development/python-modules/poetry-semver { }; poetry-semver = callPackage ../development/python-modules/poetry-semver { };
poetry2conda = callPackage ../development/python-modules/poetry2conda { }; poetry2conda = callPackage ../development/python-modules/poetry2conda { };