2022-04-27 09:35:20 +00:00
|
|
|
pytestXdistHook() {
|
|
|
|
pytestFlagsArray+=(
|
|
|
|
"--numprocesses=$NIX_BUILD_CORES"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
# the flags should be added before pytestCheckHook runs so
|
|
|
|
# until we have dependency mechanism in generic builder, we need to use this ugly hack.
|
|
|
|
|
|
|
|
if [ -z "${dontUsePytestXdist-}" ] && [ -z "${dontUsePytestCheck-}" ]; then
|
2024-10-11 05:15:48 +00:00
|
|
|
if [[ " ${preDistPhases[*]:-} " =~ " pytestCheckPhase " ]]; then
|
|
|
|
_preDistPhases="${preDistPhases[*]} "
|
|
|
|
_preDistPhases="${_preDistPhases/ pytestCheckPhase / pytestXdistHook pytestCheckPhase }"
|
|
|
|
if [[ -n "${__structuredAttrs-}" ]]; then
|
|
|
|
preDistPhases=()
|
|
|
|
else
|
|
|
|
preDistPhases=""
|
|
|
|
fi
|
|
|
|
appendToVar preDistPhases $_preDistPhases
|
|
|
|
unset _preDistPhases
|
2022-04-27 09:35:20 +00:00
|
|
|
else
|
2024-10-11 05:15:48 +00:00
|
|
|
appendToVar preDistPhases pytestXdistHook
|
2022-04-27 09:35:20 +00:00
|
|
|
fi
|
|
|
|
fi
|