def _get_package_entry_str(package_name, info, *, no_hashes=False,
    no_versions=False):
    """Print entry for the given package."""
    if 'git' in info:
        if info.get('editable', False):
            result = '--editable git+{}'.format(info['git'])
        else:
            result = 'git+{}'.format(info['git'])
        if 'ref' in info:
            result += '@{}'.format(info['ref'])
        result += '#egg={}\n'.format(package_name)
        return result
    if info.get('editable', False):
        result = '--editable {}'.format(info.get('path', '.'))
    else:
        result = package_name
    if info.get('extras'):
        result += '[{}]'.format(','.join(info['extras']))
    if not no_versions and info.get('version') and info['version'] != '*':
        result += info['version']
    if info.get('markers'):
        result += '; {}'.format(info['markers'])
    if not (no_hashes or no_versions or info.get('editable', False)):
        for digest in info.get('hashes', []):
            result += ' \\\n'
            result += '    --hash={}'.format(digest)
    return result + '\n'
