python3Packages.duckdb-engine: cleanup

Modernize build, remove `with lib;`, review & fixup disabledTests.
This commit is contained in:
Sarah Clark
2025-06-13 12:00:54 -07:00
parent 5e41161d3d
commit ef520344d2
@@ -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 ];
};
}