1{
2 lib,
3 buildPythonPackage,
4 cython,
5 fetchFromGitHub,
6 fetchpatch,
7 gmpy2,
8 hypothesis,
9 mpmath,
10 numpy,
11 pexpect,
12 pythonOlder,
13 pytest-cov-stub,
14 pytest-timeout,
15 pytest-xdist,
16 pytestCheckHook,
17 scipy,
18 setuptools-scm,
19}:
20
21buildPythonPackage rec {
22 pname = "diofant";
23 version = "0.14.0";
24 pyproject = true;
25
26 disabled = pythonOlder "3.10";
27
28 src = fetchFromGitHub {
29 owner = "diofant";
30 repo = "diofant";
31 tag = "v${version}";
32 hash = "sha256-+VM5JBj4NRhNwyAVhnsACg5cVyyxJ3IcOKNL1osr67E=";
33 };
34
35 patches = [
36 (fetchpatch {
37 name = "remove-pip-from-build-dependencies.patch";
38 url = "https://github.com/diofant/diofant/commit/117e441808faa7c785ccb81bf211772d60ebdec3.patch";
39 hash = "sha256-MYk1Ku4F3hAv7+jJQLWhXd8qyKRX+QYuBzPfYWT0VbU=";
40 })
41 ];
42
43 build-system = [ setuptools-scm ];
44
45 dependencies = [ mpmath ];
46
47 optional-dependencies = {
48 exports = [
49 cython
50 numpy
51 scipy
52 ];
53 gmpy = [ gmpy2 ];
54 };
55
56 doCheck = false; # some tests get stuck easily
57
58 pytestFlagsArray = [
59 "-W"
60 "ignore::DeprecationWarning"
61 "-m 'not slow'"
62 ];
63
64 nativeCheckInputs = [
65 hypothesis
66 pexpect
67 pytest-cov-stub
68 pytest-xdist
69 pytestCheckHook
70 ];
71
72 disabledTests = [
73 # AssertionError: assert '9.9012134805...5147838841057' == '2.7182818284...2178525166427'
74 "test_evalf_fast_series"
75 # AssertionError: assert Float('0.0051000000000000004', dps=15) == Float('0.010050166663333571', dps=15)
76 "test_evalf_sum"
77 ];
78
79 pythonImportsCheck = [ "diofant" ];
80
81 meta = with lib; {
82 changelog = "https://diofant.readthedocs.io/en/latest/release/notes-${version}.html";
83 description = "Python CAS library";
84 homepage = "https://github.com/diofant/diofant";
85 license = licenses.bsd3;
86 maintainers = with maintainers; [ suhr ];
87 };
88}