ae2dc6aea6
GitOrigin-RevId: 4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0
24 lines
811 B
Bash
24 lines
811 B
Bash
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
|
|
if [[ " ${preDistPhases[*]:-} " =~ " pytestCheckPhase " ]]; then
|
|
_preDistPhases="${preDistPhases[*]} "
|
|
_preDistPhases="${_preDistPhases/ pytestCheckPhase / pytestXdistHook pytestCheckPhase }"
|
|
if [[ -n "${__structuredAttrs-}" ]]; then
|
|
preDistPhases=()
|
|
else
|
|
preDistPhases=""
|
|
fi
|
|
appendToVar preDistPhases $_preDistPhases
|
|
unset _preDistPhases
|
|
else
|
|
appendToVar preDistPhases pytestXdistHook
|
|
fi
|
|
fi
|