about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/duckdb/default.nix
blob: fd360bfbd120c91c5996a9fc3ffa618128952330 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib
, buildPythonPackage
, duckdb
, numpy
, pandas
, pybind11
, setuptools-scm
, pytest-runner
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "duckdb";
  inherit (duckdb) version src;

  # build attempts to use git to figure out its own version. don't want to add
  # the dependency for something pointless.
  postPatch = ''
    substituteInPlace scripts/package_build.py --replace \
      "'git'" "'false'"
  '';

  postConfigure = ''
    cd tools/pythonpkg
    export SETUPTOOLS_SCM_PRETEND_VERSION=${version}
  '';

  nativeBuildInputs = [
    pybind11
    setuptools-scm
    pytest-runner
  ];

  propagatedBuildInputs = [
    numpy
    pandas
  ];

  checkInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [ "duckdb" ];

  meta = with lib; {
    description = "Python binding for DuckDB";
    homepage = "https://duckdb.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ costrouc ];
  };
}