pex icon indicating copy to clipboard operation
pex copied to clipboard

pex 2.1.10 warns when multiple index URLs are configured

Open stuhood opened this issue 4 years ago • 3 comments

The combination of the default Max-Age cache header: https://github.com/pantsbuild/pex/blob/451977efdf987dd299a1b4798ac2ee298cd6d61b/pex/pip.py#L146-L149

and the pip header patch's refusal to set a header if multiple URLs are in use (?): https://github.com/pantsbuild/pex/blob/451977efdf987dd299a1b4798ac2ee298cd6d61b/pex/vendor/_vendored/pip/pip/_internal/cli/req_command.py#L83-L90

... every run with multiple index URLs configured triggers a warning about the header.

stuhood avatar May 13 '20 15:05 stuhood

Seeing this too. @jsirois fyi Screen Shot 2020-09-10 at 9 45 41 AM

asherf avatar Sep 10 '20 16:09 asherf

That's an issue triggered when using multiple index URLs.

It seems that pex is using a patched version of pip, which cherry pick the commit from https://github.com/pypa/pip/pull/8078. It's a PR not yet merged into pip master and it prevents us from setting headers for multiple URLs (also send out this warning).

I'm a bit confused by setting Cache-Control:max-age=3600, what would be the benefit from it?

If we do need this, how could we get rid of this warning and set the headers for multiple URLs? I think multiple URLs might be a common use case.

silverguo avatar Sep 29 '20 12:09 silverguo

It also appears to warn if only one index URL is set.

AndrewHoos avatar Nov 10 '20 02:11 AndrewHoos

This was obsoleted by #1133 which upgraded Pex's vendored Pip and lost support for setting custom headers at all.

jsirois avatar Aug 14 '24 18:08 jsirois