From d7248afb11a42f1009e34cefcbe5d1cefd205f20 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 28 Apr 2022 05:43:44 -0400 Subject: [PATCH 1/4] python3Packages.poetry-dynamic-versioning: init at 0.14.1 --- .../poetry-dynamic-versioning/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/poetry-dynamic-versioning/default.nix diff --git a/pkgs/development/python-modules/poetry-dynamic-versioning/default.nix b/pkgs/development/python-modules/poetry-dynamic-versioning/default.nix new file mode 100644 index 00000000000..35265b94e17 --- /dev/null +++ b/pkgs/development/python-modules/poetry-dynamic-versioning/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 51100fb611a..dc3c140b5ea 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6509,6 +6509,8 @@ in { 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 { }; poetry2conda = callPackage ../development/python-modules/poetry2conda { }; From 7b4363195be86e250a90fb5471e01f790872118c Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 28 Apr 2022 05:44:08 -0400 Subject: [PATCH 2/4] python3Packages.ipython-sql: init at 0.4.0 --- .../python-modules/ipython-sql/default.nix | 58 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/development/python-modules/ipython-sql/default.nix diff --git a/pkgs/development/python-modules/ipython-sql/default.nix b/pkgs/development/python-modules/ipython-sql/default.nix new file mode 100644 index 00000000000..1a86ae238be --- /dev/null +++ b/pkgs/development/python-modules/ipython-sql/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dc3c140b5ea..28b7d9978a1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4193,6 +4193,8 @@ in { ipython = callPackage ../development/python-modules/ipython { }; + ipython-sql = callPackage ../development/python-modules/ipython-sql { }; + ipyvue = callPackage ../development/python-modules/ipyvue { }; ipyvuetify = callPackage ../development/python-modules/ipyvuetify { }; From 4c139b0198fe074bbbb16a8678a1d53a10eb62f0 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 28 Apr 2022 05:44:34 -0400 Subject: [PATCH 3/4] python3Packages.duckdb-engine: init at 0.1.8 --- .../python-modules/duckdb-engine/default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/duckdb-engine/default.nix diff --git a/pkgs/development/python-modules/duckdb-engine/default.nix b/pkgs/development/python-modules/duckdb-engine/default.nix new file mode 100644 index 00000000000..fe7a95aba9b --- /dev/null +++ b/pkgs/development/python-modules/duckdb-engine/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 28b7d9978a1..12b1515dbcd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2530,6 +2530,8 @@ in { inherit (pkgs) duckdb; }; + duckdb-engine = callPackage ../development/python-modules/duckdb-engine { }; + duecredit = callPackage ../development/python-modules/duecredit { }; duet = callPackage ../development/python-modules/duet { }; From 95092c39941fdd951c2220de9e1b033157459e9f Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 28 Apr 2022 05:44:51 -0400 Subject: [PATCH 4/4] python3Packages.ibis-framework: 2.1.1 -> 3.0.2 --- .../python-modules/ibis-framework/default.nix | 81 ++++++++----------- 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/pkgs/development/python-modules/ibis-framework/default.nix b/pkgs/development/python-modules/ibis-framework/default.nix index 39d226bb956..dee63fb0856 100644 --- a/pkgs/development/python-modules/ibis-framework/default.nix +++ b/pkgs/development/python-modules/ibis-framework/default.nix @@ -8,6 +8,9 @@ , clickhouse-driver , click , dask +, datafusion +, duckdb +, duckdb-engine , graphviz , importlib-metadata , multipledispatch @@ -15,50 +18,51 @@ , pandas , parsy , poetry-core +, poetry-dynamic-versioning , pyarrow -, pytest +, pydantic +, pytest-benchmark , pytest-mock , pytest-xdist +, python , pytz , regex , requests , sqlalchemy -, tables +, sqlite +, tabulate , toolz }: let # ignore tests for which dependencies are not available backends = [ - "csv" "dask" - "hdf5" + "datafusion" + "duckdb" "pandas" - "parquet" "sqlite" ]; - backendsString = lib.concatStringsSep " " backends; - ibisTestingData = fetchFromGitHub { owner = "ibis-project"; repo = "testing-data"; - rev = "743201a35c6b968cf55b054f9d28949ea15d1f0a"; - sha256 = "sha256-xuSE6wHP3aF8lnEE2SuFbTRBu49ecRmc1F3HPcszptI="; + rev = "a88a4b3c3b54a88e7f77e59de70f5bf20fb62f19"; + sha256 = "sha256-BnRhVwPcWFwiBJ2ySgiiuUdnF4gesnTq1/dLcuvc868="; }; in buildPythonPackage rec { pname = "ibis-framework"; - version = "2.1.1"; + version = "3.0.2"; format = "pyproject"; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { repo = "ibis"; owner = "ibis-project"; rev = version; - hash = "sha256-n3fR6wvcSfIo7760seB+5SxtoYSqQmqkzZ9VlNQF200="; + hash = "sha256-7ywDMAHQAl39kiHfxVkq7voUEKqbb9Zq8qlaug7+ukI="; }; nativeBuildInputs = [ poetry-core ]; @@ -68,65 +72,48 @@ buildPythonPackage rec { cached-property clickhouse-driver dask + datafusion + duckdb + duckdb-engine graphviz + importlib-metadata multipledispatch numpy pandas parsy + poetry-dynamic-versioning pyarrow + pydantic pytz regex requests sqlalchemy - tables + tabulate toolz - ] ++ lib.optionals (pythonOlder "3.8" && lib.versionOlder version "3.0.0") [ - importlib-metadata ]; checkInputs = [ pytestCheckHook click - pytest + pytest-benchmark pytest-mock pytest-xdist + sqlite ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'atpublic = ">=2.3,<3"' 'atpublic = ">=2.3"' \ - --replace 'regex = "^2021.7.6"' 'regex = "*"' - ''; - preBuild = '' # setup.py exists only for developer convenience and is automatically generated 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 = [ - "ibis/tests" - "ibis/backends/tests" - "ibis/backends/{${lib.concatStringsSep "," backends}}/tests" + "--dist=loadgroup" + "-m" + "'${lib.concatStringsSep " or " backends} or core'" ]; preCheck = '' - set -euo pipefail + set -eo pipefail export IBIS_TEST_DATA_DIRECTORY IBIS_TEST_DATA_DIRECTORY="$(mktemp -d)" @@ -138,13 +125,13 @@ buildPythonPackage rec { find "$IBIS_TEST_DATA_DIRECTORY" -type f -exec chmod u+rw {} + # load data - for backend in ${backendsString}; do - python ci/datamgr.py "$backend" & + for backend in ${lib.concatStringsSep " " backends}; do + ${python.interpreter} ci/datamgr.py load "$backend" done + ''; - wait - '' + lib.optionalString (lib.versionOlder version "3.0.0") '' - export PYTEST_BACKENDS="${backendsString}" + postCheck = '' + rm -r "$IBIS_TEST_DATA_DIRECTORY" ''; pythonImportsCheck = [