17 buildPythonPackage rec {
28 (duckdb.postPatch or "")
30 # we can't use sourceRoot otherwise patches don't apply, because the patches apply to the C++ library
33 # 1. let nix control build cores
34 # 2. default to extension autoload & autoinstall disabled
35 substituteInPlace setup.py \
36 --replace-fail "ParallelCompile()" 'ParallelCompile("NIX_BUILD_CORES")' \
37 --replace-fail "define_macros.extend([('DUCKDB_EXTENSION_AUTOLOAD_DEFAULT', '1'), ('DUCKDB_EXTENSION_AUTOINSTALL_DEFAULT', '1')])" "pass"
42 DUCKDB_BUILD_UNITY = 1;
43 OVERRIDE_GIT_DESCRIBE = "v${version}-0-g${rev}";
51 buildInputs = [ openssl ];
53 propagatedBuildInputs = [
65 # test flags from .github/workflows/Python.yml
66 pytestFlagsArray = [ "--verbose" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "tests/fast" ];
69 # avoid dependency on mypy
70 "tests/stubs/test_stubs.py"
74 # tries to make http request
75 "test_install_non_existent_extension"
77 # test is flaky https://github.com/duckdb/duckdb/issues/11961
80 # https://github.com/duckdb/duckdb/issues/10702
81 # tests are racy and interrupt can be delivered before or after target point
82 # causing a later test to fail with a spurious KeyboardInterrupt
83 "test_connection_interrupt"
84 "test_query_interruption"
87 # remove duckdb dir to prevent import confusion by pytest
89 export HOME="$(mktemp -d)"
93 pythonImportsCheck = [ "duckdb" ];
96 description = "Python binding for DuckDB";
97 homepage = "https://duckdb.org/";
98 license = licenses.mit;
99 maintainers = with maintainers; [ cpcloud ];