Skip to content

Commit a68906b

Browse files
Fix ODH notebooks sync workflow
1 parent 713d011 commit a68906b

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

.github/workflows/odh-notebooks-sync.yml

+27-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ jobs:
4444
uses: actions/setup-python@v4
4545
with:
4646
python-version: |
47-
3.8
4847
3.9
4948
5049
- name: Install pipenv and pip-versions
@@ -92,7 +91,33 @@ jobs:
9291
for dir in "${directories[@]}"; do
9392
counter=$((counter+1))
9493
echo "--Processing directory $counter '$dir' of total $total"
95-
cd "$dir" && pipenv install ${package_name}~="${CODEFLARE_RELEASE_VERSION}" && pipenv --rm && cd -
94+
cd "$dir"
95+
minimum_supported_python_version=3.9
96+
minimum_supported_python_version_major=$(echo "$minimum_supported_python_version" | awk -F '.' '{print $1}') #integer of minimum_supported_python_version
97+
minimum_supported_python_version_minor=$(echo "$minimum_supported_python_version" | awk -F '.' '{print $2}') #decimal of minimum_supported_python_version
98+
pipfile_python_version=$(grep -E '^python_version' ./Pipfile | cut -d '"' -f 2) # extracted from pipfile
99+
pipfile_python_version_major=$(echo "$pipfile_python_version" | awk -F '.' '{print $1}')
100+
pipfile_python_version_minor=$(echo "$pipfile_python_version" | awk -F '.' '{print $2}')
101+
if [[ "pipfile_python_version_major" -ge "$minimum_supported_python_version_major" && "pipfile_python_version_minor" -ge "$minimum_supported_python_version_minor" ]]; then
102+
#install specified package
103+
if ! pipenv install ${package_name}~="${CODEFLARE_RELEASE_VERSION}"; then
104+
echo "Failed to install ${package_name} with version ${CODEFLARE_RELEASE_VERSION} in $dir"
105+
exit 1
106+
fi
107+
# Lock dependencies, ensuring pre-release are included and clear previous state
108+
if ! pipenv lock --pre --clear ; then
109+
echo "Failed to lock dependencies"
110+
exit 1
111+
fi
112+
# remove virtual env and clear cache
113+
if ! pipenv --rm --clear ; then
114+
echo "Failed to remove virtual environment"
115+
exit 1
116+
fi
117+
else
118+
echo "Skipped installation of ${package_name} with version ${CODEFLARE_RELEASE_VERSION} in $dir"
119+
fi
120+
cd -
96121
echo "$((total-counter)) directories remaining.."
97122
done
98123
else

0 commit comments

Comments
 (0)