a [f*& @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!dddZ#ee!dddZ$ee dddZ%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__rrrC/usr/lib/python3.9/site-packages/pip/_internal/operations/freeze.pyrs rFr)r local_only user_onlypathsisolatedexclude_editableskipreturnc csni}t|j|d|d}|D]$} t| } |r6| jr6q| || j<q|r4t} tt } |D]} t | p}|D]X}| r| ds| dr| }|| vrr| ||Vqr| ds| dr| dr|dd }n|tdd d}t||d }nttd | |d }|jsRtd | | td qrt|j}||vr| |jstd | td | |jn| |j| qrt|| V||=| |j| qrWdq\1s0Yq\| D]4\}}t|dkrtd|dtt|qdVt|dddD] }|j|vrHt| VqHdS)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) rZiter_installed_distributionsFrozenRequirement from_disteditablecanonical_nameset collections defaultdictlistopenstrip startswithrstripaddlenlstriprrrsubr+loggerinfor warningappendritemsjoinsortedvalues)rrrr r!r"r#Z installationsZdistsdistreqZemitted_optionsZ req_filesZ req_file_pathZreq_filelineZline_reqZline_req_canonical_namer+filesZ installationrrrfreezes              4 rMrIr$cCs0t|jtr|jd|jS|jd|jS)Nz==z===) isinstanceversionr raw_name)rIrrr_format_as_name_versions rRc Cs|j}|sJtjtj|}ddlm}m}m}| |}|durtt |}t d||t |d|dgdSt|j}z|||j} Wn|yt |}t |d|d |dgdYS|y} zs@(        yB