Skip to content

Commit 5e2fc7f

Browse files
committed
fix(python/checkov): ensure a working openai version for python 3.7
- openai/openai-python#1263
1 parent 7ad6567 commit 5e2fc7f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/usr/local/containerbase/tools/v2/checkov.sh

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
# shellcheck source=/dev/null
44
. "$(get_containerbase_path)/utils/python.sh"
55

6+
function install_tool () {
7+
local python_version
8+
local python_minor_version
9+
python_version=$(get_tool_version python)
10+
python_minor_version=$(get_python_minor_version "${python_version}")
11+
12+
if [[ "${python_minor_version}" == "3.7" ]]; then
13+
# checkov <2.5 needs a workaround openai https://github.com/openai/openai-python/issues/1263
14+
install_python_tool openai==1.14.1
15+
else
16+
install_python_tool
17+
fi
18+
}
19+
620
function link_tool () {
721
post_install
822
[[ -n $SKIP_VERSION ]] || checkov --version

test/python/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ RUN set -ex \
192192
# renovate: datasource=pypi
193193
RUN install-tool checkov 3.2.20
194194

195+
# test old checkov with old python
196+
RUN install-tool python 3.7.17
197+
RUN install-tool checkov 2.3.298
198+
195199
#--------------------------------------
196200
# test pipenv-b: pipenv (multiple python)
197201
#--------------------------------------

0 commit comments

Comments
 (0)