Using pip with two --extra-index-url arguments that both point to the same domain

2rs2ts

We use our own python package index at my office, and we're trying to add a new one. When I try to specify both indices at the same time, I get prompted to log in, but if I use only one at a time I don't.

For example:

$ pip install --user --upgrade \
    --extra-index-url https://<api token>:@packagecloud.io/2rs2ts/oldrepo/pypi/simple \
    --extra-index-url https://<other api token>:@packagecloud.io/2rs2ts/newrepo/pypi/simple \
    mypackage
Collecting mypackage
User for packagecloud.io:

But if I specify just one of either of those --extra-index-url arguments then I download my package just fine.

I'm 99% certain that I am passing the arguments correctly, since it's specified with an append action in the source. So I think the problem is that both of these index URLs are from packagecloud.io... but I could be wrong. Either way, how can I use both of my repos?

2rs2ts

Apparently this is a bug in pip. The HTTP basic auth information is not stored correctly when specifying multiple --extra-index-urls that point to the same domain. I filed an issue, but in the meantime, there is a workaround. By specifying one of the --extra-index-urls as the --index instead, and adding PyPI as an --extra-index-url, I was able to download my package successfully:

$ pip install --user --upgrade \
    --index https://<api token>:@packagecloud.io/2rs2ts/oldrepo/pypi/simple \
    --extra-index-url https://<other api token>:@packagecloud.io/2rs2ts/newrepo/pypi/simple \
    --extra-index-url https://pypi.python.org/simple \
    mypackage
Collecting mypackage
  Downloading https://packagecloud.io/2rs2ts/newrepo/pypi/packages/mypackage-1.0.0-py2-none-any.whl (52kB)
etc. etc.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Check two arguments in Java, either both not null or both null elegantly

Using an extra python package index url with setup.py

Can pip.conf specify two index-url at the same time?

create two method for same url pattern with different arguments

How to run two different apps on the same domain using heroku

python2; pip parse_requirements with --trusted-host and --extra-index-url

using replace logic in both arguments

Running both Node.js and Apache on the same domain and "URL"

Using htaccess, how to redirect all sub-domain URLS that are not www to same sub-domain URL on new domain?

Prolog ... define predicate that checks if both arguments are/point to the same atom

Passing PIP_EXTRA_INDEX_URL to docker build

Two different pointer arrays, but they both point to the same address

How to specify pip extra-index-url when creating an azureml environment?

Point to functions with different arguments using the same pointer

Using enable_if, in class template method, to check if two function arguments arguments are both std::array or both std::vector

Execve() adds two extra arguments

Which PyPI index does Pip point to?

How do I create a functor instance for a type with two arguments, where both arguments have to be the same type?

Autodiscovery url for same domain users

Multiple domain point to same website

Django URL with arguments pointing to the same page using "with as template"?

Host two web application on the same domain using Apache

How to print both index of two list in python using nested loop

How to specify authentication for Pip Project setup pip with extra-index-url in pip.ini (Windows) or pip.conf (Mac/Linux) on azure pipelines/artifacts

How can I serve both my website and my API on the same Domain using fastapi?

Two index in same controller

How to specify pip --extra-index-url in environment.yml?

pip install with extra index url to requirements.txt

How to use multiple urls with PIP_EXTRA_INDEX_URL