about summary refs log tree commit diff
path: root/pkgs/development/python-modules/duckdb/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/duckdb/default.nix')
-rw-r--r--pkgs/development/python-modules/duckdb/default.nix70
1 files changed, 38 insertions, 32 deletions
diff --git a/pkgs/development/python-modules/duckdb/default.nix b/pkgs/development/python-modules/duckdb/default.nix
index 34f20998ef3d5..132f72d70ee5f 100644
--- a/pkgs/development/python-modules/duckdb/default.nix
+++ b/pkgs/development/python-modules/duckdb/default.nix
@@ -1,37 +1,46 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, duckdb
-, fsspec
-, google-cloud-storage
-, numpy
-, openssl
-, pandas
-, psutil
-, pybind11
-, setuptools-scm
-, pytestCheckHook
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  duckdb,
+  fsspec,
+  google-cloud-storage,
+  numpy,
+  openssl,
+  pandas,
+  psutil,
+  pybind11,
+  setuptools-scm,
+  pytestCheckHook,
 }:
 
 buildPythonPackage rec {
-  inherit (duckdb) patches pname rev src version;
+  inherit (duckdb)
+    patches
+    pname
+    rev
+    src
+    version
+    ;
   pyproject = true;
 
-  postPatch = (duckdb.postPatch or "") + ''
-    # we can't use sourceRoot otherwise patches don't apply, because the patches apply to the C++ library
-    cd tools/pythonpkg
+  postPatch =
+    (duckdb.postPatch or "")
+    + ''
+      # we can't use sourceRoot otherwise patches don't apply, because the patches apply to the C++ library
+      cd tools/pythonpkg
 
-    # 1. let nix control build cores
-    # 2. default to extension autoload & autoinstall disabled
-    substituteInPlace setup.py \
-      --replace-fail "ParallelCompile()" 'ParallelCompile("NIX_BUILD_CORES")' \
-      --replace-fail "define_macros.extend([('DUCKDB_EXTENSION_AUTOLOAD_DEFAULT', '1'), ('DUCKDB_EXTENSION_AUTOINSTALL_DEFAULT', '1')])" "pass"
-  '';
+      # 1. let nix control build cores
+      # 2. default to extension autoload & autoinstall disabled
+      substituteInPlace setup.py \
+        --replace-fail "ParallelCompile()" 'ParallelCompile("NIX_BUILD_CORES")' \
+        --replace-fail "define_macros.extend([('DUCKDB_EXTENSION_AUTOLOAD_DEFAULT', '1'), ('DUCKDB_EXTENSION_AUTOINSTALL_DEFAULT', '1')])" "pass"
+    '';
 
   env = {
     BUILD_HTTPFS = 1;
     DUCKDB_BUILD_UNITY = 1;
-    OVERRIDE_GIT_DESCRIBE="v${version}-0-g${rev}";
+    OVERRIDE_GIT_DESCRIBE = "v${version}-0-g${rev}";
   };
 
   nativeBuildInputs = [
@@ -54,11 +63,7 @@ buildPythonPackage rec {
   ];
 
   # test flags from .github/workflows/Python.yml
-  pytestFlagsArray = [
-    "--verbose"
-  ] ++ lib.optionals stdenv.isDarwin [
-    "tests/fast"
-  ];
+  pytestFlagsArray = [ "--verbose" ] ++ lib.optionals stdenv.isDarwin [ "tests/fast" ];
 
   disabledTestPaths = [
     # avoid dependency on mypy
@@ -69,6 +74,9 @@ buildPythonPackage rec {
     # tries to make http request
     "test_install_non_existent_extension"
 
+    # test is flaky https://github.com/duckdb/duckdb/issues/11961
+    "test_fetchmany"
+
     # https://github.com/duckdb/duckdb/issues/10702
     # tests are racy and interrupt can be delivered before or after target point
     # causing a later test to fail with a spurious KeyboardInterrupt
@@ -82,9 +90,7 @@ buildPythonPackage rec {
     rm -rf duckdb
   '';
 
-  pythonImportsCheck = [
-    "duckdb"
-  ];
+  pythonImportsCheck = [ "duckdb" ];
 
   meta = with lib; {
     description = "Python binding for DuckDB";