Given a setuptools package requirement (e.g. 'gryphon==2.42' or just
    'gryphon'), print a tree of dependencies as they resolve in this
    environment.

def check_dependencies(req, indent=1, history=None):
    """
    Given a setuptools package requirement (e.g. 'gryphon==2.42' or just
    'gryphon'), print a tree of dependencies as they resolve in this
    environment.
    """
    # keep a history to avoid infinite loops
    if history is None:
        history = set()
    if req in history:
        return
    history.add(req)
    d = pkg_resources.get_distribution(req)
    extras = parse_extras(req)
    if indent == 1:
        print_package(req, 0)
    for r in d.requires(extras=extras):
        print_package(r, indent)
        check_dependencies(r, indent + 1, history)