File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
images/docker-stacks-foundation
tests/docker-stacks-foundation Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ RUN set -x && \
117
117
'jupyter_core' && \
118
118
rm -rf /tmp/bin/ && \
119
119
# Pin major.minor version of python
120
- mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \
120
+ # https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning
121
+ mamba list --full-name 'python' | tail -1 | tr -s ' ' | cut -d ' ' -f 1,2 | sed 's/\. [^.]*$/.*/' >> "${CONDA_DIR}/conda-meta/pinned" && \
121
122
mamba clean --all -f -y && \
122
123
fix-permissions "${CONDA_DIR}" && \
123
124
fix-permissions "/home/${NB_USER}"
Original file line number Diff line number Diff line change @@ -22,3 +22,13 @@ def test_python_version(container: TrackedContainer) -> None:
22
22
major_minor_version = full_version [: full_version .rfind ("." )]
23
23
24
24
assert major_minor_version == EXPECTED_PYTHON_VERSION
25
+
26
+
27
+ def test_python_pinned_version (container : TrackedContainer ) -> None :
28
+ LOGGER .info (f"Checking that pinned python version is { EXPECTED_PYTHON_VERSION } .*" )
29
+ logs = container .run_and_wait (
30
+ timeout = 5 ,
31
+ tty = True ,
32
+ command = ["cat" , "/opt/conda/conda-meta/pinned" ],
33
+ )
34
+ assert logs .startswith (f"python { EXPECTED_PYTHON_VERSION } .*" )
You can’t perform that action at this time.
0 commit comments