Commit ef520344 authored by Sarah Clark's avatar Sarah Clark
Browse files

python3Packages.duckdb-engine: cleanup

Modernize build, remove `with lib;`, review & fixup disabledTests.
parent 5e41161d
Loading
Loading
Loading
Loading
+23 −27
Original line number Diff line number Diff line
@@ -2,18 +2,24 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  pythonAtLeast,
  pythonOlder,
  python,

  # build-system
  poetry-core,

  # dependencies
  duckdb,
  sqlalchemy,

  # testing
  hypothesis,
  pandas,
  pyarrow,
  poetry-core,
  pytest-remotedata,
  pytestCheckHook,
  python,
  pythonAtLeast,
  pythonOlder,
  snapshottest,
  sqlalchemy,
  typing-extensions,
}:

@@ -22,8 +28,6 @@ buildPythonPackage rec {
  version = "0.15.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    repo = "duckdb_engine";
    owner = "Mause";
@@ -31,9 +35,9 @@ buildPythonPackage rec {
    hash = "sha256-mxv6xYO31MDzHvIf7Zk+kFtm6fX3x3AaJNn7RhvJ2fY=";
  };

  nativeBuildInputs = [ poetry-core ];
  build-system = [ poetry-core ];

  propagatedBuildInputs = [
  dependencies = [
    duckdb
    sqlalchemy
  ];
@@ -48,9 +52,9 @@ buildPythonPackage rec {
    [
      hypothesis
      pandas
      pyarrow
      pytest-remotedata
      typing-extensions
      pyarrow
    ]
    ++ lib.optionals (pythonOlder "3.12") [
      # requires wasmer which is broken for python 3.12
@@ -68,27 +72,19 @@ buildPythonPackage rec {
    "duckdb_engine/tests/test_datatypes.py"
  ];

  disabledTests =
    [
      # incompatible with duckdb 1.1.1
      "test_with_cache"
      # these aren't set for some reason
  disabledTests = [
    # user agent not available in nixpkgs
    "test_user_agent"
    "test_user_agent_with_custom_user_agent"
    ]
    ++ lib.optionals (python.pythonVersion == "3.11") [
      # incompatible with duckdb 1.1.1
      "test_all_types_reflection"
      "test_nested_types"
  ];

  pythonImportsCheck = [ "duckdb_engine" ];

  meta = with lib; {
  meta = {
    description = "SQLAlchemy driver for duckdb";
    homepage = "https://github.com/Mause/duckdb_engine";
    changelog = "https://github.com/Mause/duckdb_engine/blob/${src.tag}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ cpcloud ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ cpcloud ];
  };
}