Skip to content
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

[Framework] Add error detection to python pip calls #5927

Merged
merged 6 commits into from
Jan 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions mk/spksrc.service.installer.functions
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,16 @@ initialize_variables ()

install_python_virtualenv ()
{
# Output Python version (confirming PATH)
# Print out default python version found in PATH
python3 --version

# Print out default pip version
read -r -a PIP_VERSION 2>/dev/null <<< $(python3 -m pip --version)
echo "INFO: Default pip version found ${PIP_VERSION[1]}"

mreid-tt marked this conversation as resolved.
Show resolved Hide resolved
# Create a Python virtualenv
python3 -m venv --system-site-packages ${SYNOPKG_PKGDEST}/env

# Update to latest pip package installer
python3 -m pip install --upgrade pip

if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
set_unix_permissions ${SYNOPKG_PKGDEST}/env
fi
Expand All @@ -95,10 +96,12 @@ install_python_wheels ()
if [ -s ${requirements} ]; then
echo "Install packages from wheels [${requirements}]"
pip install $([ $# -gt 0 ] && echo $*) \
--disable-pip-version-check \
--force-reinstall \
--cache-dir ${cachedir} \
--find-links ${wheelhouse} \
--requirement ${requirements}
--requirement ${requirements} \
|| echo "ERROR: Python package installation failed" 1>&2
fi

if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
Expand Down