-
Notifications
You must be signed in to change notification settings - Fork 119
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
Stop importing pip, use subprocesses instead. Will close #710 #797
Conversation
In principle this is done, but I don't know how to exercise the |
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.
The install_base_packages.py
code is only really for building Python 2.7 dependencies and I doubt that it will work now since we do not specify the versions of every dependency. Probably, one dependency will be installed via pip
which pulls in an incompatible dependency that we did not version.
But you can try to build a minimal set of Python 2.7 dependencies with
python bootstrap.py base --builder=cctbxlite
remove duplicate `packaging` dependency
@JBlaschke From Billy:
|
Hi Folks, I am still waiting to test this on Perlmutter (longer than expected maintenance), but I can say that it works on Cori. |
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.
This looks like a run-of-the-mill replacement of the pip module with a sub-process call. The only concern RE HPC is if you tried that with MPI then you might get into trouble because MPI (and libfabric) are not considered fork safe, while subprocess will call fork
. I don't think that this will be an issue for an installer however -- so I think it's safe to proceed.
Another thing to consider is that this might be called within a workflow management tool. In that case we need to make sure that the workflow tool exposes the correct environment to all children. Most workflow tools use fork
or execve
so we should be safe there, and I would counsel vigilance in case we see the "wrong" pip
being picked up.
@dwpaley for cleanliness have you or @bkpoon considered: https://github.com/amoffat/sh |
@bkpoon I have a question about the most elegant way to tell |
As discussed in: pypa/setuptools#3297 it seems that importing pip is just not supported. Our use case was not really compelling, we were (1) checking the version and (2) using a
pip._internal.main
api which is a thin (and to be deprecated) wrapper overpip._internal.cli.main.main
There's a clear discussion here: https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program of why using pip viasubprocess
is preferred.This is a draft because there's a second place in
libtbx/auto_build/install_base_packages.py
wherepip._internal.main
is used in a similar way.