about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pykdtree/default.nix
blob: 84372802ecaf2328bbc8e05c94960ab17fa1f6f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ 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=";
  };

  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 ];
  };
}