1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 cython,
8 setuptools,
9 setuptools-scm,
10
11 # dependencies
12 numpy,
13 scipy,
14
15 # tests
16 gstools,
17 pytestCheckHook,
18 scikit-learn,
19 writableTmpDirAsHomeHook,
20}:
21
22buildPythonPackage rec {
23 pname = "pykrige";
24 version = "1.7.2";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "GeoStat-Framework";
29 repo = "PyKrige";
30 tag = "v${version}";
31 hash = "sha256-9f8SNlt4qiTlXgx2ica9Y8rmnYzQ5VarvFRfoZ9bSsY=";
32 };
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace-fail "numpy>=2.0.0rc1,<2.3; python_version >= '3.9'" "numpy>=2.0.0" \
37 --replace-fail "Cython>=3.0.10,<3.1.0" "Cython>=3.1.0,<4.0.0"
38 '';
39
40 build-system = [
41 cython
42 numpy
43 scipy
44 setuptools
45 setuptools-scm
46 ];
47
48 dependencies = [
49 numpy
50 scipy
51 ];
52
53 nativeCheckInputs = [
54 gstools
55 pytestCheckHook
56 scikit-learn
57 writableTmpDirAsHomeHook
58 ];
59
60 # Requires network access
61 disabledTests = [
62 "test_krige_classification_housing"
63 "test_pseudo_2d"
64 "test_pseudo_3d"
65 "test_krige_housing"
66 ];
67
68 meta = {
69 description = "Kriging Toolkit for Python";
70 homepage = "https://github.com/GeoStat-Framework/PyKrige";
71 changelog = "https://github.com/GeoStat-Framework/PyKrige/blob/v${version}/CHANGELOG.md";
72 license = lib.licenses.bsd3;
73 maintainers = [ lib.maintainers.sikmir ];
74 };
75}