You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Enso-Bot/venv/Lib/site-packages/virtualenv/run/plugin/discovery.py

32 lines
994 B
Python

from __future__ import absolute_import, unicode_literals
from .base import PluginLoader
class Discovery(PluginLoader):
""""""
def get_discover(parser, args):
discover_types = Discovery.entry_points_for("virtualenv.discovery")
discovery_parser = parser.add_argument_group(
title="discovery", description="discover and provide a target interpreter",
)
discovery_parser.add_argument(
"--discovery",
choices=_get_default_discovery(discover_types),
default=next(i for i in discover_types.keys()),
required=False,
help="interpreter discovery method",
)
options, _ = parser.parse_known_args(args)
discover_class = discover_types[options.discovery]
discover_class.add_parser_arguments(discovery_parser)
options, _ = parser.parse_known_args(args, namespace=options)
discover = discover_class(options)
return discover
def _get_default_discovery(discover_types):
return list(discover_types.keys())