Skip to content

Commit

Permalink
update warning to refer to --keyring-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
tdyas committed Jan 15, 2025
1 parent 8be4043 commit 668caa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pex/pip/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ def _spawn_pip_isolated(
else:
warn_msg = textwrap.dedent(
"""
The PIP_KEYRING_PROVIDER option is set, but Pip v{THIS_VERSION} does not support the `--keyring-provider` option
which is only available in Pip v{VERSION_23_1} and higher. Pex is ignoring PIP_KEYRING_PROVIDER for this
particular Pip invocation.
The --keyring-provider option is set to `{PROVIDER}`, but Pip v{THIS_VERSION} does not support the
`--keyring-provider` option (which is only available in Pip v{VERSION_23_1} and later versions).
Consequently, Pex is ignoring the --keyring-provider option for this particular Pip invocation.
Note: If this Pex invocation fails, it may be because Pex is trying to use its vendored Pip v{VENDORED_VERSION}
to bootstrap a newer Pip version which does support `--keyring-provider`, but you configured Pex/Pip
Expand All @@ -419,6 +419,7 @@ def _spawn_pip_isolated(
of Pip, so that Pex will still be able to install the newer version of Pip from the `find-links` directory
(which does not require authentication).
""".format(
PROVIDER=package_index_configuration.keyring_provider,
THIS_VERSION=self.version.version,
VERSION_23_1=PipVersion.v23_1,
VENDORED_VERSION=PipVersion.VENDORED.version,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ def test_keyring_provider(
job.wait()
assert len(events) == 1
assert PEXWarning == events[0].category
assert "does not support the `--keyring-provider` option" in str(events[0].message)
message = str(events[0].message).replace("\n", " ")
assert "does not support the `--keyring-provider` option" in message


@applicable_pip_versions
Expand Down

0 comments on commit 668caa6

Please sign in to comment.