nixpkgs/pkgs/by-name/pa/parquet-tools/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

83 lines
1.6 KiB
Nix

{ lib
, fetchFromGitHub
, python3Packages
}:
with python3Packages;
buildPythonApplication rec {
pname = "parquet-tools";
version = "0.2.16";
format = "pyproject";
src = fetchFromGitHub {
owner = "ktrueda";
repo = "parquet-tools";
rev = "refs/tags/${version}";
hash = "sha256-mV66R5ejfzH1IasmoyAWAH5vzrnLVVhOqKBMfWKIVY0=";
};
patches = [
# support Moto 5.x
# https://github.com/ktrueda/parquet-tools/pull/55
./moto5.patch
];
postPatch = ''
substituteInPlace tests/test_inspect.py \
--replace "parquet-cpp-arrow version 5.0.0" "parquet-cpp-arrow version ${pyarrow.version}" \
--replace "serialized_size: 2222" "serialized_size: 2221" \
--replace "format_version: 1.0" "format_version: 2.6"
'';
pythonRelaxDeps = [
"halo"
"tabulate"
"thrift"
];
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
boto3
colorama
halo
pandas
pyarrow
tabulate
thrift
];
# TestGetMetaData.test_inspect shells out to `parquet-tools` CLI entrypoint
preCheck = ''
export PATH=$out/bin:$PATH
'';
nativeCheckInputs = [
moto
pytest-mock
pytestCheckHook
];
disabledTests = [
# test file is 2 bytes bigger than expected
"test_excute_simple"
];
pythonImportsCheck = [
"parquet_tools"
];
meta = with lib; {
description = "CLI tool for parquet files";
homepage = "https://github.com/ktrueda/parquet-tools";
changelog = "https://github.com/ktrueda/parquet-tools/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
mainProgram = "parquet-tools";
};
}