def install_req_from_line(<EOL>name,  <EOL>comes_from=None,  <EOL>use_pep517=None,  <EOL>isolated=False,  <EOL>options=None,  <EOL>wheel_cache=None,  <EOL>constraint=False  <EOL>):<EOL>
if is_url(name):<EOL><INDENT>marker_sep = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>marker_sep = '<STR_LIT:;>'<EOL><DEDENT>if marker_sep in name:<EOL><INDENT>name, markers_as_string = name.split(marker_sep, <NUM_LIT:1>)<EOL>markers_as_string = markers_as_string.strip()<EOL>if not markers_as_string:<EOL><INDENT>markers = None<EOL><DEDENT>else:<EOL><INDENT>markers = Marker(markers_as_string)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>markers = None<EOL><DEDENT>name = name.strip()<EOL>req_as_string = None<EOL>path = os.path.normpath(os.path.abspath(name))<EOL>link = None<EOL>extras_as_string = None<EOL>if is_url(name):<EOL><INDENT>link = Link(name)<EOL><DEDENT>else:<EOL><INDENT>p, extras_as_string = _strip_extras(path)<EOL>looks_like_dir = os.path.isdir(p) and (<EOL>os.path.sep in name or<EOL>(os.path.altsep is not None and os.path.altsep in name) or<EOL>name.startswith('<STR_LIT:.>')<EOL>)<EOL>if looks_like_dir:<EOL><INDENT>if not is_installable_dir(p):<EOL><INDENT>raise InstallationError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % name<EOL>)<EOL><DEDENT>link = Link(path_to_url(p))<EOL><DEDENT>elif is_archive_file(p):<EOL><INDENT>if not os.path.isfile(p):<EOL><INDENT>logger.warning(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>name<EOL>)<EOL><DEDENT>link = Link(path_to_url(p))<EOL><DEDENT><DEDENT>if link:<EOL><INDENT>if link.scheme == '<STR_LIT:file>' and re.search(r'<STR_LIT>', link.url):<EOL><INDENT>link = Link(<EOL>path_to_url(os.path.normpath(os.path.abspath(link.path))))<EOL><DEDENT>if link.is_wheel:<EOL><INDENT>wheel = Wheel(link.filename)  <EOL>req_as_string = "<STR_LIT>" % (wheel.name, wheel.version)<EOL><DEDENT>else:<EOL><INDENT>req_as_string = link.egg_fragment<EOL><DEDENT><DEDENT>else:<EOL><INDENT>req_as_string = name<EOL><DEDENT>if extras_as_string:<EOL><INDENT>extras = Requirement("<STR_LIT>" + extras_as_string.lower()).extras<EOL><DEDENT>else:<EOL><INDENT>extras = ()<EOL><DEDENT>if req_as_string is not None:<EOL><INDENT>try:<EOL><INDENT>req = Requirement(req_as_string)<EOL><DEDENT>except InvalidRequirement:<EOL><INDENT>if os.path.sep in req_as_string:<EOL><INDENT>add_msg = "<STR_LIT>"<EOL>add_msg += deduce_helpful_msg(req_as_string)<EOL><DEDENT>elif ('<STR_LIT:=>' in req_as_string and<EOL>not any(op in req_as_string for op in operators)):<EOL><INDENT>add_msg = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>add_msg = "<STR_LIT>"<EOL><DEDENT>raise InstallationError(<EOL>"<STR_LIT>" % (req_as_string, add_msg)<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>req = None<EOL><DEDENT>return InstallRequirement(<EOL>req, comes_from, link=link, markers=markers,<EOL>use_pep517=use_pep517, isolated=isolated,<EOL>options=options if options else {},<EOL>wheel_cache=wheel_cache,<EOL>constraint=constraint,<EOL>extras=extras,<EOL>)<EOL>
Creates an InstallRequirement from a name, which might be a
    requirement, directory containing 'setup.py', filename, or URL.