def should_use_ephemeral_cache(<EOL>req,  <EOL>format_control,  <EOL>autobuilding,  <EOL>cache_available  <EOL>):<EOL>
if req.constraint:<EOL><INDENT>return None<EOL><DEDENT>if req.is_wheel:<EOL><INDENT>if not autobuilding:<EOL><INDENT>logger.info(<EOL>'<STR_LIT>', req.name,<EOL>)<EOL><DEDENT>return None<EOL><DEDENT>if not autobuilding:<EOL><INDENT>return False<EOL><DEDENT>if req.editable or not req.source_dir:<EOL><INDENT>return None<EOL><DEDENT>if req.link and not req.link.is_artifact:<EOL><INDENT>return True<EOL><DEDENT>if "<STR_LIT>" not in format_control.get_allowed_formats(<EOL>canonicalize_name(req.name)):<EOL><INDENT>logger.info(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>", req.name,<EOL>)<EOL>return None<EOL><DEDENT>link = req.link<EOL>base, ext = link.splitext()<EOL>if cache_available and _contains_egg_info(base):<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Return whether to build an InstallRequirement object using the
ephemeral cache.

:param cache_available: whether a cache directory is available for the
    autobuilding=True case.

:return: True or False to build the requirement with ephem_cache=True
    or False, respectively; or None not to build the requirement.