3 Re( @sNddlmZddlZddlZddlZddlmZddlmZddl 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+ej,e-Z.ddddddddff ddZ/ddZ0Gddde1Z2dS))absolute_importN)six)canonicalize_name)RequirementParseError) BadCommandInstallationError)install_req_from_editableinstall_req_from_line) COMMENT_RE)%direct_url_as_pep440_direct_referencedist_get_direct_url)dist_is_editableget_installed_distributions)MYPY_CHECK_RUNNING) IteratorOptionalList ContainerSetDictTupleIterableUnion) WheelCache) Distribution RequirementFc cs|pg}x|D]} dj| VqWi} xpt|f||dD]\} ytj| } Wn2tk r|} ztjd| | w8WYdd} ~ XnX|r| jrq8| | | j<q8W|rt }t j t }x|D]}t |x}xn|D]d}|j s|jjds|jd r |j}||kr|j||Vq|jds8|jdr~|jdrV|ddj}n|tddjjd}t||d}nttjd|j|d}|jstjd||jtjdqt|j}|| kr||jstjd|tjd|j|jn||jj|qt| |jV| |=||jj|qWWdQRXqWxBtj|D]4\}}t|dkrTtjd|djt t |qTWdVx8t | j!dddD] }|j|krt|jVqWdS)!Nz-f {}) local_onlyskip user_onlypathsz6Could not generate requirement for distribution %r: %s#-r --requirement-f --find-links-i --index-url--pre--trusted-host--process-dependency-links--extra-index-url --use-featurez-ez --editable=)isolatedzWSkipping 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 installedz+Requirement %s included multiple times [%s]z, z7## The following requirements were added by pip freeze:cSs |jjS)N)namelower)xr4/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el9.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/operations/freeze.pyszfreeze..)key) r!r"r#r$r%r&r'r(r)r*r+)"formatrFrozenRequirement from_distrloggerwarningeditablecanonical_nameset collections defaultdictlistopenstrip startswithrstripaddlenlstriprr r subr1inforappendstrr iteritemsjoinsortedvalues) requirement find_linksrrrr. wheel_cacheZexclude_editablerlinkZ installationsdistreqexcZemitted_optionsZ req_filesZ req_file_pathreq_filelineZline_reqZline_req_canonical_namer1filesZ installationr4r4r5freeze*s              " r\cCsFt|sddgfStjjtjj|j}ddlm}m}|j |}|dkrv|j }t j d||dj |g}|d|fSy|j||j}Wn|k r|j }dj t|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)vcsRemoteNotFoundErrorz1No 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 ospathnormcaseabspathlocationpip._internal.vcsr]r^get_backend_for_diras_requirementr;debugr8get_src_requirement project_nametype__name__rr<r1r)rVrcr]r^ vcs_backendrWcommentsrXr4r4r5get_requirement_infosF        rnc@s,eZdZffddZeddZddZdS)r9cCs&||_t||_||_||_||_dS)N)r1rr>rWr=rm)selfr1rWr=rmr4r4r5__init__s  zFrozenRequirement.__init__cCsZt|\}}}|dkr8| r8t|}|r8t||j}g}|dkrH|j}||j|||dS)N)rm)rnr r rirf)clsrVrWr=rm direct_urlr4r4r5r:s zFrozenRequirement.from_distcCs4|j}|jrdj|}djt|jt|gdS)Nz-e {} )rWr=r8rOrBrmrM)rorWr4r4r5__str__ s zFrozenRequirement.__str__N)rk __module__ __qualname__rp classmethodr:rtr4r4r4r5r9s  r9)3 __future__rr@loggingr_ pip._vendorrZpip._vendor.packaging.utilsrZpip._vendor.pkg_resourcesrpip._internal.exceptionsrrpip._internal.req.constructorsrr Zpip._internal.req.req_filer &pip._internal.utils.direct_url_helpersr r pip._internal.utils.miscr rpip._internal.utils.typingrtypingrrrrrrrrrpip._internal.cacherrrrMboolZRequirementInfo getLoggerrkr;r\rnobjectr9r4r4r4r5s:      ,   |>