-
Notifications
You must be signed in to change notification settings - Fork 14
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 pre-commit in the image #507
Conversation
/etc/pip.conf
-> /opt/conda/pip.conf
/etc/pip.conf
-> /opt/conda/pip.conf
/etc/pip.conf
to /opt/conda/pip.conf
/etc/pip.conf
to /opt/conda/pip.conf
@PNOGillespie could you please take a look and see if the image Tagging multiple people for review so that we're all aware that this pip configuration exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked out your image and pushed a test commit to my own remote, no issues to report! (at least from the perspective of a contributor rather than a core dev)
@@ -42,8 +42,19 @@ RUN cat /opt/requirements.txt | xargs -I{} conda config --system --add pinned_pa | |||
|
|||
# Configure pip to use the same requirements file as constraints file. | |||
ENV PIP_CONSTRAINT /opt/requirements.txt | |||
# Ensure that pip installs packages to ~/.local by default | |||
COPY pip.conf /etc/pip.conf | |||
# Ensure that pip installs packages to '~/.local/lib/python3.X/site-packages/' by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this means when python version changed in the image, dependencies of apps need to be reinstalled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, see #317
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @danielhollas
One question in comment. The changes looks all good.
# Other locations such as '~/.config/pip/pip.conf' or '/etc/pip.conf' would interfere with virtual environments, | ||
# for example those used by pre-commit. | ||
# We can't use the PIP_USER env variable for the same reason. | ||
# To better understand this, try running `pip config debug` and see | ||
# https://github.com/aiidalab/aiidalab-docker-stack/issues/501 | ||
COPY pip.conf "${CONDA_DIR}/pip.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
@PNOGillespie thank you very much for testing, and thank you @unkcpz for review! I am going to merge this in the afternoon and release a new image version (which will also include AiiDA 2.6.3) |
Fixes pre-commit by moving the pip.conf configuration (which automatically sets the
--user
option topip install
) from the globaletc/pip.conf
to site-specific/opt/conda/pip.conf
. In this way, the configuration does not mess with virtual environments. See the long comment in the Dockerfile for detailed explanation.Fixes #501