U ʗRe8& @s(ddlZddlZddlZddlmZmZmZmZmZm Z m Z m Z ddl m Z ddlmZddlmZmZddlmZmZddlmZmZddlmZdd lmZeeZGd d d e Z de ee!e"e"e ee!e"e"ee!ee!ddfdddZ#ee!dddZ$ee dddZ%GdddZ&dS)N) ContainerDict GeneratorIterableList 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__rrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/operations/freeze.pyrs rFr)r local_only user_onlypathsisolatedexclude_editableskipreturnc csXi}t|j|d|d}|D]$} t| } |r6| jr6q| || j<q|rt} tt } |D]z} t | f}|D]X}| r| ds| dr| }|| krr| ||Vqr| ds| dr| dr|dd }n|tdd d}t||d }nttd | |d }|jsRtd | | td qrt|j}||kr| |jstd | td | |jn| |j| qrt|| V||=| |j| qrW5QRXq\| D]4\}}t|dkrtd|dtt|qdVt|dddD] }|j|kr2t| Vq2dS)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)xrrrzfreeze..)key) riter_installed_distributionsFrozenRequirement from_disteditablecanonical_nameset collections defaultdictlistopenstrip startswithrstripaddlenlstriprrrsubr+loggerinfor warningappendritemsjoinsortedvalues)rrrr r!r"r#Z installationsdistsdistreqZemitted_optionsZ req_filesZ req_file_pathreq_filelineZline_reqZline_req_canonical_namer+filesZ installationrrrfreezes               rPrKr$cCs0t|jtr|jd|jS|jd|jS)Nz==z===) isinstanceversionr raw_name)rKrrr_format_as_name_versions rUc Cs|j}|sttjtj|}ddlm}m}m }| |}|dkrtt |}t d||t|d|dgdSt|j}z|||j} Wn|k rt |}t|d|d |dgdYS|k r} z8t |}t|d|d |d d | jd gdWYSd} ~ XYnltk rNt d||jt|gdYStk r|} zt d| W5d} ~ XYnXt| 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_locationAssertionErrorospathnormcaseabspathpip._internal.vcsrVrWrXget_backend_for_dirrUrBdebugrtyperget_src_requirementrTurlr rDr+r ) rKr[locationrVrWrX vcs_backenddisplayZvcs_namerLexexcrrr_get_editable_infos`       rlc@sJeZdZd eeeeeddddZeeddddZ ed d d Z dS) r2rN)r+rLr4rr$cCs&||_t||_||_||_||_dSr*)r+r r5rLr4r)selfr+rLr4rrrr__init__s  zFrozenRequirement.__init__rQcCsN|j}|rt|\}}n$g}|j}|r4t||j}nt|}||j|||dS)N)r)r4rl direct_urlrrTrU)clsrKr4rLrrorrrr3szFrozenRequirement.from_dist)r$cCs4|j}|jrd|}dt|jt|gdS)Nz-e  )rLr4rGr9rr)rmrLrrr__str__s zFrozenRequirement.__str__)r) rrrrboolrrn classmethodrr3rrrrrrr2s r2)NFFNFFr)'r7loggingr]typingrrrrrrrr pip._vendor.packaging.utilsr Zpip._vendor.packaging.versionr pip._internal.exceptionsr r pip._internal.metadatarrpip._internal.req.constructorsrrZpip._internal.req.req_filer&pip._internal.utils.direct_url_helpersr getLoggerrrBrrrsrPrUrlr2rrrrs@(        yB