B š•Re…(ã @s<ddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ddlmZmZddlmZdd lmZmZdd lmZmZdd lmZer dd lmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$dd l%m&Z&ddl m'Z'm(Z(e"ee$e)e(fe*ee)fZ+e ,e-¡Z.ddd„Z/dd„Z0Gdd„de1ƒZ2dS)é)Úabsolute_importN)Úsix)Úcanonicalize_name)ÚRequirementParseError)Ú BadCommandÚInstallationError)Úinstall_req_from_editableÚinstall_req_from_line)Ú COMMENT_RE)Ú%direct_url_as_pep440_direct_referenceÚdist_get_direct_url)Údist_is_editableÚget_installed_distributions)ÚMYPY_CHECK_RUNNING) ÚIteratorÚOptionalÚListÚ ContainerÚSetÚDictÚTupleÚIterableÚUnion)Ú WheelCache)Ú DistributionÚ RequirementF©c  csÊ|pg}x|D]} d | ¡VqWi} xpt|d||dD]\} yt | ¡} Wn2tk r|} zt d| | ¡w8Wdd} ~ XYnX|rŠ| jrŠq8| | | j<q8W|rŒt ƒ}t   t ¡}x|D]†}t |ƒr}xh|D]^}| ¡rø| ¡ d¡sø| d¡r| ¡}||krÐ| |¡|VqÐ| d¡s2| d¡rx| d¡rP|d d… ¡}n|tdƒd… ¡ d ¡}t||d }ntt d |¡ ¡|d }|js¶t d || ¡¡t d¡qÐt|jƒ}|| kr||jsöt d|t d |¡ ¡|j¡n||j |¡qÐt| |ƒ ¡V| |=||j |¡qÐWWdQRXq¶WxBt |¡D]4\}}t|ƒdkrNt d|d t t |ƒƒ¡¡qNWdVx8t |  !¡dd„dD] }|j|kr¢t|ƒ ¡Vq¢WdS)Nz-f {}r)Ú local_onlyÚskipÚ user_onlyÚpathsz6Could not generate requirement for distribution %r: %sú#) z-rz --requirementz-fz --find-linksz-iz --index-urlz--prez--trusted-hostz--process-dependency-linksz--extra-index-urlz --use-featurez-ez --editableéú=)ÚisolatedÚzWSkipping line in requirement file [%s] because it's not clear what it would install: %sz9 (add #egg=PackageName to the URL to avoid this warning)zBRequirement file [%s] contains %s, but package %r is not installedéz+Requirement %s included multiple times [%s]z, z7## The following requirements were added by pip freeze:cSs |j ¡S)N)ÚnameÚlower)ÚxrrúŽ/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/operations/freeze.pyÚªózfreeze..)Úkey)"ÚformatrÚFrozenRequirementÚ from_distrÚloggerÚwarningÚeditableÚcanonical_nameÚsetÚ collectionsÚ defaultdictÚlistÚopenÚstripÚ startswithÚrstripÚaddÚlenÚlstriprr r Úsubr'ÚinforÚappendÚstrrÚ iteritemsÚjoinÚsortedÚvalues)Ú requirementÚ find_linksrrr r$Ú wheel_cacheZexclude_editablerÚlinkZ installationsÚdistÚreqÚexcZemitted_optionsZ req_filesZ req_file_pathÚreq_fileÚlineZline_reqZline_req_canonical_namer'ÚfilesZ installationrrr*Úfreeze*s’             " rRc CsFt|ƒsddgfStj tj |j¡¡}ddlm}m}|  |¡}|dkrv|  ¡}t   d||¡d  |¡g}|d|fSy| ||j¡}WnŒ|k r¾|  ¡}d  t|ƒj|¡g}|d|fStk ræt  d ||j¡ddgfStk r}zt  d |¡Wdd}~XYnX|dk r*|dgfSt  d |¡d g}dd|fS) zk Compute and return values (req, editable, comments) for use in FrozenRequirement.from_dist(). NFr)ÚvcsÚRemoteNotFoundErrorz1No VCS found for editable requirement "%s" in: %rz/# 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 ÚosÚpathÚnormcaseÚabspathÚlocationÚpip._internal.vcsrSrTÚget_backend_for_dirÚas_requirementr1Údebugr.Úget_src_requirementÚ project_nameÚtypeÚ__name__rr2r'r)rLrYrSrTÚ vcs_backendrMÚcommentsrNrrr*Úget_requirement_info¯sF        rdc@s*eZdZd dd„Zedd„ƒZdd„ZdS) r/rcCs&||_t|ƒ|_||_||_||_dS)N)r'rr4rMr3rc)Úselfr'rMr3rcrrr*Ú__init__îs  zFrozenRequirement.__init__cCsXt|ƒ\}}}|dkr6|s6t|ƒ}|r6t||jƒ}g}|dkrF| ¡}||j|||dS)N)rc)rdr r r_r\)ÚclsrLrMr3rcÚ direct_urlrrr*r0ös  zFrozenRequirement.from_distcCs4|j}|jrd |¡}d t|jƒt|ƒg¡dS)Nz-e {}Ú )rMr3r.rEr8rcrC)rerMrrr*Ú__str__ s zFrozenRequirement.__str__N)r)raÚ __module__Ú __qualname__rfÚ classmethodr0rjrrrr*r/ís  r/) NNFFNFNFr)3Ú __future__rr6ÚloggingrUÚ pip._vendorrZpip._vendor.packaging.utilsrZpip._vendor.pkg_resourcesrÚpip._internal.exceptionsrrÚpip._internal.req.constructorsrr Zpip._internal.req.req_filer Ú&pip._internal.utils.direct_url_helpersr r Úpip._internal.utils.miscr rÚpip._internal.utils.typingrÚtypingrrrrrrrrrÚpip._internal.cacherrrrCÚboolZRequirementInfoÚ getLoggerrar1rRrdÚobjectr/rrrr*Ús:      ,   |>