From 29e1160e514b286ea9af4de84eddf33f0d10ff8c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 4 Feb 2025 08:56:02 +0100 Subject: [PATCH] python312Packages.pyprecice: cleanup and fix --- .../python-modules/pyprecice/default.nix | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/pyprecice/default.nix b/pkgs/development/python-modules/pyprecice/default.nix index c005eaaa23d3..48bf841129f8 100644 --- a/pkgs/development/python-modules/pyprecice/default.nix +++ b/pkgs/development/python-modules/pyprecice/default.nix @@ -1,15 +1,18 @@ { lib, buildPythonPackage, - setuptools, - pip, - cython, fetchFromGitHub, + + # build-system + cython, + pip, + pkgconfig, + setuptools, + + # dependencies mpi4py, numpy, precice, - pkgconfig, - pythonOlder, }: buildPythonPackage rec { @@ -17,8 +20,6 @@ buildPythonPackage rec { version = "3.1.2"; pyproject = true; - disabled = pythonOlder "3.7"; - src = fetchFromGitHub { owner = "precice"; repo = "python-bindings"; @@ -26,14 +27,24 @@ buildPythonPackage rec { hash = "sha256-/atuMJVgvY4kgvrB+LuQZmJuSK4O8TJdguC7NCiRS2Y="; }; - nativeBuildInputs = [ - setuptools - pip + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "setuptools>=61,<72" "setuptools" \ + --replace-fail "numpy<2" "numpy" + ''; + + build-system = [ cython + pip pkgconfig + setuptools ]; - propagatedBuildInputs = [ + pythonRelaxDeps = [ + "numpy" + ]; + + dependencies = [ numpy mpi4py precice @@ -44,10 +55,11 @@ buildPythonPackage rec { # Do not use pythonImportsCheck because this will also initialize mpi which requires a network interface - meta = with lib; { + meta = { description = "Python language bindings for preCICE"; homepage = "https://github.com/precice/python-bindings"; - license = licenses.lgpl3Only; - maintainers = with maintainers; [ Scriptkiddi ]; + changelog = "https://github.com/precice/python-bindings/blob/v${version}/CHANGELOG.md"; + license = lib.licenses.lgpl3Only; + maintainers = with lib.maintainers; [ Scriptkiddi ]; }; }