(package_lines: List[str])
return filtered_requirements
Parse a requirement line

    ignores commented line
    and inline comments
Parse a requirement line
Parse a requirement line
def _parse_package_lines(package_lines: List[str]) -> Set[Requirement]:
    """Parse a requirement line

    ignores commented line
    and inline comments
    """
    filtered_requirements: Set[Requirement] = set()
    for package_line in package_lines:
        package_line = package_line.strip()
        if not package_line or package_line.startswith("#"):
            continue
        package_line, *_ = package_line.split("#", maxsplit=1)
        requirement = Requirement(package_line.strip())
        requirement.name = canonicalize_name(requirement.name)
        requirement.specifier.prereleases = True
        filtered_requirements.add(requirement)
    return filtered_requirements
def _parse_package_lines ( package_lines : List [ str ] ) -> Set [ Requirement ] : filtered_requirements : Set [ Requirement ] = set ( ) for package_line in package_lines : package_line = package_line . strip ( ) if not package_line or package_line . startswith ( "#" ) : continue package_line , * _ = package_line . split ( "#" , maxsplit = 1 ) requirement = Requirement ( package_line . strip ( ) ) requirement . name = canonicalize_name ( requirement . name ) requirement . specifier . prereleases = True filtered_requirements . add ( requirement ) return filtered_requirements