def check_dependencies(req, indent=<NUM_LIT:1>, history=None):
<EOL>if history is None:<EOL><INDENT>history = set()<EOL><DEDENT>if req in history:<EOL><INDENT>return<EOL><DEDENT>history.add(req)<EOL>d = pkg_resources.get_distribution(req)<EOL>extras = parse_extras(req)<EOL>if indent == <NUM_LIT:1>:<EOL><INDENT>print_package(req, <NUM_LIT:0>)<EOL><DEDENT>for r in d.requires(extras=extras):<EOL><INDENT>print_package(r, indent)<EOL>check_dependencies(r, indent + <NUM_LIT:1>, history)<EOL><DEDENT>
Given a setuptools package requirement (e.g. 'gryphon==2.42' or just
'gryphon'), print a tree of dependencies as they resolve in this
environment.