nixpkgs/pkgs/tools/misc/parquet-tools/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
1.7 KiB
Nix
Raw Normal View History

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";
rev = "refs/tags/${version}";
2024-04-02 21:46:27 +02:00
hash = "sha256-mV66R5ejfzH1IasmoyAWAH5vzrnLVVhOqKBMfWKIVY0=";
2021-11-22 02:56:43 +01: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 \
--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
'';
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
'';
nativeCheckInputs = [
2021-11-22 02:56:43 +01:00
moto
pytest-mock
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
];
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";
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
};
}