about summary refs log tree commit diff
path: root/pkgs/development/python-modules/sfepy/default.nix
blob: 8e2c18fb1e625cc759413b68bfd7996a68b5dd93 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, numpy
, scipy
, matplotlib
, pyparsing
, tables
, cython_0
, python
, sympy
, meshio
, mpi4py
, psutil
, openssh
, pyvista
, pytest
, pythonOlder
}:

buildPythonPackage rec {
  pname = "sfepy";
  version = "2023.1";
  format = "setuptools";
  disabled = pythonOlder "3.8";

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

  propagatedBuildInputs = [
    numpy
    cython_0
    scipy
    matplotlib
    pyparsing
    tables
    sympy
    meshio
    mpi4py
    psutil
    openssh
    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 = with lib; {
    homepage = "https://sfepy.org/";
    description = "Simple Finite Elements in Python";
    license = licenses.bsd3;
    maintainers = with maintainers; [ wd15 ];
  };
}