1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 numpy,
6 pytestCheckHook,
7 pythonOlder,
8 scipy,
9}:
10
11buildPythonPackage rec {
12 pname = "numdifftools";
13 version = "0.9.41";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "pbrod";
20 repo = pname;
21 rev = "v${version}";
22 hash = "sha256-HYacLaowSDdrwkxL1h3h+lw/8ahzaecpXEnwrCqMCWk=";
23 };
24
25 propagatedBuildInputs = [
26 numpy
27 scipy
28 ];
29
30 # Tests requires algopy and other modules which are optional and/or not available
31 doCheck = false;
32
33 postPatch = ''
34 substituteInPlace setup.py \
35 --replace '"pytest-runner"' ""
36 # Remove optional dependencies
37 substituteInPlace requirements.txt \
38 --replace "algopy>=0.4" "" \
39 --replace "statsmodels>=0.6" ""
40 '';
41
42 pythonImportsCheck = [ "numdifftools" ];
43
44 meta = with lib; {
45 description = "Library to solve automatic numerical differentiation problems in one or more variables";
46 homepage = "https://github.com/pbrod/numdifftools";
47 license = licenses.bsd3;
48 maintainers = with maintainers; [ fab ];
49 };
50}