File tree 3 files changed +37
-5
lines changed
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
7
7
# <package_name> = <version>
8
8
9
9
RUN 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
12
16
13
17
# Reset and copy updated files with updated privs to keep image size down
14
18
FROM mcr.microsoft.com/devcontainers/base:1-bullseye
Original file line number Diff line number Diff line change @@ -180,3 +180,29 @@ checkCondaPackageVersion()
180
180
current_version=$( conda list " ${PACKAGE} " | grep -E " ^${PACKAGE} \s" | awk ' {print $2}' )
181
181
check-version-ge " conda-${PACKAGE} -requirement" " ${current_version} " " ${REQUIRED_VERSION} "
182
182
}
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
18
18
19
19
check " usr-local-etc-config-does-not-exist" test ! -f " /usr/local/etc/gitconfig"
20
20
21
- checkPythonPackageVersion " cryptography" " 41 .0.7 "
21
+ checkPythonPackageVersion " cryptography" " 42 .0.2 "
22
22
checkPythonPackageVersion " setuptools" " 65.5.1"
23
23
checkPythonPackageVersion " wheel" " 0.38.1"
24
24
25
- checkCondaPackageVersion " cryptography" " 41 .0.7 "
26
- checkCondaPackageVersion " pyopenssl" " 23.2 .0"
25
+ checkCondaPackageVersion " cryptography" " 42 .0.2 "
26
+ checkCondaPackageVersion " pyopenssl" " 24.0 .0"
27
27
checkCondaPackageVersion " setuptools" " 65.5.1"
28
28
checkCondaPackageVersion " wheel" " 0.38.1"
29
29
checkCondaPackageVersion " requests" " 2.31.0"
@@ -33,5 +33,7 @@ check "conda-update-conda" bash -c "conda update -y conda"
33
33
check " conda-install-tensorflow" bash -c " conda create --name test-env -c conda-forge --yes tensorflow"
34
34
check " conda-install-pytorch" bash -c " conda create --name test-env -c conda-forge --yes pytorch"
35
35
36
+ checkPipWorkingCorrectly
37
+
36
38
# Report result
37
39
reportResults
You can’t perform that action at this time.
0 commit comments