1{ lib
2, buildPythonPackage
3, duckdb
4, numpy
5, pandas
6, pybind11
7, setuptools-scm
8, pytest-runner
9, pytestCheckHook
10}:
11
12buildPythonPackage rec {
13 pname = "duckdb";
14 inherit (duckdb) version src;
15
16 # build attempts to use git to figure out its own version. don't want to add
17 # the dependency for something pointless.
18 postPatch = ''
19 substituteInPlace scripts/package_build.py --replace \
20 "'git'" "'false'"
21 '';
22
23 postConfigure = ''
24 cd tools/pythonpkg
25 export SETUPTOOLS_SCM_PRETEND_VERSION=${version}
26 '';
27
28 nativeBuildInputs = [
29 pybind11
30 setuptools-scm
31 pytest-runner
32 ];
33
34 propagatedBuildInputs = [
35 numpy
36 pandas
37 ];
38
39 checkInputs = [
40 pytestCheckHook
41 ];
42
43 pythonImportsCheck = [ "duckdb" ];
44
45 meta = with lib; {
46 description = "Python binding for DuckDB";
47 homepage = "https://duckdb.org/";
48 license = licenses.mit;
49 maintainers = with maintainers; [ costrouc ];
50 };
51}