1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 # build-system
7 cython,
8 numpy,
9 setuptools,
10
11 # native dependencies
12 openmp,
13
14 # tests
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "pykdtree";
20 version = "1.4.3";
21 pyproject = true;
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-2Rh5MP+4yCLFJZW2SUi0c0ZpTuKknicCQgtY90PXhvU=";
26 };
27
28 nativeBuildInputs = [
29 cython
30 numpy
31 setuptools
32 ];
33
34 buildInputs = [ openmp ];
35
36 propagatedBuildInputs = [ numpy ];
37
38 preCheck = ''
39 # make sure we don't import pykdtree from the source tree
40 mv pykdtree/test_tree.py .
41 rm -rf pykdtree
42 '';
43
44 nativeCheckInputs = [ pytestCheckHook ];
45
46 meta = with lib; {
47 description = "kd-tree implementation for fast nearest neighbour search in Python";
48 homepage = "https://github.com/storpipfugl/pykdtree";
49 license = licenses.lgpl3;
50 maintainers = with maintainers; [ psyanticy ];
51 };
52}