1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, hatchling
5, numpy
6, scipy
7, matplotlib
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "kneed";
13 version = "0.8.5";
14 format = "pyproject";
15
16 src = fetchFromGitHub {
17 owner = "arvkevi";
18 repo = "kneed";
19 rev = "refs/tags/v${version}";
20 sha256 = "sha256-oakP6NkdvTzMZcoXS6cKNsRo//K+CoPLlhvbQLGij00=";
21 };
22
23 postPatch = ''
24 substituteInPlace pytest.ini \
25 --replace "--cov=kneed" ""
26 '';
27
28 nativeBuildInputs = [
29 hatchling
30 ];
31
32 propagatedBuildInputs = [
33 numpy
34 scipy
35 ];
36
37 checkInputs = [
38 pytestCheckHook
39 matplotlib
40 ];
41
42 disabledTestPaths = [
43 # Fails when matplotlib is installed
44 "tests/test_no_matplotlib.py"
45 ];
46
47 meta = with lib; {
48 description = "Knee point detection in Python";
49 homepage = "https://github.com/arvkevi/kneed";
50 license = licenses.bsd3;
51 maintainers = with maintainers; [ tm-drtina ];
52 };
53}