File tree Expand file tree Collapse file tree 3 files changed +37
-5
lines changed Expand file tree Collapse file tree 3 files changed +37
-5
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,12 @@ FROM continuumio/miniconda3 as upstream
77 # <package_name> = <version>
88
99RUN conda install \
10- # https://github.com/advisories/GHSA-jfhm-5ghh-2f97
11- cryptography==41.0.7
10+ # https://github.com/advisories/GHSA-3ww4-gg4f-jr7f
11+ cryptography==42.0.2
12+
13+ RUN python3 -m pip install --upgrade \
14+ # installed for compatibility with cryptography v42.0.2
15+ pyopenssl==24.0.0
1216
1317# Reset and copy updated files with updated privs to keep image size down
1418FROM mcr.microsoft.com/devcontainers/base:1-bullseye
Original file line number Diff line number Diff line change @@ -180,3 +180,29 @@ checkCondaPackageVersion()
180180 current_version=$( conda list " ${PACKAGE} " | grep -E " ^${PACKAGE} \s" | awk ' {print $2}' )
181181 check-version-ge " conda-${PACKAGE} -requirement" " ${current_version} " " ${REQUIRED_VERSION} "
182182}
183+
184+ # Function to check if a package is installed
185+ checkPackageInstalled () {
186+ if python -c " import $1 " & > /dev/null; then
187+ echo -e " \n✅ Passed! \n$1 is installed"
188+ else
189+ echo -e " $1 is NOT installed\n"
190+ echoStderr " ❌ check failed."
191+ fi
192+ }
193+
194+ # Function to install a package using pip
195+ installPackage () {
196+ python3 -m pip install " $1 "
197+ }
198+
199+ checkPipWorkingCorrectly () {
200+ # List of packages to install via pip
201+ packages=(" numpy" " requests" " matplotlib" )
202+ # Install packages and check if installation was successful
203+ for package in " ${packages[@]} " ; do
204+ echo -e " \n🧪 Testing pip install $package \n"
205+ installPackage " $package "
206+ checkPackageInstalled " $package "
207+ done
208+ }
Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ check "gitconfig-contains-name" sh -c "cat /etc/gitconfig | grep 'name = devcont
1818
1919check " usr-local-etc-config-does-not-exist" test ! -f " /usr/local/etc/gitconfig"
2020
21- checkPythonPackageVersion " cryptography" " 41 .0.7 "
21+ checkPythonPackageVersion " cryptography" " 42 .0.2 "
2222checkPythonPackageVersion " setuptools" " 65.5.1"
2323checkPythonPackageVersion " wheel" " 0.38.1"
2424
25- checkCondaPackageVersion " cryptography" " 41 .0.7 "
26- checkCondaPackageVersion " pyopenssl" " 23.2 .0"
25+ checkCondaPackageVersion " cryptography" " 42 .0.2 "
26+ checkCondaPackageVersion " pyopenssl" " 24.0 .0"
2727checkCondaPackageVersion " setuptools" " 65.5.1"
2828checkCondaPackageVersion " wheel" " 0.38.1"
2929checkCondaPackageVersion " requests" " 2.31.0"
@@ -33,5 +33,7 @@ check "conda-update-conda" bash -c "conda update -y conda"
3333check " conda-install-tensorflow" bash -c " conda create --name test-env -c conda-forge --yes tensorflow"
3434check " conda-install-pytorch" bash -c " conda create --name test-env -c conda-forge --yes pytorch"
3535
36+ checkPipWorkingCorrectly
37+
3638# Report result
3739reportResults
You can’t perform that action at this time.
0 commit comments