import pkg_resources


def _parse_version_requirement(pkg_name):
    """Parse a version requirement from requirements.txt.

    Returns the first parsed version that meets the >= requirement.

    Parameters:
        pkg_name (string): The string package name to search for.

    Returns:
        The string version or None if no >= version requirement can be parsed.

    """
    for line in open('requirements.txt'):
        if line.startswith(pkg_name):
            # Assume that we only have one version spec to deal with.
            version_specs = pkg_resources.Requirement.parse(line).specs
            for requirement_type, version in version_specs:
                if requirement_type == '>=':
                    return version