nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 numpy,
5 scipy,
6 pyamg,
7 future,
8 matplotlib,
9 tkinter,
10 mpi4py,
11 scikit-fmm,
12 gmsh,
13 python,
14 stdenv,
15 openssh,
16 fetchFromGitHub,
17 pythonAtLeast,
18}:
19
20buildPythonPackage rec {
21 pname = "fipy";
22 version = "4.0";
23 format = "setuptools";
24
25 # Python 3.12 is not yet supported.
26 # https://github.com/usnistgov/fipy/issues/997
27 # https://github.com/usnistgov/fipy/pull/1023
28 disabled = pythonAtLeast "3.12";
29
30 src = fetchFromGitHub {
31 owner = "usnistgov";
32 repo = "fipy";
33 tag = version;
34 hash = "sha256-pq5Xjp3YD5cILfV+Atl/Sq0SeZjDR/QQa4/F59LhGIo=";
35 };
36
37 propagatedBuildInputs = [
38 numpy
39 scipy
40 pyamg
41 matplotlib
42 tkinter
43 mpi4py
44 future
45 scikit-fmm
46 openssh
47 ]
48 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmsh ];
49
50 nativeCheckInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmsh ];
51
52 # NOTE: Two of the doctests in fipy.matrices.scipyMatrix._ScipyMatrix.CSR fail, and there is no
53 # clean way to disable them.
54 doCheck = false;
55
56 checkPhase = ''
57 export OMPI_MCA_plm_rsh_agent=${openssh}/bin/ssh
58 ${python.interpreter} setup.py test --modules
59 '';
60
61 # NOTE: Importing fipy within the sandbox will fail because plm_rsh_agent isn't set and the process isn't able
62 # to start a daemon on the builder.
63 # pythonImportsCheck = [ "fipy" ];
64
65 meta = {
66 homepage = "https://www.ctcms.nist.gov/fipy/";
67 description = "Finite Volume PDE Solver Using Python";
68 changelog = "https://github.com/usnistgov/fipy/blob/${src.tag}/CHANGELOG.rst";
69 license = lib.licenses.free;
70 maintainers = with lib.maintainers; [ wd15 ];
71 };
72}