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.15.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-uQvAYSURDhuAKcX0WVMk4y2ZXiiq0lPZct/7A5n5t34=";
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 nativeCheckInputs = [
59 hypothesis
60 pexpect
61 pytest-cov-stub
62 pytest-xdist
63 pytestCheckHook
64 ];
65
66 pytestFlags = [
67 "-Wignore::DeprecationWarning"
68 ];
69
70 disabledTestMarks = [
71 "slow"
72 ];
73
74 disabledTests = [
75 # AssertionError: assert '9.9012134805...5147838841057' == '2.7182818284...2178525166427'
76 "test_evalf_fast_series"
77 # AssertionError: assert Float('0.0051000000000000004', dps=15) == Float('0.010050166663333571', dps=15)
78 "test_evalf_sum"
79 ];
80
81 pythonImportsCheck = [ "diofant" ];
82
83 meta = with lib; {
84 changelog = "https://diofant.readthedocs.io/en/latest/release/notes-${src.tag}.html";
85 description = "Python CAS library";
86 homepage = "https://github.com/diofant/diofant";
87 license = licenses.bsd3;
88 maintainers = with maintainers; [ suhr ];
89 };
90}