<commit_before>{ lib
, buildPythonPackage
, duckdb
, numpy
, pandas
, pybind11
, setuptools_scm
, pytestrunner
, pytest
}:

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
    pytestrunner
  ];

  checkInputs = [
    pytest
  ];

  propagatedBuildInputs = [
    numpy
    pandas
  ];

  checkPhase = ''
    pytest
  '';

  meta = with lib; {
    description = "DuckDB is an embeddable SQL OLAP Database Management System";
    homepage = "https://pypi.python.org/pypi/duckdb";
    license = licenses.mit;
    maintainers = [ maintainers.costrouc ];
  };
}<commit_msg>pythonPackages.duckdb: cleanup, add import check<commit_after>{ lib
, buildPythonPackage
, duckdb
, numpy
, pandas
, pybind11
, setuptools_scm
, pytestrunner
, 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
    pytestrunner
  ];

  propagatedBuildInputs = [ numpy pandas ];

  checkInputs = [ pytestCheckHook ];
  pythonImportsCheck = [ "duckdb" ];

  meta = with lib; {
    description = "DuckDB is an embeddable SQL OLAP Database Management System";
    homepage = "https://pypi.python.org/pypi/duckdb";
    license = licenses.mit;
    maintainers = [ maintainers.costrouc ];
  };
}
{'fraction_non_alphanumeric': 0.10487077534791253, 'fraction_numerical': 0.003976143141153081, 'mean_word_length': 3.310492505353319, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '820337', 'n_tokens_mistral': 685, 'n_tokens_neox': 675, 'n_words': 162}