From ef520344d284967dd6b611c9ff9d44eaf737b64a Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Fri, 13 Jun 2025 11:33:28 -0700 Subject: [PATCH 1/2] python3Packages.duckdb-engine: cleanup Modernize build, remove `with lib;`, review & fixup disabledTests. --- .../python-modules/duckdb-engine/default.nix | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/pkgs/development/python-modules/duckdb-engine/default.nix b/pkgs/development/python-modules/duckdb-engine/default.nix index 623f42d0eb9dd..9cef8f97eb501 100644 --- a/pkgs/development/python-modules/duckdb-engine/default.nix +++ b/pkgs/development/python-modules/duckdb-engine/default.nix @@ -2,18 +2,24 @@ lib, buildPythonPackage, fetchFromGitHub, - pytestCheckHook, - pythonAtLeast, - pythonOlder, - python, + + # build-system + poetry-core, + + # dependencies duckdb, + sqlalchemy, + + # testing hypothesis, pandas, pyarrow, - poetry-core, pytest-remotedata, + pytestCheckHook, + python, + pythonAtLeast, + pythonOlder, snapshottest, - sqlalchemy, typing-extensions, }: @@ -22,8 +28,6 @@ buildPythonPackage rec { version = "0.15.0"; pyproject = true; - disabled = pythonOlder "3.8"; - src = fetchFromGitHub { repo = "duckdb_engine"; owner = "Mause"; @@ -31,9 +35,9 @@ buildPythonPackage rec { hash = "sha256-mxv6xYO31MDzHvIf7Zk+kFtm6fX3x3AaJNn7RhvJ2fY="; }; - nativeBuildInputs = [ poetry-core ]; + build-system = [ poetry-core ]; - propagatedBuildInputs = [ + dependencies = [ duckdb sqlalchemy ]; @@ -48,9 +52,9 @@ buildPythonPackage rec { [ hypothesis pandas + pyarrow pytest-remotedata typing-extensions - pyarrow ] ++ lib.optionals (pythonOlder "3.12") [ # requires wasmer which is broken for python 3.12 @@ -68,27 +72,19 @@ buildPythonPackage rec { "duckdb_engine/tests/test_datatypes.py" ]; - disabledTests = - [ - # incompatible with duckdb 1.1.1 - "test_with_cache" - # these aren't set for some reason - "test_user_agent" - "test_user_agent_with_custom_user_agent" - ] - ++ lib.optionals (python.pythonVersion == "3.11") [ - # incompatible with duckdb 1.1.1 - "test_all_types_reflection" - "test_nested_types" - ]; + disabledTests = [ + # user agent not available in nixpkgs + "test_user_agent" + "test_user_agent_with_custom_user_agent" + ]; pythonImportsCheck = [ "duckdb_engine" ]; - meta = with lib; { + meta = { description = "SQLAlchemy driver for duckdb"; homepage = "https://github.com/Mause/duckdb_engine"; changelog = "https://github.com/Mause/duckdb_engine/blob/${src.tag}/CHANGELOG.md"; - license = licenses.mit; - maintainers = with maintainers; [ cpcloud ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ cpcloud ]; }; } From dc23d2066ec945617d4c01b7e36806ffb4c840c3 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Fri, 13 Jun 2025 11:37:35 -0700 Subject: [PATCH 2/2] python3Packages.duckdb-engine: 0.15.0 -> 0.17.0 changelog: https://github.com/Mause/duckdb_engine/releases/tag/v0.17.0 diff: https://github.com/Mause/duckdb_engine/compare/v0.15.0...v0.17.0 --- pkgs/development/python-modules/duckdb-engine/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/duckdb-engine/default.nix b/pkgs/development/python-modules/duckdb-engine/default.nix index 9cef8f97eb501..e45d274b666e2 100644 --- a/pkgs/development/python-modules/duckdb-engine/default.nix +++ b/pkgs/development/python-modules/duckdb-engine/default.nix @@ -11,12 +11,12 @@ sqlalchemy, # testing + fsspec, hypothesis, pandas, pyarrow, pytest-remotedata, pytestCheckHook, - python, pythonAtLeast, pythonOlder, snapshottest, @@ -25,14 +25,14 @@ buildPythonPackage rec { pname = "duckdb-engine"; - version = "0.15.0"; + version = "0.17.0"; pyproject = true; src = fetchFromGitHub { repo = "duckdb_engine"; owner = "Mause"; tag = "v${version}"; - hash = "sha256-mxv6xYO31MDzHvIf7Zk+kFtm6fX3x3AaJNn7RhvJ2fY="; + hash = "sha256-AhYCiIhi7jMWKIdDwZZ8MgfDg3F02/jooGLOp6E+E5g="; }; build-system = [ poetry-core ]; @@ -50,6 +50,7 @@ buildPythonPackage rec { checkInputs = [ + fsspec hypothesis pandas pyarrow