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

Fix issue related to the installation of Python #236

Merged
merged 13 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/coverage/cpp.develop.coverage_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Directory: ..
------------------------------------------------------------------------------
File Lines Exec Cover Missing
------------------------------------------------------------------------------
client/cpp/CSVParserUtil.cpp 345 291 84% 37-45,48,50,239,241,264-265,269-270,286,292,304,313-314,317,323,331-332,335,345,351,363,368,373,379-387,389,425,435-437,474-476,478,503-506
client/cpp/CSVParserUtil.cpp 345 290 84% 37-45,48,50,239,241,264-265,269-270,286,292,304,313-314,317,323,331-332,335,345,351,363,368,373,379-387,389,425,435-437,450,474-476,478,503-506
client/cpp/VDMSClient.cc 20 20 100%
src/AutoDeleteNode.cc 9 8 88% 40
src/BackendNeo4j.cc 121 0 0% 4,6-17,20,24,29-41,46-47,52,55-58,61-62,64-70,73,78,82-83,85-86,89,92,95-96,98,102,104,106-109,111,114-116,118,122,131-132,138,140,142-144,147,150-152,155-159,161-175,178,182,184,186,195,197-200,204-205,207-208,211-215,220,224-226,228
Expand Down Expand Up @@ -57,5 +57,5 @@ utils/src/comm/Exception.cc 6 0 0% 35-40
utils/src/stats/SystemStats.cc 250 249 99% 453
utils/src/timers/TimerMap.cc 82 75 91% 126,151,153,155-158
------------------------------------------------------------------------------
TOTAL 10246 6572 64%
TOTAL 10246 6571 64%
------------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion .github/coverage/cpp.develop.coverage_value.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
64.1421
64.1323
42 changes: 27 additions & 15 deletions .github/scripts/setup_vdms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,38 @@ else

fi


# SETUP PYTHON VERSION
version_exists=$(echo "$(python${PYTHON_BASE} --version | cut -d ' ' -f 2)" || echo false)
if [ "${version_exists}" != "${PYTHON_VERSION}" ]
# Check the version used by python3
version_exists=$(echo "$(python3 --version | cut -d ' ' -f 2)" || echo false)
version_used_base=""
is_older_version=$((dpkg --compare-versions "${version_exists}" "lt" "${PYTHON_VERSION}" && echo true) || echo false)
# if that version is lower than the required one
if [ $is_older_version = true ]
then
echo "Installing python ${PYTHON_VERSION}..."
apt update -y
apt install -y libffi-dev libgdbm-dev libnss3-dev libreadline-dev libsqlite3-dev zlib1g-dev
curl -L -o ${VDMS_DEP_DIR}/Python-${PYTHON_VERSION}.tgz https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
cd ${VDMS_DEP_DIR}
tar -xzf Python-${PYTHON_VERSION}.tgz
cd Python-${PYTHON_VERSION}
./configure --enable-optimizations && make -j && make altinstall
# Check if the path to the required minimum version exists
# if it doesn't exist then it displays the error and finish the script
if [[ "$(which python${PYTHON_BASE})" == "" ]]; then
echo "Error: please install the Python v${PYTHON_VERSION} or later..."
# CLEANUP
rm -rf $VDMS_DEP_DIR
echo "Exiting..."
exit 1
fi

# If the required version of Python is installed but it is not being used currently
# Then, the script is going to use at least the version that it is required
version_used_base=${PYTHON_BASE}
else
echo "python ${PYTHON_VERSION} already installed"
# If the current version of Python is equal or later than the required one
echo "$(python3 --version) is already installed"
version_used_base=$(echo ${version_exists} | cut -d. -f-2 || echo false)
fi
alias python=$(which python${PYTHON_BASE})
alias python3=$(which python${PYTHON_BASE})

python${PYTHON_BASE} -m venv ${VIRTUAL_ENV}
# It sets the Python version found (3.12 or more recent) as default
alias python=$(which python${version_used_base})
alias python3=$(which python${version_used_base})

python${version_used_base} -m venv ${VIRTUAL_ENV}
export PATH="$VIRTUAL_ENV/bin:$PATH"


Expand Down