def _parse_pipfile_dependency_info(pipfile_entry):
    """Parse a Pipfile entry for a package and return a compatible version with Pipfile.lock entry."""
    if isinstance(pipfile_entry, str):
        return {'version': pipfile_entry}
    elif isinstance(pipfile_entry, dict):
        result = {'version': pipfile_entry['version']}
        if pipfile_entry.get('extras'):
            result['extras'] = pipfile_entry['extras']
        if pipfile_entry.get('markers'):
            result['markers'] = pipfile_entry['markers']
        return result
    raise ValueError(
        'Unknown entry in Pipfile (should be of type dict or a str): {}'.
        format(pipfile_entry))
