|
44 | 44 | uses: actions/setup-python@v4
|
45 | 45 | with:
|
46 | 46 | python-version: |
|
47 |
| - 3.8 |
48 | 47 | 3.9
|
49 | 48 |
|
50 | 49 | - name: Install pipenv and pip-versions
|
|
92 | 91 | for dir in "${directories[@]}"; do
|
93 | 92 | counter=$((counter+1))
|
94 | 93 | 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 - |
96 | 121 | echo "$((total-counter)) directories remaining.."
|
97 | 122 | done
|
98 | 123 | else
|
|
0 commit comments