treewide: handle preDistPhases __structuredAttrs-agnostically

Always specify the preDistPhases attribute as a list instead of a string.

Append elements to the preDistPhases Bash variable using appendToVar
instead of string or Bash array concatenation.

Handle element insertion before a specific element using string
substitution as before, but handle both structured and unstructured
attributes.
This commit is contained in:
Yueh-Shun Li
2024-09-03 05:33:59 +08:00
parent 385d523a8e
commit 054c5f0e10
17 changed files with 40 additions and 26 deletions
@@ -42,7 +42,7 @@ buildPythonPackage rec {
find $out -name .pytest_cache -type d -exec rm -rf {} +
}
preDistPhases+=" pytestcachePhase"
appendToVar preDistPhases pytestcachePhase
# pytest generates it's own bytecode files to improve assertion messages.
# These files similar to cpython's bytecode files but are never laoded
@@ -55,7 +55,7 @@ buildPythonPackage rec {
# https://github.com/pytest-dev/pytest/blob/4.6.11/src/_pytest/assertion/rewrite.py#L32-L47
find $out -name "*-PYTEST.py[co]" -delete
}
preDistPhases+=" pytestRemoveBytecodePhase"
appendToVar preDistPhases pytestRemoveBytecodePhase
'';
meta = with lib; {