mirror of https://github.com/pypa/pip
Linearize a nested-error-message-generation (#7040)
Merge pull request #7040 from pradyunsg/cleanup/nicer-error-message-creation
This commit is contained in:
commit
13ab7a2bce
|
@ -37,11 +37,19 @@ class SourceDistribution(AbstractDistribution):
|
|||
|
||||
def _setup_isolation(self, finder):
|
||||
def _raise_conflicts(conflicting_with, conflicting_reqs):
|
||||
raise InstallationError(
|
||||
"Some build dependencies for %s conflict with %s: %s." % (
|
||||
self.req, conflicting_with, ', '.join(
|
||||
'%s is incompatible with %s' % (installed, wanted)
|
||||
for installed, wanted in sorted(conflicting))))
|
||||
format_string = (
|
||||
"Some build dependencies for {requirement} "
|
||||
"conflict with {conflicting_with}: {description}."
|
||||
)
|
||||
error_message = format_string.format(
|
||||
requirement=self.req,
|
||||
conflicting_with=conflicting_with,
|
||||
description=', '.join(
|
||||
'%s is incompatible with %s' % (installed, wanted)
|
||||
for installed, wanted in sorted(conflicting)
|
||||
)
|
||||
)
|
||||
raise InstallationError(error_message)
|
||||
|
||||
# Isolate in a BuildEnvironment and install the build-time
|
||||
# requirements.
|
||||
|
|
Loading…
Reference in New Issue