6from optparse
import Values
7from types
import ModuleType
8from typing
import Any, Dict, List, Optional
46 return dict(
line.split(
"==", 1)
for line
in lines)
53 if module_name ==
"setuptools":
54 module_name =
"pkg_resources"
62 version =
getattr(module,
"__version__",
None)
76 """Log the actual version and print extra info if there is
77 a conflict or if the actual version could not be imported.
82 if not actual_version:
84 " (Unable to locate actual module version, using"
85 " vendor.txt specified version)"
87 actual_version = expected_version
88 elif parse_version(actual_version) != parse_version(expected_version):
90 " (CONFLICT: vendor.txt suggests version should"
91 " be {})".format(expected_version)
93 logger.info(
"%s==%s%s", module_name, actual_version, extra_message)
107 target_python = make_target_python(options)
114 suffix = f
" (target: {formatted_target})"
116 msg =
"Compatible tags: {}{}".format(
len(tags), suffix)
121 tags = tags[:tag_limit]
131 "...\n[First {tag_limit} tags shown. Pass --verbose to show all.]"
132 ).format(tag_limit=tag_limit)
142 return "Not specified"
144 levels_that_override_global = [
"install",
"wheel",
"download"]
145 global_overriding_level = [
146 level
for level
in levels
if level
in levels_that_override_global
148 if not global_overriding_level:
151 if "global" in levels:
153 return ", ".join(levels)
158 Display debug information.
163 ignore_require_venv =
True
170 def run(self, options: Values, args: List[str]) -> int:
172 "This command is only meant for debugging. "
173 "Do not use this with automation for parsing and getting these "
174 "details, since the output and options of this command may "
175 "change without notice."
183 "locale.getpreferredencoding",
192 show_value(
"pip._vendor.certifi.where()", where())
int run(self, Values options, List[str] args)
None show_sys_implementation()
None show_vendor_versions()
Dict[str, str] create_vendor_txt_map()
str ca_bundle_info(Configuration config)
None show_value(str name, Any value)
None show_tags(Values options)
ModuleType get_module_from_module_name(str module_name)
None show_actual_vendor_versions(Dict[str, str] vendor_txt_versions)
Optional[str] get_vendor_version_from_module(str module_name)