Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python version pin #2085

Merged
merged 1 commit into from
Jan 21, 2024

Conversation

mathbunnyru
Copy link
Member

Describe your changes

Issue ticket if applicable

Fix: #2084

Checklist (especially for first-time contributors)

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests
  • I will try not to use force-push to make the review process easier for reviewers
  • I have updated the documentation for significant changes

@@ -117,7 +117,8 @@ RUN set -x && \
'jupyter_core' && \
rm -rf /tmp/bin/ && \
# Pin major.minor version of python
mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \
# https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning
mamba list --full-name 'python' | tail -1 | tr -s ' ' | cut -d ' ' -f 1,2 | sed 's/\.[^.]*$/.*/' >> "${CONDA_DIR}/conda-meta/pinned" && \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified a little bit the command here, --full-name is exactly what we need.
I used sed command from @ehfd issue: #2084 (comment), but removed extra space it was adding there.

@@ -117,7 +117,8 @@ RUN set -x && \
'jupyter_core' && \
rm -rf /tmp/bin/ && \
# Pin major.minor version of python
mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \
# https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future contributors will be happy to see it's an official and recommended way of pinning packages.

@mathbunnyru mathbunnyru merged commit a4ede5d into jupyter:main Jan 21, 2024
64 checks passed
max-muoto pushed a commit to max-muoto/docker-stacks that referenced this pull request Mar 10, 2024
max-muoto pushed a commit to max-muoto/docker-stacks that referenced this pull request Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python version pinning mechanism in docker-stack-foundation does not match comment description
1 participant