1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 flit-core,
6 appdirs,
7 matplotlib,
8 meshio,
9 numpy,
10 nutils-poly,
11 scipy,
12 stringly,
13 treelog,
14 pytestCheckHook,
15 pythonOlder,
16 pkgs,
17}:
18
19buildPythonPackage rec {
20 pname = "nutils";
21 version = "9.1";
22 pyproject = true;
23
24 disabled = pythonOlder "3.8";
25
26 src = fetchFromGitHub {
27 owner = "evalf";
28 repo = "nutils";
29 tag = "v${version}";
30 hash = "sha256-NmWoRDYOfSweqUhw0KTdXubWgXmVr+odrs1dMLXdHEI=";
31 };
32
33 build-system = [ flit-core ];
34
35 dependencies = [
36 appdirs
37 numpy
38 nutils-poly
39 stringly
40 treelog
41 ];
42
43 optional-dependencies = {
44 export-mpl = [ matplotlib ];
45 # TODO: matrix-mkl = [ mkl ];
46 matrix-scipy = [ scipy ];
47 import-gmsh = [ meshio ];
48 };
49
50 pythonRelaxDeps = [ "psutil" ];
51
52 nativeCheckInputs = [
53 pkgs.graphviz
54 pytestCheckHook
55 ]
56 ++ lib.flatten (lib.attrValues optional-dependencies);
57
58 disabledTests = [
59 # Error: invalid value 'x' for farg: loading 'x' as float
60 "run.test_badvalue"
61 "choose.test_badvalue"
62 # ModuleNotFoundError: No module named 'stringly'
63 "picklability.test_basis"
64 "picklability.test_domain"
65 "picklability.test_geom"
66 ];
67
68 pythonImportsCheck = [ "nutils" ];
69
70 meta = with lib; {
71 description = "Numerical Utilities for Finite Element Analysis";
72 changelog = "https://github.com/evalf/nutils/releases/tag/${src.tag}";
73 homepage = "https://www.nutils.org/";
74 license = licenses.mit;
75 maintainers = with maintainers; [ Scriptkiddi ];
76 };
77}