2024-07-27 06:49:29 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, rustPlatform
|
|
|
|
, pyarrow
|
|
|
|
, pyarrow-hotfix
|
|
|
|
, openssl
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
, libiconv
|
|
|
|
, pkg-config
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-benchmark
|
|
|
|
, pytest-cov
|
2024-09-19 14:19:46 +00:00
|
|
|
, pytest-mock
|
2024-07-27 06:49:29 +00:00
|
|
|
, pandas
|
|
|
|
, azure-storage-blob
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "deltalake";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.19.1";
|
2024-07-27 06:49:29 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-Xgn6uyIfuB6YnCg8FieOr/tuhXBtmDZKvNpcDGynNZg=";
|
2024-07-27 06:49:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-ebX51/ztIdhY81sd0fdPsKvaGtCEk8oofrj/Nrt8nfA=";
|
2024-07-27 06:49:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
env.OPENSSL_NO_VENDOR = 1;
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
pyarrow
|
|
|
|
pyarrow-hotfix
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-07-27 06:49:29 +00:00
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
|
|
|
libiconv
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config # openssl-sys needs this
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
]);
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "deltalake" ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pandas
|
|
|
|
pytest-benchmark
|
|
|
|
pytest-cov
|
2024-09-19 14:19:46 +00:00
|
|
|
pytest-mock
|
2024-07-27 06:49:29 +00:00
|
|
|
azure-storage-blob
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|