depot/third_party/nixpkgs/pkgs/development/python-modules/pykdtree/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

57 lines
1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
# build-system
cython,
numpy,
setuptools,
# native dependencies
openmp,
# tests
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pykdtree";
version = "1.3.12";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-zCCypnxkBWSFoxTSwrbbo1SvfuHI+42uG+byk2o3Q0E=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-warn "numpy>=2.0.0rc1,<3" "numpy"
'';
nativeBuildInputs = [
cython
numpy
setuptools
];
buildInputs = [ openmp ];
propagatedBuildInputs = [ numpy ];
preCheck = ''
# make sure we don't import pykdtree from the source tree
mv pykdtree/test_tree.py .
rm -rf pykdtree
'';
nativeCheckInputs = [ pytestCheckHook ];
meta = with lib; {
description = "kd-tree implementation for fast nearest neighbour search in Python";
homepage = "https://github.com/storpipfugl/pykdtree";
license = licenses.lgpl3;
maintainers = with maintainers; [ psyanticy ];
};
}