I have a private registry that stores SomePackage
that depends on other packages listed on pypi. I would like to install SomePackage
with all its dependencies using pip but I came across a problem.
At first I used the --extra-index-url pip option to install SomePackage
:
pip install --extra-index-url http://my.package.repo/simple SomePackage
But if SomePackage
also exist on pypi pip will simply install the latest version amongst the indexes given (and not give any priority to my private registry). That seems like a risk to me and some others. So I was wondering if there could be a workaround to prevent the involuntary installation of SomePackage
from pypi.
I have an idea, but maybe that's a bad one (or maybe it doesn't work as I expect):
# Install the package from the private registry without its dependencies:
pip install --no-deps --index-url http://my.package.repo/simple SomePackage
# Then install only its dependencies:
pip install --extra-index-url http://my.package.repo/simple SomePackage
This would only work for SomePackage
but all its dependencies from the private registry will not be "protected" by this approach. Any other/better idea?