# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

import json
import os
import unittest.mock
from textwrap import dedent
from typing import Tuple

from pex.interpreter import PythonInterpreter

from pants.backend.python.interpreter_cache import PythonInterpreterCache
from pants.backend.python.targets.python_library import PythonLibrary
from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary
from pants.backend.python.tasks.select_interpreter import SelectInterpreter
from pants.base.exceptions import TaskError
from pants.option.ranked_value import RankedValue
from pants.python.python_setup import PythonSetup
from pants.testutil.task_test_base import TaskTestBase
from pants.util.dirutil import chmod_plus_x, safe_mkdtemp


class SelectInterpreterTest(TaskTestBase):
    @classmethod
    def task_type(cls):