about summary refs log tree commit diff
diff options
context:
space:
mode:
authorh7x4 <h7x4@nani.wtf>2024-07-02 18:27:24 +0200
committerGitHub <noreply@github.com>2024-07-02 18:27:24 +0200
commita5f1a73d7e1c8b8312391e72f771df8be183d75c (patch)
tree51a1c90dd840e5974c6534976120444b6b553fa8
parentd7330636a6da08f75d5361428b70d3a22862a5d7 (diff)
parent80c2b2b902479c0da1f0f065655f563ded14714b (diff)
Merge pull request #320485 from kfollesdal/kfollesdal/deltalake
python3Packages.deltalake: init at 0.18.1
-rw-r--r--maintainers/maintainer-list.nix6
-rw-r--r--pkgs/development/python-modules/deltalake/default.nix73
-rw-r--r--pkgs/top-level/python-packages.nix2
3 files changed, 81 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index a0ea46dd3e44f..54eefb8d9bfe3 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -1202,6 +1202,12 @@
     githubId = 754494;
     name = "Anders Asheim Hennum";
   };
+  andershus = {
+    email = "anders.husebo@eviny.no";
+    github = "andershus";
+    githubId = 93526270;
+    name = "Anders Husebø";
+  };
   andersk = {
     email = "andersk@mit.edu";
     github = "andersk";
diff --git a/pkgs/development/python-modules/deltalake/default.nix b/pkgs/development/python-modules/deltalake/default.nix
new file mode 100644
index 0000000000000..cc866d2de393b
--- /dev/null
+++ b/pkgs/development/python-modules/deltalake/default.nix
@@ -0,0 +1,73 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, rustPlatform
+, pyarrow
+, pyarrow-hotfix
+, openssl
+, pkg-config
+, pytestCheckHook
+, pytest-benchmark
+, pytest-cov
+, pandas
+}:
+
+buildPythonPackage rec {
+  pname = "deltalake";
+  version = "0.18.1";
+  format = "pyproject";
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-qkmCKk1VnROK7luuPlKbIx3S3C8fzGJy8yhTyZWXyGc=";
+  };
+
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src;
+    hash = "sha256-Dj2vm0l4b/E6tbXgs5iPvbDAsxNW0iPUSRPzT5KaA3Y=";
+  };
+
+  env.OPENSSL_NO_VENDOR = 1;
+
+  dependencies = [
+    pyarrow
+    pyarrow-hotfix
+  ];
+
+  buildInputs = [ openssl ];
+
+  nativeBuildInputs = [
+    pkg-config # openssl-sys needs this
+  ] ++ (with rustPlatform; [
+    cargoSetupHook
+    maturinBuildHook
+  ]);
+
+  pythonImportsCheck = [ "deltalake" ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+    pandas
+    pytest-benchmark
+    pytest-cov
+  ];
+
+  preCheck = ''
+    # For paths in test to work, we have to be in python dir
+    cp pyproject.toml python/
+    cd python
+
+    # In tests we want to use deltalake that we have built
+    rm -rf deltalake
+  '';
+
+  pytestFlagsArray = [ "-m 'not integration'" ];
+
+  meta = with lib; {
+    description = "Native Rust library for Delta Lake, with bindings into Python";
+    homepage = "https://github.com/delta-io/delta-rs";
+    changelog = "https://github.com/delta-io/delta-rs/blob/python-v${version}/CHANGELOG.md";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ kfollesdal mslingsby harvidsen andershus ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 729f73f94e6d4..39e3578ff51ab 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -2973,6 +2973,8 @@ self: super: with self; {
 
   deltachat2 = callPackage ../development/python-modules/deltachat2 { };
 
+  deltalake = callPackage ../development/python-modules/deltalake { };
+
   deluge-client = callPackage ../development/python-modules/deluge-client { };
 
   demes = callPackage ../development/python-modules/demes { };