Skip to content

Commit b7fdbb6

Browse files
committed
fix(ci): skip import profiler on python version mismatch during install
1 parent edc0423 commit b7fdbb6

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

ci/run_single_test.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,26 @@ case ${TEST_TYPE} in
135135
echo "Could not find baseline commit for ${TARGET_BRANCH:-main}. Skipping baseline generation."
136136
fi
137137
fi
138+
# Run pip install and capture output to inspect for python compatibility issues
139+
pip_output=$(pip install -e . 2>&1)
140+
pip_retval=$?
138141

139-
pip install -e .
140-
142+
if [ ${pip_retval} -ne 0 ]; then
143+
echo "${pip_output}"
144+
if echo "${pip_output}" | grep -q "requires a different Python"; then
145+
echo "WARNING: Package ${PACKAGE_NAME} is not compatible with Python ${PY_VERSION}. Skipping import profiler."
146+
deactivate
147+
rm -rf .venv-profiler
148+
rm -rf "${PROFILER_TEMP_DIR}"
149+
exit 0
150+
else
151+
echo "ERROR: Failed to install package ${PACKAGE_NAME}."
152+
deactivate
153+
rm -rf .venv-profiler
154+
rm -rf "${PROFILER_TEMP_DIR}"
155+
exit ${pip_retval}
156+
fi
157+
fi
141158
if [ -f "${BASELINE_CSV}" ]; then
142159
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100
143160
else

0 commit comments

Comments
 (0)