diff options
-rw-r--r-- | pkgs/development/libraries/duckdb/default.nix | 10 | ||||
-rw-r--r-- | pkgs/development/libraries/duckdb/version.patch | 22 | ||||
-rw-r--r-- | pkgs/development/python-modules/duckdb/default.nix | 16 | ||||
-rw-r--r-- | pkgs/development/python-modules/duckdb/setup.patch | 30 |
4 files changed, 46 insertions, 32 deletions
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..5ff9956849926 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 @@ -54,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 = '' 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=[ |