From ba63d2f8da23b6e847361c7221d328e992e6b587 Mon Sep 17 00:00:00 2001 From: Rob <86313040+robert-manchester@users.noreply.github.com> Date: Tue, 10 Oct 2023 00:45:34 -0700 Subject: duckdb: 0.9.0 -> 0.9.1 changelog https://github.com/duckdb/duckdb/releases/tag/v0.9.1 --- pkgs/development/libraries/duckdb/default.nix | 10 +++++--- pkgs/development/libraries/duckdb/version.patch | 22 ---------------- pkgs/development/python-modules/duckdb/default.nix | 14 +++++----- pkgs/development/python-modules/duckdb/setup.patch | 30 ++++++++++++++++++++++ 4 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 pkgs/development/python-modules/duckdb/setup.patch diff --git a/pkgs/development/libraries/duckdb/default.nix b/pkgs/development/libraries/duckdb/default.nix index ea152c0cc099d..c9f6711780b0b 100644 --- a/pkgs/development/libraries/duckdb/default.nix +++ b/pkgs/development/libraries/duckdb/default.nix @@ -15,13 +15,13 @@ let in stdenv.mkDerivation rec { pname = "duckdb"; - version = "0.9.0"; + version = "0.9.1"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - hash = "sha256-EKvDH7RwOC4Gu/lturrfnGpzXnJ9azIwAFeuVoa6L/Y="; + hash = "sha256-UG/vV/6WxVLq9mdze8pSDFJIekOgGsg93dzMq6eP6Dg="; }; patches = [ ./version.patch ]; @@ -106,10 +106,12 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - homepage = "https://github.com/duckdb/duckdb"; + changelog = "https://github.com/duckdb/duckdb/releases/tag/v${version}"; description = "Embeddable SQL OLAP Database Management System"; + homepage = "https://duckdb.org/"; license = licenses.mit; - platforms = platforms.all; + mainProgram = "duckdb"; maintainers = with maintainers; [ costrouc cpcloud ]; + platforms = platforms.all; }; } diff --git a/pkgs/development/libraries/duckdb/version.patch b/pkgs/development/libraries/duckdb/version.patch index 9b368eac5dbc6..f40785b430797 100644 --- a/pkgs/development/libraries/duckdb/version.patch +++ b/pkgs/development/libraries/duckdb/version.patch @@ -56,25 +56,3 @@ index 2b49e11288..0a4a69b9a0 100644 message(STATUS "git hash ${GIT_COMMIT_HASH}, version ${DUCKDB_VERSION}") -diff --git a/tools/pythonpkg/setup.py b/tools/pythonpkg/setup.py -index fdf2911019..c363cc518a 100644 ---- a/tools/pythonpkg/setup.py -+++ b/tools/pythonpkg/setup.py -@@ -163,8 +163,6 @@ if 'BUILD_HTTPFS' in os.environ: - for ext in extensions: - toolchain_args.extend(['-DDUCKDB_EXTENSION_{}_LINKED'.format(ext.upper())]) - --toolchain_args.extend(['-DDUCKDB_EXTENSION_AUTOLOAD_DEFAULT=1', '-DDUCKDB_EXTENSION_AUTOINSTALL_DEFAULT=1']) -- - - class get_pybind_include(object): - def __init__(self, user=False): -@@ -343,7 +341,7 @@ setup( - packages=packages, - include_package_data=True, - python_requires='>=3.7.0', -- setup_requires=setup_requires + ["setuptools_scm<7.0.0", 'pybind11>=2.6.0'], -+ setup_requires=setup_requires + ["setuptools_scm", 'pybind11>=2.6.0'], - use_scm_version=setuptools_scm_conf, - tests_require=['google-cloud-storage', 'mypy', 'pytest'], - classifiers=[ diff --git a/pkgs/development/python-modules/duckdb/default.nix b/pkgs/development/python-modules/duckdb/default.nix index e9aac74d835e7..37ddad2cd045c 100644 --- a/pkgs/development/python-modules/duckdb/default.nix +++ b/pkgs/development/python-modules/duckdb/default.nix @@ -13,17 +13,19 @@ }: buildPythonPackage rec { - inherit (duckdb) pname version src patches; + inherit (duckdb) pname version src; format = "setuptools"; - postPatch = '' + # 1. let nix control build cores + # 2. default to extension autoload & autoinstall disabled + # 3. unconstrain setuptools_scm version + patches = (duckdb.patches or []) ++ [ ./setup.patch ]; + + 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. unconstrain setuptools_scm version - substituteInPlace setup.py \ - --replace "multiprocessing.cpu_count()" "$NIX_BUILD_CORES" + substituteInPlace setup.py --subst-var NIX_BUILD_CORES # avoid dependency on mypy rm tests/stubs/test_stubs.py diff --git a/pkgs/development/python-modules/duckdb/setup.patch b/pkgs/development/python-modules/duckdb/setup.patch new file mode 100644 index 0000000000000..8c8f790a66a1d --- /dev/null +++ b/pkgs/development/python-modules/duckdb/setup.patch @@ -0,0 +1,30 @@ +diff --git a/tools/pythonpkg/setup.py b/tools/pythonpkg/setup.py +index 30f1e1ccdd..6784169fcb 100644 +--- a/tools/pythonpkg/setup.py ++++ b/tools/pythonpkg/setup.py +@@ -96,7 +96,7 @@ def parallel_cpp_compile( + return + self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) + +- list(multiprocessing.pool.ThreadPool(multiprocessing.cpu_count()).imap(_single_compile, objects)) ++ list(multiprocessing.pool.ThreadPool(@NIX_BUILD_CORES@).imap(_single_compile, objects)) + return objects + + +@@ -163,7 +163,6 @@ if 'BUILD_HTTPFS' in os.environ: + for ext in extensions: + toolchain_args.extend(['-DDUCKDB_EXTENSION_{}_LINKED'.format(ext.upper())]) + +-toolchain_args.extend(['-DDUCKDB_EXTENSION_AUTOLOAD_DEFAULT=1', '-DDUCKDB_EXTENSION_AUTOINSTALL_DEFAULT=1']) + + + class get_pybind_include(object): +@@ -348,7 +347,7 @@ setup( + packages=packages, + include_package_data=True, + python_requires='>=3.7.0', +- setup_requires=setup_requires + ["setuptools_scm<7.0.0", 'pybind11>=2.6.0'], ++ setup_requires=setup_requires + ["setuptools_scm", 'pybind11>=2.6.0'], + use_scm_version=setuptools_scm_conf, + tests_require=['google-cloud-storage', 'mypy', 'pytest'], + classifiers=[ -- cgit 1.4.1 From 806f4b63c021d62bb12200f2f2f907072b355cd2 Mon Sep 17 00:00:00 2001 From: Rob <86313040+robert-manchester@users.noreply.github.com> Date: Fri, 20 Oct 2023 23:58:29 -0700 Subject: duckdb: disable non-deterministic test_connection_interrupt --- pkgs/development/python-modules/duckdb/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/duckdb/default.nix b/pkgs/development/python-modules/duckdb/default.nix index 37ddad2cd045c..5ff9956849926 100644 --- a/pkgs/development/python-modules/duckdb/default.nix +++ b/pkgs/development/python-modules/duckdb/default.nix @@ -56,6 +56,8 @@ buildPythonPackage rec { disabledTests = [ # tries to make http request "test_install_non_existent_extension" + # test is racy and interrupt can be delivered before or after target point + "test_connection_interrupt" ]; preCheck = '' -- cgit 1.4.1