%global pypi_name duckdb Name: python-%{pypi_name} Version: 1.5.6 Release: 1%{?dist} Summary: DuckDB in-process SQL OLAP database for Python # DuckDB itself is MIT. The sdist carries the DuckDB engine (external/duckdb) # with its third-party code, all of which ends up in the one extension module # _duckdb.so. Audited 2026-10-11 from the f44 build log (third_party/ sources # compiled) plus the header-only libraries src/ and the four built-in # extensions include; tags follow Fedora's own package for each library: # MIT: duckdb, brotli, fast_float, fmt, fsst, httplib, # hyperloglog, jaro_winkler, miniz, skiplist, # vergesort, yyjson # MIT AND Unicode-DFS-2015: utf8proc # BSD-2-Clause: jemalloc, lz4 (library part) # BSD-3-Clause: re2, snappy # BSD-3-Clause AND PostgreSQL: libpg_query (the PostgreSQL parser) # BSD-3-Clause OR GPL-2.0-only: zstd # Apache-2.0: parquet, thrift, fastpforlib # Apache-2.0 OR GPL-2.0-or-later: mbedtls # BSD-2-Clause OR BSL-1.0: concurrentqueue # BSL-1.0: ska_sort # Zlib: pdqsort # ICU (icu extension), as Fedora's libicu: Unicode-DFS-2016 AND BSD-2-Clause # AND BSD-3-Clause AND NAIST-2003 AND # LicenseRef-Fedora-Public-Domain License: MIT AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND BSD-2-Clause AND BSD-3-Clause AND PostgreSQL AND Apache-2.0 AND BSL-1.0 AND Zlib AND NAIST-2003 AND LicenseRef-Fedora-Public-Domain AND (BSD-3-Clause OR GPL-2.0-only) AND (Apache-2.0 OR GPL-2.0-or-later) AND (BSD-2-Clause OR BSL-1.0) URL: https://github.com/duckdb/duckdb-python Source0: %{pypi_source %{pypi_name} %{version}} BuildRequires: python3-devel BuildRequires: gcc-c++ BuildRequires: cmake >= 3.29 BuildRequires: ninja-build BuildRequires: python3-pybind11 BuildRequires: pybind11-devel # Smoke tests in %%check. BuildRequires: python3-pandas BuildRequires: python3-pyarrow BuildRequires: python3-numpy %global _description %{expand: DuckDB is an in-process SQL OLAP database. It runs analytical queries directly on Pandas data frames, Arrow tables, Parquet, CSV and JSON files without a server. The Imaging Data Commons client (idc-index) uses it to query its index.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} # DuckDB keeps private, namespaced (and mostly patched) copies of these # libraries and links them statically into _duckdb.so; they cannot be unbundled. Provides: bundled(duckdb) = %{version} Provides: bundled(brotli) Provides: bundled(concurrentqueue) Provides: bundled(fast_float) Provides: bundled(fastpforlib) Provides: bundled(fmt) Provides: bundled(fsst) Provides: bundled(httplib) Provides: bundled(hyperloglog) Provides: bundled(jaro_winkler) Provides: bundled(jemalloc) Provides: bundled(libpg_query) Provides: bundled(lz4) Provides: bundled(mbedtls) Provides: bundled(miniz) Provides: bundled(parquet) Provides: bundled(pdqsort) Provides: bundled(re2) Provides: bundled(ska_sort) Provides: bundled(skiplist) Provides: bundled(snappy) Provides: bundled(thrift) Provides: bundled(utf8proc) Provides: bundled(vergesort) Provides: bundled(yyjson) Provides: bundled(zstd) Provides: bundled(icu) %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{pypi_name}-%{version} # pybind11[global] only installs the headers and CMake config system-wide, # which Fedora's pybind11-devel already does; the extra is not packaged. sed -i 's/"pybind11\[global\]>=2.6.0"/"pybind11>=2.6.0"/' pyproject.toml grep -q '"pybind11>=2.6.0"' pyproject.toml %generate_buildrequires %pyproject_buildrequires %build # Parallelism comes from the builder; on legion pass --define '_smp_ncpus_max 8'. export CMAKE_BUILD_PARALLEL_LEVEL=%{_smp_build_ncpus} # %%pyproject_wheel takes its -C options on one line (no continuation lines). # Auto-install off: DuckDB would otherwise download unpackaged extension # binaries on first use of e.g. httpfs; the built-in ones are compiled in. %pyproject_wheel -Ccmake.build-type=RelWithDebInfo -Ccmake.define.NATIVE_ARCH=OFF -Ccmake.define.ENABLE_EXTENSION_AUTOINSTALL=OFF -Cbuild-dir=_skbuild %install %pyproject_install %pyproject_save_files %{pypi_name} _duckdb adbc_driver_duckdb '_duckdb-stubs' %check # Optional integrations whose libraries are not dependencies here: the Spark # API emulation (typing_extensions), fsspec filesystems and Polars. %pyproject_check_import -e adbc_driver_duckdb -e 'adbc_driver_duckdb.*' -e 'duckdb.experimental*' -e duckdb.filesystem -e duckdb.polars_io # The version the engine reports, not a git-describe fallback. %{py3_test_envvars} %{python3} - <<'EOF' import duckdb, pandas as pd, pyarrow as pa, pyarrow.parquet as pq, tempfile, os assert duckdb.__version__ == "%{version}", duckdb.__version__ v = duckdb.sql("select version()").fetchone()[0] assert v.lstrip("v").startswith("%{version}"), v # Parquet round trip and a query over it, the way idc-index uses DuckDB. d = tempfile.mkdtemp() p = os.path.join(d, "t.parquet") pq.write_table(pa.table({"Modality": ["CT", "MR", "CT"], "series_size_MB": [10.5, 3.0, 7.25]}), p) r = duckdb.query(f"select Modality, sum(series_size_MB) s from '{p}' group by 1 order by 1").df() assert r.to_dict("list") == {"Modality": ["CT", "MR"], "s": [17.75, 3.0]}, r # A pandas frame queried by name. df = pd.DataFrame({"x": [1, 2, 3]}) assert duckdb.sql("select sum(x) from df").fetchone()[0] == 6 # Built-in extensions compiled in, and auto-install switched off. exts = dict(duckdb.sql("select extension_name, loaded from duckdb_extensions()").fetchall()) for e in ("parquet", "json", "icu", "core_functions"): assert e in exts, (e, exts) assert duckdb.sql("select current_setting('autoinstall_known_extensions')").fetchone()[0] is False print("duckdb", v, "OK") EOF %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Sun Oct 11 2026 Morgan Hough - 1.5.6-1 - Initial package, for the Imaging Data Commons client (idc-index)