-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pin Python version to 3.11 #1118
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -319,6 +319,7 @@ | |
fi | ||
|
||
if [[ ${SKIP_INSTALL} -eq 0 ]]; then | ||
# look for pre-created poetry .venv | ||
virtenv="${HOME}/.local/ods-ci/.venv" | ||
if [[ -d "${virtenv}" ]]; then | ||
echo "Using a pre-created virtual environment in '${virtenv}' for poetry to save time." | ||
|
@@ -327,6 +328,23 @@ | |
else | ||
echo "Pre-created virtual environment has not been found in '${virtenv}'. All dependencies will be installed from scratch." | ||
fi | ||
# ensure python 3.11 | ||
python=$(poetry env info --executable) | ||
if [[ -n "${python}" ]] && ${python} -c 'import sys; sys.exit(0 if sys.version_info[0:2] == (3, 11) else 1)'; then | ||
echo "Python '${python}' will be used" | ||
else | ||
echo "Python '${python}' is not of the correct version" | ||
python311=$(which python3.11) | ||
if [[ -n "${python311}" ]]; then | ||
echo "Configuring poetry to use Python ${python311}" | ||
poetry env use "${python311}" | ||
else | ||
echo "[ERROR] Python 3.11 was not found!" | ||
echo "Install Python 3.11 on your machine. On Fedora, do 'sudo dnf install -y python3.11-devel'" | ||
echo "then run 'poetry env use /path/to/python3.11' and then try running robot again" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
poetry --no-interaction install --sync | ||
fi | ||
|
@@ -351,7 +369,7 @@ | |
fi | ||
|
||
|
||
robot ${TEST_EXCLUDE_TAG} ${TEST_INCLUDE_TAG} -d ${TEST_ARTIFACT_DIR} -x xunit_test_result.xml -r test_report.html ${TEST_VARIABLES} --variablefile ${TEST_VARIABLES_FILE} --exclude TBC ${EXTRA_ROBOT_ARGS} ${TEST_CASE_FILE} | ||
Check warning on line 372 in ods_ci/run_robot_test.sh GitHub Actions / shellcheck linter
Check warning on line 372 in ods_ci/run_robot_test.sh GitHub Actions / shellcheck linter
Check warning on line 372 in ods_ci/run_robot_test.sh GitHub Actions / shellcheck linter
Check warning on line 372 in ods_ci/run_robot_test.sh GitHub Actions / shellcheck linter
Check warning on line 372 in ods_ci/run_robot_test.sh GitHub Actions / shellcheck linter
Check warning on line 372 in ods_ci/run_robot_test.sh GitHub Actions / shellcheck linter
Check warning on line 372 in ods_ci/run_robot_test.sh GitHub Actions / shellcheck linter
|
||
# shellcheck disable=SC2116 | ||
exit_status=$(echo $?) | ||
echo "${exit_status}" | ||
|
@@ -365,7 +383,7 @@ | |
then | ||
echo "Test results artifacts are too large for email" | ||
rm rf_results.tar.gz | ||
tar cvzf rf_results.tar.gz $(find "${TEST_ARTIFACT_DIR}" -regex '.*\(xml\|html\)$') &> /dev/null | ||
Check warning on line 386 in ods_ci/run_robot_test.sh GitHub Actions / shellcheck linter
|
||
fi | ||
python3 ods_ci/utils/scripts/Sender/send_report.py send_email_report -s "${EMAIL_FROM}" -r "${EMAIL_TO}" -b "ODS-CI: Run Results" \ | ||
-v "${EMAIL_SERVER}" -a "rf_results.tar.gz" -u "${EMAIL_SERVER_USER}" -p "${EMAIL_SERVER_PW}" \ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linter wants this when you have a py3.11 project
at some point they made list[...] be an alias for typing.List[...], so that's a cleanup it wants
not sure about why it dislikes Optional, that should be fine imo, and | None is not a clear win in my eyes