def parse_requirements( filename, session, finder=None, options=None, constraint=False, isolated=False ): for parsed_req in _parse_requirements( filename, session, finder=finder, options=options, constraint=constraint ): yield install_req_from_parsed_requirement(parsed_req, isolated=isolated)
def parse_requirements( filename: str, session: PipSession, finder: Optional[PackageFinder] = None, options: Optional[optparse.Values] = None, constraint: bool = False, isolated: bool = False, ) -> Iterator[InstallRequirement]: for parsed_req in _parse_requirements( filename, session, finder=finder, options=options, constraint=constraint ): yield install_req_from_parsed_requirement(parsed_req, isolated=isolated)
def parse_requirements(filename): def split_requirements_string(string): match = requirement_matcher.match(string) requirement = dict() if match is not None: requirement["name"] = match[1] requirement["version_constraint"] = match[2] requirement["version"] = match[3] return requirement requirements = [ split_requirements_string(req.requirement) for req in _parse_requirements(filename, None) ] return requirements