# Path: pyani/dependencies.py
# def get_requirements() -> Generator:
#     """Yield package name and version for Python requirements."""
#     return get_versions("REQUIREMENTS")
# 
# def get_dev_requirements() -> Generator:
#     """Yield package name and version for Python developer requirements."""
#     return get_versions("DEVELOPMENT")
# 
# def get_pip_requirements() -> Generator:
#     """Yield package name and version for Python pip installed requirements."""
#     return get_versions("PIP")
# 
# def get_tool_versions() -> Generator:
#     """Yield tool name and version for third-party installed tools."""
#     for name, func in [
#         ("blast+", get_blast_version),
#         ("nucmer", get_nucmer_version),
#         ("blastall", get_blastall_version),
#         ("fastani", get_fastani_version),
#     ]:
#         yield (name, func())


import logging
import platform
import sys
from argparse import Namespace
from pyani.dependencies import (
    get_requirements,
    get_dev_requirements,
    get_pip_requirements,
    get_tool_versions,
)

def subcmd_listdeps(args: Namespace) -> int:
    """Reports dependency versions to logger.

    :param args:  Namespace, received command-line arguments
    """
    # If the -v argument is provided, we don't want to have two
    # streams writing to STDOUT
    logger = logging.getLogger(__name__)

    # Adding this handler means we bypass the default logging
    # formatter, and write straight to the terminal as stdout
    if not args.verbose:
        handler = logging.StreamHandler(sys.stdout)
        handler.setLevel(logging.INFO)
        logger.addHandler(handler)

    # System information
    logger.info("System information")
    logger.info("\tPlatorm==%s", platform.platform())
    logger.info("\tPython==%s", sys.version)

    # Pyani dependencies
    logger.info("Installed pyani Python dependendencies...")
    for package, version, loc in get_requirements():
        logger.info("\t%s==%s (%s)", package, version, loc)
    logger.info("Installed pyani development dependendencies...")
    for package, version, loc in get_dev_requirements():
        logger.info("\t%s==%s (%s)", package, version, loc)
    logger.info("Installed pyani pip-install dependendencies...")

# Path: pyani/dependencies.py
# def get_requirements() -> Generator:
#     """Yield package name and version for Python requirements."""
#     return get_versions("REQUIREMENTS")
# 
# def get_dev_requirements() -> Generator:
#     """Yield package name and version for Python developer requirements."""
#     return get_versions("DEVELOPMENT")
# 
# def get_pip_requirements() -> Generator:
#     """Yield package name and version for Python pip installed requirements."""
#     return get_versions("PIP")
# 
# def get_tool_versions() -> Generator:
#     """Yield tool name and version for third-party installed tools."""
#     for name, func in [
#         ("blast+", get_blast_version),
#         ("nucmer", get_nucmer_version),
#         ("blastall", get_blastall_version),
#         ("fastani", get_fastani_version),
#     ]:
#         yield (name, func())


# Path: pyani/scripts/subcommands/subcmd_listdeps.py
import logging
import platform
import sys
from argparse import Namespace
from pyani.dependencies import (
    get_requirements,
    get_dev_requirements,
    get_pip_requirements,
    get_tool_versions,
)


def subcmd_listdeps(args: Namespace) -> int:
    """Reports dependency versions to logger.

    :param args:  Namespace, received command-line arguments
    """
    # If the -v argument is provided, we don't want to have two
    # streams writing to STDOUT
    logger = logging.getLogger(__name__)

    # Adding this handler means we bypass the default logging
    # formatter, and write straight to the terminal as stdout
    if not args.verbose:
        handler = logging.StreamHandler(sys.stdout)
        handler.setLevel(logging.INFO)
        logger.addHandler(handler)

    # System information
    logger.info("System information")
    logger.info("\tPlatorm==%s", platform.platform())
    logger.info("\tPython==%s", sys.version)

    # Pyani dependencies
    logger.info("Installed pyani Python dependendencies...")
    for package, version, loc in get_requirements():
        logger.info("\t%s==%s (%s)", package, version, loc)
    logger.info("Installed pyani development dependendencies...")
    for package, version, loc in get_dev_requirements():
        logger.info("\t%s==%s (%s)", package, version, loc)
    logger.info("Installed pyani pip-install dependendencies...")

    for package, version, loc in get_pip_requirements():