2021-11-22 02:56:43 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3Packages
|
|
|
|
}:
|
|
|
|
|
|
|
|
with python3Packages;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "parquet-tools";
|
2024-04-02 21:46:27 +02:00
|
|
|
version = "0.2.16";
|
2021-11-22 02:56:43 +01:00
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ktrueda";
|
|
|
|
repo = "parquet-tools";
|
2023-01-26 13:40:51 +01:00
|
|
|
rev = "refs/tags/${version}";
|
2024-04-02 21:46:27 +02:00
|
|
|
hash = "sha256-mV66R5ejfzH1IasmoyAWAH5vzrnLVVhOqKBMfWKIVY0=";
|
2021-11-22 02:56:43 +01:00
|
|
|
};
|
|
|
|
|
2024-04-03 13:55:29 +02:00
|
|
|
patches = [
|
|
|
|
# support Moto 5.x
|
|
|
|
# https://github.com/ktrueda/parquet-tools/pull/55
|
|
|
|
./moto5.patch
|
|
|
|
];
|
|
|
|
|
2021-11-22 02:56:43 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/test_inspect.py \
|
2021-11-22 12:01:53 +01:00
|
|
|
--replace "parquet-cpp-arrow version 5.0.0" "parquet-cpp-arrow version ${pyarrow.version}" \
|
2022-11-01 20:19:04 +01:00
|
|
|
--replace "serialized_size: 2222" "serialized_size: 2221" \
|
|
|
|
--replace "format_version: 1.0" "format_version: 2.6"
|
2021-11-22 02:56:43 +01:00
|
|
|
'';
|
|
|
|
|
2023-01-26 13:40:51 +01:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"halo"
|
|
|
|
"tabulate"
|
|
|
|
"thrift"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
2021-11-22 02:56:43 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
boto3
|
|
|
|
colorama
|
|
|
|
halo
|
|
|
|
pandas
|
|
|
|
pyarrow
|
|
|
|
tabulate
|
|
|
|
thrift
|
|
|
|
];
|
|
|
|
|
2024-04-02 21:46:27 +02:00
|
|
|
# TestGetMetaData.test_inspect shells out to `parquet-tools` CLI entrypoint
|
|
|
|
preCheck = ''
|
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
'';
|
|
|
|
|
2023-01-21 13:00:00 +01:00
|
|
|
nativeCheckInputs = [
|
2021-11-22 02:56:43 +01:00
|
|
|
moto
|
|
|
|
pytest-mock
|
2023-01-26 13:40:51 +01:00
|
|
|
pytestCheckHook
|
2021-11-22 02:56:43 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2023-07-01 03:39:22 +02:00
|
|
|
# test file is 2 bytes bigger than expected
|
|
|
|
"test_excute_simple"
|
2021-11-22 02:56:43 +01:00
|
|
|
];
|
|
|
|
|
2023-01-26 13:40:51 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"parquet_tools"
|
|
|
|
];
|
|
|
|
|
2021-11-22 02:56:43 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A CLI tool for parquet files";
|
|
|
|
homepage = "https://github.com/ktrueda/parquet-tools";
|
2023-01-26 13:40:51 +01:00
|
|
|
changelog = "https://github.com/ktrueda/parquet-tools/releases/tag/${version}";
|
2021-11-22 02:56:43 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
2023-11-27 02:17:53 +01:00
|
|
|
mainProgram = "parquet-tools";
|
2021-11-22 02:56:43 +01:00
|
|
|
};
|
|
|
|
}
|