2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
2024-07-27 06:49:29 +00:00
|
|
|
pythonAtLeast,
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonOlder,
|
|
|
|
duckdb,
|
|
|
|
hypothesis,
|
|
|
|
pandas,
|
|
|
|
poetry-core,
|
|
|
|
pytest-remotedata,
|
2024-07-27 06:49:29 +00:00
|
|
|
snapshottest,
|
2024-06-05 15:53:02 +00:00
|
|
|
sqlalchemy,
|
|
|
|
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-09-19 14:19:46 +00:00
|
|
|
version = "0.13.2";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "duckdb_engine";
|
|
|
|
owner = "Mause";
|
2022-12-02 08:20:57 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-zao8kzzQbnjwJqjHyqDkgmXa3E9nlBH2W0wh7Kjk/qw=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +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)"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
2022-08-21 13:32:41 +00:00
|
|
|
hypothesis
|
2024-05-15 15:35:15 +00:00
|
|
|
pandas
|
|
|
|
pytest-remotedata
|
2022-08-21 13:32:41 +00:00
|
|
|
typing-extensions
|
2024-07-27 06:49:29 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.12") [
|
|
|
|
# requires wasmer which is broken for python 3.12
|
|
|
|
# https://github.com/wasmerio/wasmer-python/issues/778
|
|
|
|
snapshottest
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pytestFlagsArray = [
|
2024-06-05 15:53:02 +00:00
|
|
|
"-m"
|
|
|
|
"'not remote_data'"
|
2024-05-15 15:35:15 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
disabledTestPaths = lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# requires snapshottest
|
|
|
|
"duckdb_engine/tests/test_datatypes.py"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +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 ];
|
|
|
|
};
|
|
|
|
}
|