2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, duckdb
|
|
|
|
, hypothesis
|
|
|
|
, ipython-sql
|
|
|
|
, poetry-core
|
2023-07-15 17:15:38 +00:00
|
|
|
, snapshottest
|
2022-04-27 09:35:20 +00:00
|
|
|
, sqlalchemy
|
2022-08-12 12:06:08 +00:00
|
|
|
, typing-extensions
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "duckdb-engine";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.11.2";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "duckdb_engine";
|
|
|
|
owner = "Mause";
|
2022-12-02 08:20:57 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-yW1gaZ0B6JNX98KzAxf146goniNmWnkMUmJRrScot1w=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
patches = [ ./remote_data.patch ];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
duckdb
|
|
|
|
sqlalchemy
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
2023-07-15 17:15:38 +00:00
|
|
|
# this test tries to download the httpfs extension
|
2022-09-22 12:36:57 +00:00
|
|
|
"test_preload_extension"
|
2023-10-09 19:29:22 +00:00
|
|
|
"test_motherduck"
|
2023-07-15 17:15:38 +00:00
|
|
|
# test should be skipped based on sqlalchemy version but isn't and fails
|
|
|
|
"test_commit"
|
2023-10-09 19:29:22 +00:00
|
|
|
# rowcount no longer generates an attribute error.
|
|
|
|
"test_rowcount"
|
2022-09-22 12:36:57 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-21 13:32:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
hypothesis
|
|
|
|
ipython-sql
|
2023-07-15 17:15:38 +00:00
|
|
|
# TODO(cpcloud): include pandas here when it supports sqlalchemy 2.0
|
|
|
|
snapshottest
|
2022-08-21 13:32:41 +00:00
|
|
|
typing-extensions
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"duckdb_engine"
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-08-21 13:32:41 +00:00
|
|
|
description = "SQLAlchemy driver for duckdb";
|
2022-04-27 09:35:20 +00:00
|
|
|
homepage = "https://github.com/Mause/duckdb_engine";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/Mause/duckdb_engine/blob/v${version}/CHANGELOG.md";
|
2022-04-27 09:35:20 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|