It seems `pex` does not honor `indexes.add` after ...
# general
c
It seems
pex
does not honor
indexes.add
after the first entry 😞
I'm not sure if this is an issue with pex, pants, or pip, but my gut tells me pex
h
The
.add
in config files is a pants construct, so it might be a pants issue? Can you give a more elaborate example?
c
It's getting passed to the
pex
call :
Copy code
❯ ./pants generate-lockfiles --resolve=<resolve>
16:29:58.44 [ERROR] 1 Exception encountered:

  ProcessExecutionFailure: Process 'Generate lockfile for <resolve>' failed with exit code 1.
stdout:

stderr:
pid 861252 -> /home/noah/.cache/pants/named_caches/pex_root/venvs/1d025be2b3d2024670ccbfbce824218209fcd325/ddab8011daaee380698a
c2fb9701af18c90c03f6/bin/python -sE /home/noah/.cache/pants/named_caches/pex_root/venvs/1d025be2b3d2024670ccbfbce824218209fcd32
5/ddab8011daaee380698ac2fb9701af18c90c03f6/pex --disable-pip-version-check --no-python-version-warning --exists-action a --no-i
nput --isolated -q --cache-dir /home/noah/.cache/pants/named_caches/pex_root/pip_cache --log /tmp/pants-sandbox-Xwf0j3/.tmp/pex
-pip-log.il4jjj_8/pip.log download --dest /tmp/pants-sandbox-Xwf0j3/.tmp/tmp0az740uu/usr.bin.python3.8 --requirement __pip_args
.txt <bunch of requirements> --index-url <https://pypi.org/simple/> --extra-index-url https://<url 1> --extra-index-url <url 2>
--extra-index-url <url 3> --retries 5 --timeout 15 exited with 1 and STDERR:
ERROR: Could not find a version that satisfies the requirement <package found in extra index 2>
ERROR: No matching distribution found for <package found in extra index 2>
flipping the order of the extra index URLs in
pants.toml
results in a similar error, except for the package that's now in the second extra index
h
ooooooooh
thanks for the extra detail
c
I'm pretty sure it's in pex, I assume pip doesn't have this issue, and it's clearly making it into the pex call
(I haven't tested in pip, but I'd be pretty surprised if it wasn't picked up, this is a fairly common case)
h
To clarify, that cmd line is a pip cmd line. What you’re seeing there is the vendored pip being invoked via the
pex
pex.
👍 1
So it might be instructive to test this in pip itself
c
got it
I'll try that out
I've confirmed it is, in fact, a
pip
issue. They assume HTTPBasic credentials are valid for an entire domain and only use the last pair if multiple
--extra-index-url
under the same domain (but with different auth) are specified. We're using various GitLab repos which all fall under the
<http://gitlab.com|gitlab.com>
domain, but have different auth because they are part of different projects
🤯 1
ok, it's more complicated, it's a combination of Python packaging being a complete mess and GitLab's Python Registry implementation being mostly bad