<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_dependencies_from_pip(ireq, sources):
 """Retrieves dependencies for the requirement from pipenv.patched.notpip internals. The current strategy is to try the followings in order, returning the first successful result. 1. Try to build a wheel out of the ireq, and read metadata out of it. 2. Read metadata out of the egg-info directory if it is present. """

    extras = ireq.extras or ()
    try:
        wheel = build_wheel(ireq, sources)
    except WheelBuildError:
        # XXX: This depends on a side effect of `build_wheel`. This block is
        # reached when it fails to build an sdist, where the sdist would have
        # been downloaded, extracted into `ireq.source_dir`, and partially
        # built (hopefully containing .egg-info).
        metadata = read_sdist_metadata(ireq)
        if not metadata:
            raise
    else:
        metadata = wheel.metadata
    requirements = _read_requirements(metadata, extras)
    requires_python = _read_requires_python(metadata)
    return requirements, requires_python