3 (\?$ @sFddlmZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZmZddlmZdd lmZmZdd lmZerdd lmZmZmZmZmZmZm Z m!Z!m"Z"dd l#m$Z$dd l m%Z%m&Z&e ee"e'e&fe(ee'fZ)ej*e+Z,ddddddddff ddZ-ddZ.Gddde/Z0dS))absolute_importN)six)canonicalize_name)RequirementParseError) BadCommandInstallationError)install_req_from_editableinstall_req_from_line) COMMENT_RE)dist_is_editableget_installed_distributions)MYPY_CHECK_RUNNING) IteratorOptionalList ContainerSetDictTupleIterableUnion) WheelCache) Distribution RequirementFc cs|pg}d} |rtj|j} x|D]} d| Vq"Wi} x`t|f|dD]N} ytj| } Wn$tk r~tjd| j wHYnX|r| j rqH| | | j <qHW|rt }t jt}x|D]}t|}x||D]r}|j s|jjds| o| |s|jd!r0|j}||kr|j||Vq|jdsH|jdr|jdrf|ddj}n|tddjjd}t|||d}nttjd|j||d}|j stjd||jtjdq|j | kr||j stjd|tjd|j|j n||j j|qt| |j jV| |j =||j j|qWWdQRXqWxBtj|D]4\}}t|dkrdtjd|dj t!t |qdWdVxszfreeze..)key) rrr r!r"r#r$r%r&r'r(r))$recompilesearchr FrozenRequirement from_distrloggerwarning project_nameeditabler0set collections defaultdictlistopenstrip startswithrstripaddlenlstriprr r subinfoappendstrr iteritemsjoinsortedvaluesr) requirement find_linksrr skip_regexr,r-Zexclude_editabler skip_matchlink installationsdistreqemitted_optionsZ req_files req_file_pathreq_filelineline_reqr0files installationr3r3r4freeze%s              "rbcCs>t|sddgfStjjtjj|j}ddlm}m}|j |}|sr|j }t j d||dj |g}|d|fSy|j||j}Wn|k r|j }dj |j|g}|d|fStk rt jd ||jddgfStk r }zt jd |WYdd}~XnX|dk r"|dgfSt jd |d g}dd|fS) zk Compute and return values (req, editable, comments) for use in FrozenRequirement.from_dist(). NFr)vcsRemoteNotFoundErrorz3No VCS found for editable requirement {!r} in: {!r}z/# Editable install with no version control ({})Tz)# Editable {} install with no remote ({})zPcannot determine version of editable source in %s (%s command not found in path)zYError when trying to get requirement for VCS system %s, falling back to uneditable formatz-Could not determine repository location of %sz-## !! Could not determine repository location)r ospathnormcaseabspathlocationZpip._internal.vcsrcrdZget_backend_typeas_requirementr<debugformatget_src_requirementr>__name__rr=r0r)rYrircrdvc_typerZcommentsexcr3r3r4get_requirement_infosF         rrc@s,eZdZffddZeddZddZdS)r:cCs||_||_||_||_dS)N)r0rZr?rp)selfr0rZr?rpr3r3r4__init__szFrozenRequirement.__init__cCs0t|\}}}|dkr|j}||j|||dS)N)rp)rrrjr>)clsrYrZr?rpr3r3r4r;szFrozenRequirement.from_distcCs2|j}|jrd|}djt|jt|gdS)Nz-e %s )rZr?rPrCrprN)rsrZr3r3r4__str__szFrozenRequirement.__str__N)rn __module__ __qualname__rt classmethodr;rwr3r3r3r4r:s  r:)1 __future__rrAloggingrer7 pip._vendorrpip._vendor.packaging.utilsrZpip._vendor.pkg_resourcesrZpip._internal.exceptionsrrZpip._internal.req.constructorsrr Zpip._internal.req.req_filer Zpip._internal.utils.miscr r Zpip._internal.utils.typingr ZtypingrrrrrrrrrZpip._internal.cacherrrrNboolZRequirementInfo getLoggerrnr<rbrrobjectr:r3r3r3r4s:      ,   v>