depot/third_party/nixpkgs/pkgs/development/python-modules/duckdb-engine/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

75 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
pythonAtLeast,
pythonOlder,
duckdb,
hypothesis,
pandas,
poetry-core,
pytest-remotedata,
snapshottest,
sqlalchemy,
typing-extensions,
}:
buildPythonPackage rec {
pname = "duckdb-engine";
version = "0.13.2";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
repo = "duckdb_engine";
owner = "Mause";
rev = "refs/tags/v${version}";
hash = "sha256-zao8kzzQbnjwJqjHyqDkgmXa3E9nlBH2W0wh7Kjk/qw=";
};
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
duckdb
sqlalchemy
];
preCheck = ''
export HOME="$(mktemp -d)"
'';
nativeCheckInputs = [ pytestCheckHook ];
checkInputs = [
hypothesis
pandas
pytest-remotedata
typing-extensions
] ++ lib.optionals (pythonOlder "3.12") [
# requires wasmer which is broken for python 3.12
# https://github.com/wasmerio/wasmer-python/issues/778
snapshottest
];
pytestFlagsArray = [
"-m"
"'not remote_data'"
];
disabledTestPaths = lib.optionals (pythonAtLeast "3.12") [
# requires snapshottest
"duckdb_engine/tests/test_datatypes.py"
];
pythonImportsCheck = [ "duckdb_engine" ];
meta = with lib; {
description = "SQLAlchemy driver for duckdb";
homepage = "https://github.com/Mause/duckdb_engine";
changelog = "https://github.com/Mause/duckdb_engine/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
};
}