1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 cython,
8 pip,
9 pkgconfig,
10 setuptools,
11
12 # dependencies
13 mpi4py,
14 numpy,
15 precice,
16}:
17
18buildPythonPackage rec {
19 pname = "pyprecice";
20 version = "3.1.2";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "precice";
25 repo = "python-bindings";
26 tag = "v${version}";
27 hash = "sha256-/atuMJVgvY4kgvrB+LuQZmJuSK4O8TJdguC7NCiRS2Y=";
28 };
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace-fail "setuptools>=61,<72" "setuptools" \
33 --replace-fail "numpy<2" "numpy"
34 '';
35
36 build-system = [
37 cython
38 pip
39 pkgconfig
40 setuptools
41 ];
42
43 pythonRelaxDeps = [
44 "numpy"
45 ];
46
47 dependencies = [
48 numpy
49 mpi4py
50 precice
51 ];
52
53 # Disable Test because everything depends on open mpi which requires network
54 doCheck = false;
55
56 # Do not use pythonImportsCheck because this will also initialize mpi which requires a network interface
57
58 meta = {
59 description = "Python language bindings for preCICE";
60 homepage = "https://github.com/precice/python-bindings";
61 changelog = "https://github.com/precice/python-bindings/blob/v${version}/CHANGELOG.md";
62 license = lib.licenses.lgpl3Only;
63 maintainers = with lib.maintainers; [ Scriptkiddi ];
64 };
65}