From the department of "missing something obvious"...
# general
e
From the department of "missing something obvious" ... I'm using pants 2.5 and trying to do requirements from a requirements.txt file with at `--extra-index-url`; I'd thought that was all that was necessary with the switch to pex 2.0, and I can successfully
pip install -r
that requirements.txt, but pants can't find the library that requires the extra url when I try tests. Am I missing something terribly obvious?
Actually, I can verify that the "--extra-index-url" doesn't seem to be getting passed to pex. I really thought that was supposed to work; hm.
Adding to
[python-repos]
in
pants.toml
does work, but that's mildly inconvenient. Also that index should only be used for one package; curious if there's a better mechanism.
h
Yeah, unfortunately at the moment I think we just ignore lines like that in requirements.txt
cc @enough-analyst-54434 and @hundreds-father-404 as to whether this could be made to work under the lockfile/resolve design
e
Pex fully supports this, its really just a Pants feature totally orthogonal to the lockfile stuff. https://github.com/pantsbuild/pants/issues/12090
Eric does mention the lockfile project there but it really is totally unrelated work afaict.
1
But @happy-kitchen-89482 your question may have been more angled at - "Will the lockfile project break any hope for this?". No, it won't it will provide no barrier to passing those options through to Pex and those options, when passed through, will not adversely affect lock generation or consumption.
h
Thanks! Meanwhile it sounds like the slightly janky workaround is the
python-repos
option
h
Yeah I thought they were related, but indeed they're not. We can't implement until we've moved from Poetry to Pex for lockfile generation though
e
@echoing-farmer-15630 note that index options are global for pip, even if they're just specified in a requirements file alongside a single req and other reqs are positional on the CLI or in their own separate requirements file: https://pip.pypa.io/en/stable/cli/pip_install/#requirements-file-format