about summary refs log tree commit diff
path: root/pkgs/development/python-modules/diofant/default.nix
blob: 303d00bbff29761d12be6754f72b239b4d1ffb25 (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
58
59
60
61
62
63
64
65
66
{ lib
, buildPythonPackage
, cython
, fetchpatch
, fetchPypi
, gmpy2
, mpmath
, numpy
, pythonOlder
, scipy
, setuptools-scm
, wheel
}:

buildPythonPackage rec {
  pname = "diofant";
  version = "0.14.0";
  format = "pyproject";
  disabled = pythonOlder "3.10";

  src = fetchPypi {
    inherit version;
    pname = "Diofant";
    hash = "sha256-c886y37xR+4TxZw9+3tb7nkTGxWcS+Ag/ruUUdpf7S4=";
  };

  patches = [
    (fetchpatch {
      name = "remove-pip-from-build-dependencies.patch";
      url = "https://github.com/diofant/diofant/commit/117e441808faa7c785ccb81bf211772d60ebdec3.patch";
      hash = "sha256-MYk1Ku4F3hAv7+jJQLWhXd8qyKRX+QYuBzPfYWT0VbU=";
    })
  ];

  nativeBuildInputs = [
    setuptools-scm
    wheel
  ];

  propagatedBuildInputs = [
    mpmath
  ];

  passthru.optional-dependencies = {
    exports = [
      cython
      numpy
      scipy
    ];
    gmpy = [
      gmpy2
    ];
  };

  # tests take ~1h
  doCheck = false;

  pythonImportsCheck = [ "diofant" ];

  meta = with lib; {
    description = "A Python CAS library";
    homepage = "https://diofant.readthedocs.io/";
    license = licenses.bsd3;
    maintainers = with maintainers; [ suhr ];
  };
}