nushellPlugins.polars: refactor

This commit is contained in:
Tom van Dijk
2025-06-28 17:02:09 +02:00
parent 17144a68f2
commit 4627382fe2
+11 -15
View File
@@ -8,33 +8,29 @@
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "nushell_plugin_polars";
inherit (nushell) version src cargoHash;
useFetchCargoVendor = true;
nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ];
buildInputs = [ openssl ];
cargoBuildFlags = [ "--package nu_plugin_polars" ];
checkPhase = ''
# test failed without enough columns
cargo test --manifest-path crates/nu_plugin_polars/Cargo.toml -- \
--skip=dataframe::command::core::to_repr::test::test_examples
'';
buildAndTestSubdir = "crates/nu_plugin_polars";
checkFlags = [
"--skip=dataframe::command::core::to_repr::test::test_examples"
];
passthru.updateScript = nix-update-script {
# Skip the version check and only check the hash because we inherit version from nushell.
extraArgs = [ "--version=skip" ];
};
meta = with lib; {
meta = {
description = "Nushell dataframe plugin commands based on polars";
mainProgram = "nu_plugin_polars";
homepage = "https://github.com/nushell/nushell/tree/${version}/crates/nu_plugin_polars";
license = licenses.mit;
maintainers = with maintainers; [ joaquintrinanes ];
platforms = with platforms; all;
homepage = "https://github.com/nushell/nushell/tree/${finalAttrs.version}/crates/nu_plugin_polars";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ joaquintrinanes ];
};
}
})