From d74a88a8b047f4dd11552b9ae37bc643b0db8081 Mon Sep 17 00:00:00 2001 From: abhijeet-dhumal Date: Tue, 25 Jun 2024 19:52:38 +0530 Subject: [PATCH] Fix ODH notebooks sync workflow --- .github/workflows/odh-notebooks-sync.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/odh-notebooks-sync.yml b/.github/workflows/odh-notebooks-sync.yml index 14a743a6a..996a6bd12 100644 --- a/.github/workflows/odh-notebooks-sync.yml +++ b/.github/workflows/odh-notebooks-sync.yml @@ -44,7 +44,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: | - 3.8 3.9 - name: Install pipenv and pip-versions @@ -92,7 +91,28 @@ jobs: for dir in "${directories[@]}"; do counter=$((counter+1)) echo "--Processing directory $counter '$dir' of total $total" - cd "$dir" && pipenv install ${package_name}~="${CODEFLARE_RELEASE_VERSION}" && pipenv --rm && cd - + cd "$dir" + pipfile_python_version=$(grep -E '^python_version' ./Pipfile | cut -d '"' -f 2) + if [[ "$pipfile_python_version" > 3.8 ]]; then + #install specified package + if ! pipenv install ${package_name}~="${CODEFLARE_RELEASE_VERSION}"; then + echo "Failed to install ${package_name} with version ${CODEFLARE_RELEASE_VERSION} in $dir" + # exit 1 + fi + # Lock dependencies, ensuring pre-release are included and clear previous state + if ! pipenv lock --pre --clear ; then + echo "Failed to lock dependencies" + # exit 1 + fi + # remove virtual env and clear cache + if ! penv --rm --clear ; then + echo "Failed to remove virtual environment" + # exit 1 + fi + else + echo "Skipped installtion of ${package_name} with version ${CODEFLARE_RELEASE_VERSION} in $dir" + fi + cd - echo "$((total-counter)) directories remaining.." done else