1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Prettify messages for discarding candidates due to issues

These are more pleasing colours and, more importantly, a clearer
presentation style of the package vs the error.
This commit is contained in:
Pradyun Gedam 2022-01-11 19:21:49 +00:00
parent 1a0193f9e4
commit a835e0a277
No known key found for this signature in database
GPG key ID: FF99710C4332258E
2 changed files with 13 additions and 3 deletions

View file

@ -191,7 +191,12 @@ class Factory:
version=version,
)
except (InstallationSubprocessError, MetadataInconsistent) as e:
logger.warning("Discarding %s. %s", link, e)
logger.info(
"Discarding [blue underline]%s[/]: [yellow]%s[reset]",
link,
e,
extra={"markup": True},
)
self._build_failures[link] = e
return None
base: BaseCandidate = self._editable_candidate_cache[link]
@ -206,7 +211,12 @@ class Factory:
version=version,
)
except (InstallationSubprocessError, MetadataInconsistent) as e:
logger.warning("Discarding %s. %s", link, e)
logger.info(
"Discarding [blue underline]%s[/]: [yellow]%s[reset]",
link,
e,
extra={"markup": True},
)
self._build_failures[link] = e
return None
base = self._link_candidate_cache[link]

View file

@ -1362,7 +1362,7 @@ def test_new_resolver_skip_inconsistent_metadata(script: PipTestEnvironment) ->
assert (
" inconsistent version: filename has '3', but metadata has '2'"
) in result.stderr, str(result)
) in result.stdout, str(result)
script.assert_installed(a="1")