about summary refs log tree commit diff
path: root/pkgs/development/python-modules/sfepy/default.nix
blob: 599e853e5f723a7738ec951ab8d905184cbdc888 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
  lib,
  buildPythonPackage,
  pythonOlder,
  fetchFromGitHub,
  cmake,
  cython_0,
  ninja,
  oldest-supported-numpy,
  setuptools,
  scikit-build,
  numpy,
  scipy,
  matplotlib,
  pyparsing,
  tables,
  python,
  sympy,
  meshio,
  openssh,
  pyvista,
  pytest,
}:

buildPythonPackage rec {
  pname = "sfepy";
  version = "2024.1";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "sfepy";
    repo = "sfepy";
    rev = "release_${version}";
    hash = "sha256-r2Qx9uJmVS4ugJxrIxg2UscnYu1Qr4hEkcz66NyWGmA=";
  };

  build-system = [
    cmake
    cython_0
    ninja
    oldest-supported-numpy
    setuptools
    scikit-build
  ];

  dontUseCmakeConfigure = true;

  dependencies = [
    numpy
    scipy
    matplotlib
    pyparsing
    tables
    sympy
    meshio
    pyvista
  ];

  postPatch = ''
    # slow tests
    rm sfepy/tests/test_io.py
    rm sfepy/tests/test_elasticity_small_strain.py
    rm sfepy/tests/test_term_call_modes.py
    rm sfepy/tests/test_refine_hanging.py
    rm sfepy/tests/test_hyperelastic_tlul.py
    rm sfepy/tests/test_poly_spaces.py
    rm sfepy/tests/test_linear_solvers.py
    rm sfepy/tests/test_quadratures.py
  '';

  nativeCheckInputs = [ pytest ];

  checkPhase = ''
    export OMPI_MCA_plm_rsh_agent=${openssh}/bin/ssh
    export HOME=$TMPDIR
    mv sfepy sfepy.hidden
    mkdir -p $HOME/.matplotlib
    echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
    ${python.interpreter} -c "import sfepy; sfepy.test()"
  '';

  meta = {
    homepage = "https://sfepy.org/";
    description = "Simple Finite Elements in Python";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ wd15 ];
  };
}