import click import click_completion import pkg_resources from click_help_colors import _colorize import molecule from molecule import command from molecule.api import drivers from molecule.command.base import click_group_ex from molecule.config import MOLECULE_DEBUG, ansible_version from molecule.util import lookup_config_file click_completion.init() LOCAL_CONFIG_SEARCH = ".config/molecule/config.yml" LOCAL_CONFIG = lookup_config_file(LOCAL_CONFIG_SEARCH) ENV_FILE = ".env.yml" @lru_cache() def _version_string() -> str: v = pkg_resources.parse_version(molecule.__version__) color = "bright_yellow" if v.is_prerelease else "green" # type: ignore msg = "molecule %s\n" % _colorize(molecule.__version__, color) details = f" ansible:{ansible_version()} python:{sys.version_info[0]}.{sys.version_info[1]}" for driver in drivers(): details += f"\n {driver}:{driver.version} from {driver.module}" msg += _colorize(details, "bright_black")
import sys from ansible.release import __version__ as ansible_version import molecule from molecule import command from molecule.config import MOLECULE_DEBUG from molecule.logger import should_do_markup from molecule.util import lookup_config_file from molecule.command.base import click_group_ex from click_help_colors import _colorize click_completion.init() colorama.init(autoreset=True, strip=not should_do_markup()) LOCAL_CONFIG = lookup_config_file(".config/molecule/config.yml") ENV_FILE = ".env.yml" def _version_string(): v = pkg_resources.parse_version(molecule.__version__) color = "bright_yellow" if v.is_prerelease else "green" msg = "molecule %s\n" % _colorize(molecule.__version__, color) msg += _colorize( " ansible==%s python==%s.%s" % ( pkg_resources.parse_version(ansible_version), sys.version_info[0], sys.version_info[1], ),