o g*&@sBddlZddlZddlZddlmZmZmZmZmZm Z m Z m Z ddl m Z ddlmZddlmZmZddlmZmZddlmZmZddlmZdd lmZeeZGd d d e Z   dde ee!de"de"de ee!de"de"dee!dee!fddZ#dede!fddZ$dede fddZ%GdddZ&dS) N) ContainerDictIterableIteratorList NamedTupleOptionalSet)canonicalize_name)Version) BadCommandInstallationError)BaseDistributionget_environment)install_req_from_editableinstall_req_from_line) COMMENT_RE)%direct_url_as_pep440_direct_referencec@s"eZdZUeed<eeed<dS) _EditableInfo requirementcommentsN)__name__ __module__ __qualname__str__annotations__rrrA/usr/lib/python3/dist-packages/pip/_internal/operations/freeze.pyrs rFrr local_only user_onlypathsisolatedexclude_editableskipreturnc cs^i}t|j|d|d}|D]} t| } |r| jrq| || j<q|rt} tt } |D]} t | }|D]}| rJ| dsJ| dr[| }|| vrZ| ||Vq8| dse| dr| drs|dd }n |tdd d}t||d }n ttd | |d }|jstd | | td q8t|j}||vr| |jstd | td | |jq8| |j| q8t|| V||=| |j| q8Wdn1swYq/| D]\}}t|dkrtd|dtt|qdVt|dddD]}|j|vr+t| VqdS)Nr)rr#r#) z-rz --requirementz-fz --find-linksz-iz --index-urlz--prez--trusted-hostz--process-dependency-linksz--extra-index-urlz --use-featurez-ez --editable=)r!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 installedz+Requirement %s included multiple times [%s]z, z7## The following requirements were added by pip freeze:cSs |jSN)namelower)xrrrs zfreeze..)key) riter_installed_distributionsFrozenRequirement from_disteditablecanonical_nameset collections defaultdictlistopenstrip startswithrstripaddlenlstriprrrsubr+loggerinfor warningappendritemsjoinsortedvalues)rrrr r!r"r# installationsdistsdistreqemitted_options req_files req_file_pathreq_filelineline_reqline_req_canonical_namer+files installationrrrfreezes           K rVrKcCs0t|jtr|jd|jS|jd|jS)Nz==z===) isinstanceversionr raw_name)rKrrr_format_as_name_versions rZc Cs|j}|sJtjtj|}ddlm}m}m}| |}|dur:t |}t d||t |d|dgdSt|j}z |||j} Wnq|yct |}t |d|d |dgdYS|y} zt |}t |d|d |d d | jd gdWYd} ~ Sd} ~ wtyt d||jt |gdYSty} z t d| WYd} ~ n d} ~ wwt | gdSt d|t |dgdS)za Compute and return values (req, comments) for use in FrozenRequirement.from_dist(). r)RemoteNotFoundErrorRemoteNotValidErrorvcsNz1No VCS found for editable requirement "%s" in: %rz,# Editable install with no version control ())rrz # Editable z install with no remote (z install (z4) with either a deleted local remote or invalid URI:z# ''zPcannot determine version of editable source in %s (%s command not found in path)z6Error when trying to get requirement for VCS system %sz-Could not determine repository location of %sz-## !! Could not determine repository location)editable_project_locationospathnormcaseabspathpip._internal.vcsr[r\r]get_backend_for_dirrZrAdebugrtyperget_src_requirementrYurlr rCr+r ) rKr`locationr[r\r] vcs_backenddisplayvcs_namerLexexcrrr_get_editable_infosf         rqc @sVeZdZ ddedededeeddf dd Zed eddfd d Z defd dZ dS)r1rr+rLr3rr$NcCs&||_t||_||_||_||_dSr*)r+r r4rLr3r)selfr+rLr3rrrr__init__s   zFrozenRequirement.__init__rKcCsN|j}|r t|\}}ng}|j}|rt||j}nt|}||j|||dS)N)r)r3rq direct_urlrrYrZ)clsrKr3rLrrtrrrr2szFrozenRequirement.from_distcCs4|j}|jr d|}dt|jt|gdS)Nz-e  )rLr3rFr8rr)rrrLrrr__str__s zFrozenRequirement.__str__)r) rrrrboolrrs classmethodrr2rwrrrrr1s   r1)NFFNFFr)'r6loggingratypingrrrrrrrr pip._vendor.packaging.utilsr pip._vendor.packaging.versionr pip._internal.exceptionsr r pip._internal.metadatarrpip._internal.req.constructorsrrpip._internal.req.req_filer&pip._internal.utils.direct_url_helpersr getLoggerrrArrrxrVrZrqr1rrrrsP(        yB