I have a local GitLab installation that comes with a local PyPI server to store company internal Python packages.
How can I configure my PyPI to search packages in both index servers?
I read about .pypirc / pip/pip.ini and found various settings but no solution so far.
- Most solutions permanently switch all searches to the other index server. But I want to be able to install and update packages from pypi.org as normal while some packages come from the local index.
- setting multiple index servers with credentials seams to be limited to distutils (used e.g. by twine) only, but is not used by pip
- There is confusion if to configure index servers in
[global]or[install]. I assume the latter one is a rule subset forpip install. (The documentation is here unclear.) - While twine can reference a repository entry in the config file like
-r gitlabrefers to a[gitlab]section, such a named reference can't be used by pip...
So what I want to achieve:
pipshould be able to install and update regular packages from pypi.org like coloramapipshould be able to install and update packages from gitlab.company.com- authentication with username (
__token__) and password (7a3b62342c784d87) must work
- authentication with username (
Experiment so far:
[global]
[install]
find-links =
https://pypi.org
https://gitlab.company.de/api/v4/projects/2142423/packages/pypi
trusted-host =
https://pypi.org
https://gitlab.company.de/api/v4/projects/2142423/packages/pypi
[distutils]
index-servers =
gitlab
[gitlab]
repository = https://gitlab.company.de/api/v4/projects/2142423/packages/pypi
username = __token__
password = geheim
pip search? Or just want gets installed frompip install? If it's the latter, stackoverflow.com/questions/30889494/… should answer this for you. - Dustin Ingrampip searchcommand. - Paebbels--extra-index-url. But how does it handle the credentials? I see only a URL. I don't want to enter or copy/paste on everypip ***command a long token by hand. - Paebbels