python3Packages.laspy: Add fast lazrs backend (#423671)

This commit is contained in:
Aleksana
2025-08-01 23:38:52 +08:00
committed by GitHub
3 changed files with 51 additions and 2 deletions
@@ -4,6 +4,7 @@
fetchPypi,
numpy,
laszip,
lazrs,
setuptools,
pytestCheckHook,
pythonOlder,
@@ -11,14 +12,14 @@
buildPythonPackage rec {
pname = "laspy";
version = "2.5.4";
version = "2.6.1";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-7r2/M3mvvAsk5+SBL6xWe/+IDR6FH3AXXSI3Wq7N9+E=";
hash = "sha256-zpy5oYUosqK5hVg99ApN6mjN2nmV5H5LALbUjfDojao=";
};
nativeBuildInputs = [ setuptools ];
@@ -26,13 +27,17 @@ buildPythonPackage rec {
propagatedBuildInputs = [
numpy
laszip
lazrs # much faster laz reading, see https://laspy.readthedocs.io/en/latest/installation.html#laz-support
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [
"laspy"
# `laspy` supports multiple backends and detects them dynamically.
# We check their importability to make sure they are all working.
"laszip"
"lazrs"
];
meta = with lib; {
@@ -42,5 +47,6 @@ buildPythonPackage rec {
changelog = "https://github.com/laspy/laspy/blob/${version}/CHANGELOG.md";
license = licenses.bsd2;
maintainers = with maintainers; [ matthewcroughan ];
teams = [ teams.geospatial ];
};
}
@@ -0,0 +1,41 @@
{
lib,
buildPythonPackage,
fetchPypi,
rustPlatform,
}:
buildPythonPackage rec {
pname = "lazrs";
version = "0.7.0";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-UxkbNRwdn6RfdEcWmDhL9CveFFmTCWRfudTDU/D7fyQ=";
};
nativeBuildInputs = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
inherit pname version;
hash = "sha256-GVb34eznC5/TA/SpvDq9uJ9M3nUTfx0KyfRFd4WUyCI=";
};
pythonImportsCheck = [ "lazrs" ];
meta = {
description = "Python bindings for laz-rs";
homepage = "https://github.com/laz-rs/laz-rs-python";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
nh2
chpatrick
];
teams = [ lib.teams.geospatial ];
};
}
+2
View File
@@ -7933,6 +7933,8 @@ self: super: with self; {
lazr-uri = callPackage ../development/python-modules/lazr-uri { };
lazrs = callPackage ../development/python-modules/lazrs { };
lazy = callPackage ../development/python-modules/lazy { };
lazy-imports = callPackage ../development/python-modules/lazy-imports { };