From 87f48c0d09309333a123dcc4406f80d71825f0b6 Mon Sep 17 00:00:00 2001 From: scarlet-storm <12461256+scarlet-storm@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:39:30 +0530 Subject: [PATCH] ansible_2_{16,17}: fix build strict wheel dependency is not present in older ansible releases, hence substituteInPlace fails --- pkgs/development/python-modules/ansible/core.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/ansible/core.nix b/pkgs/development/python-modules/ansible/core.nix index db257a1a51db..bb46a3672f05 100644 --- a/pkgs/development/python-modules/ansible/core.nix +++ b/pkgs/development/python-modules/ansible/core.nix @@ -50,16 +50,11 @@ buildPythonPackage rec { patchShebangs --build packaging/cli-doc/build.py SETUPTOOLS_PATTERN='"setuptools[0-9 <>=.,]+"' - PYPROJECT=$(cat pyproject.toml) - if [[ "$PYPROJECT" =~ $SETUPTOOLS_PATTERN ]]; then - echo "setuptools replace: ''${BASH_REMATCH[0]}" - echo "''${PYPROJECT//''${BASH_REMATCH[0]}/'"setuptools"'}" > pyproject.toml - else - exit 2 - fi - - substituteInPlace pyproject.toml \ - --replace-fail "wheel == 0.45.1" wheel + WHEEL_PATTERN='"wheel[0-9 <>=.,]+"' + echo "Patching pyproject.toml" + # print replaced patterns to stdout + sed -r -i -e 's/'"$SETUPTOOLS_PATTERN"'/"setuptools"/w /dev/stdout' \ + -e 's/'"$WHEEL_PATTERN"'/"wheel"/w /dev/stdout' pyproject.toml ''; nativeBuildInputs = [