I am trying to set up a build pipeline with two python package repositories. I'd like pip to first search in the public PyPi repos, and only if it cannot find a package or a version there, it should look it up in another private repo (AWS CodeArtifact).
My pip config is
global.index-url='https://pypi.org/simple'
global.extra-index-url='***.codeartifact.eu-central-1.amazonaws.com/pypi/public/simple/'
Note that this codeartifact repo has PyPi as upstream, i.e. I can fetch all dependencies through this repo alone.
The output looks like this
Looking in indexes: https://pypi.org/simple, ***.codeartifact.eu-central-1.amazonaws.com/pypi/public/simple/
[...]
Collecting blinker==1.4
Downloading https://***.codeartifact.eu-central-1.amazonaws.com/pypi/public/simple/blinker/1.4/blinker-1.4.tar.gz (111 kB)
Collecting boto3==1.16.40
Downloading https://***.codeartifact.eu-central-1.amazonaws.com/pypi/public/simple/boto3/1.16.40/boto3-1.16.40-py2.py3-none-any.whl (130 kB)
Collecting callee==0.3.1
Downloading https://***.codeartifact.eu-central-1.amazonaws.com/pypi/public/simple/callee/0.3.1/callee-0.3.1.tar.gz (19 kB)
[...]
You can see that even though codeartifact is only the extra-index, each dependency is downloaded from it.
When I remove the upstream, i.e. only a few private packages reside in the codeartifact repo, then PyPi is checked first.
[...]
Collecting blinker==1.4
Downloading blinker-1.4.tar.gz (111 kB)
Collecting boto3==1.16.40
Downloading boto3-1.16.40-py2.py3-none-any.whl (130 kB)
Collecting callee==0.3.1
Downloading callee-0.3.1.tar.gz (19 kB)
[...]
Can you help me understanding this behaviour?