From 629df7b1e453e8872b6e42465f6c3a32aa348914 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Thu, 6 Nov 2025 13:01:21 +0000 Subject: [PATCH] gnu: python-duckdb: Move to duckdb. * gnu/packages/python-xyz.scm (python-duckdb): Move from here ... * gnu/packages/duckdb.scm: ... to here. * gnu/packages/python-science.scm: Add (gnu packages duckdb). Change-Id: Ic8551cdd64f718e62a12576fbc1a38bf861d1644 --- gnu/packages/duckdb.scm | 76 +++++++++++++++++++++++++++++++-- gnu/packages/python-science.scm | 1 + gnu/packages/python-xyz.scm | 62 +-------------------------- 3 files changed, 74 insertions(+), 65 deletions(-) diff --git a/gnu/packages/duckdb.scm b/gnu/packages/duckdb.scm index 222c53419b1a1bef3f557da9c086f13ad2de00b0..de7c4e160e0fd2ab4706f5ee4d65ee12a5173e4c 100644 --- a/gnu/packages/duckdb.scm +++ b/gnu/packages/duckdb.scm @@ -1,10 +1,10 @@ ;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023, 2024 Greg Hogan +;;; Copyright © 2023, 2025 Ricardo Wurmus ;;; Copyright © 2024 Felix Gruber -;;; Copyright © 2024 Greg Hogan ;;; Copyright © 2024 Nicolas Graves ;;; Copyright © 2024, 2025 Ekaitz Zarraga -;;; Copyright © 2025 Ricardo Wurmus -;;; Copyright © 2025 Sharlatan Hellseher +;;; Copyright © 2024, 2025 Sharlatan Hellseher ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,11 +24,18 @@ (define-module (gnu packages duckdb) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system cmake) + #:use-module (guix build-system pyproject) + #:use-module ((guix build-system python) #:select (pypi-uri)) + #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix utils) - #:use-module (gnu packages)) + #:use-module (gnu packages) + #:use-module (gnu packages databases) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-science) + #:use-module (gnu packages python-xyz)) ;;; Commentary: ;;; @@ -73,6 +80,67 @@ Multi-Version Concurrency Control}. Data can be stored in persistent, single-file databases with support for secondary indexes.") (license license:expat))) +;; XXX: Try to inherit from duckdb and build from source with all extensions. +(define-public python-duckdb + (package + (name "python-duckdb") + (version "1.3.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "duckdb" version)) + (sha256 + (base32 "1x8zb47y8lzc4w0g013sim8x9vd1h96ra3dd0bvh91y73f5dyn66")))) + (build-system pyproject-build-system) + (arguments + (list + #:tests? #f ;FIXME: See . + #:test-flags + #~(list "--ignore=tests/slow/test_h2oai_arrow.py" + ;; Do not relay on mypy. + "--ignore=tests/stubs/test_stubs.py" + "-k" (string-append + ;; Don't install anything, thank you. + "not test_install_non_existent_extension" + ;; _pybind11_conduit_v1_ not found. + " and not test_wrap_coverage" + ;; See . + " and not test_fetchmany" + ;; See . + " and not test_connection_interrupt" + " and not test_query_interruption")) + #:phases + #~(modify-phases %standard-phases + ;; Tests need this + (add-before 'check 'set-HOME + (lambda _ (setenv "HOME" "/tmp"))) + ;; Later versions of pybind replace "_" with "const_name". + (add-after 'unpack 'pybind-compatibility + (lambda _ + (with-directory-excursion "src/include/duckdb_python" + (substitute* '("python_objects.hpp" + "pyfilesystem.hpp" + "pybind11/conversions/pyconnection_default.hpp") + (("const_name") "_")))))))) + (propagated-inputs + (list python-adbc-driver-manager)) + (native-inputs + (list pybind11 + python-fsspec + ;; python-google-cloud-storage ;python-grpcio fails (see: guix/guix#1436) + python-numpy + python-pandas + python-psutil + ;; python-pytest + python-setuptools-scm + python-setuptools + python-wheel)) + (home-page "https://www.duckdb.org") + (synopsis "DuckDB embedded database") + (description "DuckDB is an in-process SQL OLAP database management +system.") + (license license:expat))) + ;;; ;;; Avoid adding new packages to the end of this file. To reduce the chances ;;; of a merge conflict, place them above in alphabetic order. diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 2c4f5fa8925d2a86bbf2c2d26e8329536318e5d1..f8d78f61cc8bbb7b8689b30e7ea10f49417fe86b 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -70,6 +70,7 @@ #:use-module (gnu packages crypto) #:use-module (gnu packages databases) #:use-module (gnu packages digest) + #:use-module (gnu packages duckdb) #:use-module (gnu packages gcc) #:use-module (gnu packages geo) #:use-module (gnu packages graphviz) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 198535bc0a1a36cf35aa3239b1047608a7a2d114..0720018c92dee5e0633ebb5668c7f2104510a5a4 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -217,6 +217,7 @@ #:use-module (gnu packages django) #:use-module (gnu packages djvu) #:use-module (gnu packages documentation) + #:use-module (gnu packages duckdb) #:use-module (gnu packages elf) #:use-module (gnu packages emulators) #:use-module (gnu packages enchant) @@ -23776,67 +23777,6 @@ runtime (rather than during a preprocessing step).") Mustache templating language renderer.") (license license:expat))) -;; XXX: Try to inherit from duckdb and build from source with all extensions. -(define-public python-duckdb - (package - (name "python-duckdb") - (version "1.3.2") - (source (origin - (method url-fetch) - (uri (pypi-uri "duckdb" version)) - (sha256 - (base32 - "1x8zb47y8lzc4w0g013sim8x9vd1h96ra3dd0bvh91y73f5dyn66")))) - (build-system pyproject-build-system) - (arguments - (list - #:tests? #f ;FIXME: See . - #:test-flags - #~(list "--ignore=tests/slow/test_h2oai_arrow.py" - ;; Do not relay on mypy. - "--ignore=tests/stubs/test_stubs.py" - "-k" (string-append - ;; Don't install anything, thank you. - "not test_install_non_existent_extension" - ;; _pybind11_conduit_v1_ not found. - " and not test_wrap_coverage" - ;; See . - " and not test_fetchmany" - ;; See . - " and not test_connection_interrupt" - " and not test_query_interruption")) - #:phases - #~(modify-phases %standard-phases - ;; Tests need this - (add-before 'check 'set-HOME - (lambda _ (setenv "HOME" "/tmp"))) - ;; Later versions of pybind replace "_" with "const_name". - (add-after 'unpack 'pybind-compatibility - (lambda _ - (with-directory-excursion "src/include/duckdb_python" - (substitute* '("python_objects.hpp" - "pyfilesystem.hpp" - "pybind11/conversions/pyconnection_default.hpp") - (("const_name") "_")))))))) - (propagated-inputs - (list python-adbc-driver-manager)) - (native-inputs - (list pybind11 - python-fsspec - ;; python-google-cloud-storage ;python-grpcio fails (see: guix/guix#1436) - python-numpy - python-pandas - python-psutil - ;; python-pytest - python-setuptools-scm - python-setuptools - python-wheel)) - (home-page "https://www.duckdb.org") - (synopsis "DuckDB embedded database") - (description "DuckDB is an in-process SQL OLAP database management -system.") - (license license:expat))) - (define-public python-dulwich (package (name "python-dulwich")