Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.4 kB · 106 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107{ lib, stdenv, buildPythonPackage, duckdb, fsspec, google-cloud-storage, numpy, openssl, pandas, psutil, pybind11, setuptools-scm, pytest-reraise, pytestCheckHook,}:
buildPythonPackage rec { 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
# 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"
substituteInPlace pyproject.toml \ --replace-fail 'setuptools_scm>=6.4,<8.0' 'setuptools_scm' '';
env = { DUCKDB_BUILD_UNITY = 1; OVERRIDE_GIT_DESCRIBE = "v${version}-0-g${rev}"; };
build-system = [ pybind11 setuptools-scm ];
buildInputs = [ openssl ];
dependencies = [ numpy pandas ];
nativeCheckInputs = [ fsspec google-cloud-storage psutil pytest-reraise pytestCheckHook ];
pytestFlags = [ "--verbose" ];
# test flags from .github/workflows/Python.yml pytestFlagsArray = [ "--verbose" ]; enabledTestPaths = if stdenv.hostPlatform.isDarwin then [ "tests/fast" ] else [ "tests" ];
disabledTestPaths = [ # avoid dependency on mypy "tests/stubs/test_stubs.py" ];
disabledTests = [ # 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 "test_connection_interrupt" "test_query_interruption" ];
# remove duckdb dir to prevent import confusion by pytest preCheck = '' export HOME="$(mktemp -d)" rm -rf duckdb '';
pythonImportsCheck = [ "duckdb" ];
meta = with lib; { description = "Python binding for DuckDB"; homepage = "https://duckdb.org/"; license = licenses.mit; maintainers = with maintainers; [ cpcloud ]; };}