3 PfJ @sddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZddlmZejeZddddddd dff d d ZdS) )absolute_importN)InstallRequirement) COMMENT_RE)get_installed_distributions) pkg_resources)canonicalize_name)RequirementParseErrorFc cs|pg}d} |rtj|j} g} x(tjD]} | jdr(| j| jdq(Wx|D]} d| krP| j| qPWx|D]} d| VqpWi} xXt |f|dD]F} yt j j | | }Wn$t k rtjd| jwYnX|| |j<qW|rvt}x|D]v}t|b}xX|D]N}|j sL|jjdsL| r@| |sL|jd!rr|j}||kr|j||Vq|jds|jdr|jdr|ddj}n|tddjjd}tj||||d}ntjtjd|j||d}|jstjd||jtjdnD|j| kr@tjd|tjd|jnt | |jjV| |j=qWWdQRXqWdVxszfreeze..)key) r rrrrrrrrrrr)$recompilesearchrZ working_setZ has_metadataextendZget_metadata_linesappendrpipZFrozenRequirementZ from_distrloggerZwarningZ project_namersetopenstrip startswithrstripaddlenlstriprZ from_editableZ from_linersubinfostrsortedvaluesr)Z requirementZ find_linksr r Z skip_regexrrrr Z skip_matchZdependency_linksZdistlinkZ installationsZreqZemitted_optionsZ req_file_pathZreq_filelineZline_reqZ installationr"r"r#freezes               r<)Z __future__rZloggingr&r+Zpip.reqrZpip.req.req_filerZ pip.utilsrZ pip._vendorrZpip._vendor.packaging.utilsrZpip._vendor.pkg_resourcesrZ getLogger__name__r,r<r"r"r"r#s