Skip to content

Commit

Permalink
Improvement #1: point to website for instructions on compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Apr 25, 2019
1 parent 4395289 commit 8ee32cb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/python/pants/backend/python/interpreter_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import shutil
from builtins import str
from collections import defaultdict
from textwrap import dedent

from pex.interpreter import PythonInterpreter

Expand Down Expand Up @@ -91,10 +92,15 @@ def select_interpreter_for_targets(self, targets):
unique_compatibilities = {tuple(c) for c in tgts_by_compatibilities.keys()}
unique_compatibilities_strs = [','.join(x) for x in unique_compatibilities if x]
tgts_by_compatibilities_strs = [t[0].address.spec for t in tgts_by_compatibilities.values()]
raise self.UnsatisfiableInterpreterConstraintsError(
'Unable to detect a suitable interpreter for compatibilities: {} '
'(Conflicting targets: {})'.format(' && '.join(sorted(unique_compatibilities_strs)),
', '.join(tgts_by_compatibilities_strs)))
raise self.UnsatisfiableInterpreterConstraintsError(dedent("""\
Unable to detect a suitable interpreter for compatibilities: {} (Conflicting targets: {})
To fix this, either modify your Python interpreter constraints by following
https://www.pantsbuild.org/python_readme.html#configure-the-python-version or install the
targeted interpreter on your system.""".format(
' && '.join(sorted(unique_compatibilities_strs)),
', '.join(tgts_by_compatibilities_strs)
)))
# Return the lowest compatible interpreter.
return min(allowed_interpreters)

Expand Down

0 comments on commit 8ee32cb

Please sign in to comment.