grthtrhthjhtyjytjytkergtrhtrjytjerhrfh3 ÝPf†.ã@s,dZddlmZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z ddlmZddlmZmZmZmZmZdd lmZdd lmZmZdd lmZmZdd lmZm Z m!Z!m"Z"m#Z#dd l$m%Z%m&Z&m'Z'ddl(m)Z)ddl*m+Z+dgZ,ej-e.ƒZ/Gdd„de0ƒZ1Gdd„de1ƒZ2dS)z(Base Command class, and related routinesé)Úabsolute_importN)Ú cmdoptions)Ú PackageFinder)Úrunning_under_virtualenv)Ú PipSession)Ú BadCommandÚInstallationErrorÚUninstallationErrorÚ CommandErrorÚPreviousBuildDirError)Úlogging_dictConfig)ÚConfigOptionParserÚUpdatingDefaultsHelpFormatter)ÚInstallRequirementÚparse_requirements)ÚSUCCESSÚERRORÚ UNKNOWN_ERRORÚVIRTUALENV_NOT_FOUNDÚPREVIOUS_BUILD_DIR_ERROR)Ú deprecationÚget_progÚnormalize_path)ÚIndentingFormatter)Úpip_version_checkÚCommandc@s@eZdZdZdZdZd Zddd„Zddd„Zd d „Z d d „Z dS)rNFúext://sys.stdoutúext://sys.stderrcCsr|jdtƒ|jftƒd|j|j|dœ}tf|Ž|_d|jjƒ}tj |j|ƒ|_ t j t j |jƒ}|jj|ƒdS)Nz%s %sF)ÚusageÚprogÚ formatterZadd_help_optionÚnameÚ descriptionÚisolatedz %s Options)rrr!rÚ__doc__r ÚparserÚ capitalizeÚoptparseZ OptionGroupZcmd_optsrZmake_option_groupZ general_groupZadd_option_group)Úselfr#Z parser_kwZ optgroup_nameZgen_opts©r)ú!/usr/lib/python3.6/basecommand.pyÚ__init__)s zCommand.__init__cCs˜t|jrttjj|jdƒƒnd|dk r*|n|j|jd�}|jrF|j|_ |j rT|j |_|j s^|rr|dk rj|n|j |_ |j rˆ|j |j dœ|_ |j |j_|S)NÚhttp)ÚcacheÚretriesZinsecure_hosts)r,Zhttps)rÚ cache_dirrÚosÚpathÚjoinr.Ú trusted_hostsZcertZverifyZ client_certÚtimeoutÚproxyZproxiesÚno_inputZauthZ prompting)r(Úoptionsr.r4Úsessionr)r)r*Ú_build_sessionAs    zCommand._build_sessioncCs |jj|ƒS)N)r%Ú parse_args)r(Úargsr)r)r*r:eszCommand.parse_argscsÚ|j|ƒ\}}|jr8|jdkr"d‰|jdkr2d‰qHd‰n|jrDd‰nd‰ˆ}|jrVd}tddd d tjd œid td dœiˆd|jdd gd dœdd|jdd dœdd|jpªddd dœdœ|t t ddd|jrÌdndgƒƒdœt ‡fdd„d2Dƒƒd"œƒt j dd…d3k�rtjd$tjƒ|j�r(d%tjd&<|j�rBd'j|jƒtjd(<|j�rftƒ�sftjd)ƒt jtƒ�z$y"|j||ƒ}t|tƒ�rˆ|SW�nüt k �rÊ}z tjt!|ƒƒtj"d*dd+�t#Sd}~XnÀt$t%t&fk �r }z tjt!|ƒƒtj"d*dd+�t'Sd}~Xn~t(k �rF}ztjd,|ƒtj"d*dd+�t'Sd}~XnDt)k �rrtjd-ƒtj"d*dd+�t'Stjd.dd+�t*SWd|j+ �rÔt,|d/dƒ �rÔ|j-|dt.d0|j/ƒd1��}t0|ƒWdQRXXt1S)4NéÚWARNINGérZCRITICALÚDEBUGÚINFOFZexclude_warningsz pip.utils.logging.MaxLevelFilter)z()ÚlevelÚindentz %(message)s)z()Úformatz(pip.utils.logging.ColorizedStreamHandlerr)rAÚclassÚstreamÚfiltersr )rArDrEr z+pip.utils.logging.BetterRotatingFileHandlerz /dev/nullT)rArDÚfilenameZdelayr )ÚconsoleÚconsole_errorsÚuser_logrHrIrJ)rAÚhandlersc3s&|]}|dˆdkrdndifVqdS)rAr@rr=r?N)r@rr))Ú.0r!)rAr)r*ú ¯s zCommand.main..ú pip._vendorÚdistlibÚrequestsÚurllib3)ÚversionZdisable_existing_loggersrFZ formattersrKÚrootZloggerséz�Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6Ú1Z PIP_NO_INPUTú ZPIP_EXISTS_ACTIONz2Could not find an activated virtualenv (required).zException information:)Úexc_infoz ERROR: %szOperation cancelled by userz Exception:Úno_indexé)r.r4)rNrOrPrQ)r>rT)2r:ÚquietÚverboseÚlogr Úloggingr=rÚ log_streamsÚlistÚfilterÚdictÚsysÚ version_infoÚwarningsÚwarnrZPython26DeprecationWarningr6r0ÚenvironZ exists_actionr2Z require_venvrÚloggerZcriticalÚexitrZrunÚ isinstanceÚintr ÚstrÚdebugrrr rrr ÚKeyboardInterruptrZdisable_pip_version_checkÚgetattrr9Úminr4rr)r(r;r7Z root_levelZstatusÚexcr8r))rAr*Úmainis°             z Command.main)rr)F)NN) Ú__name__Ú __module__Ú __qualname__r!rZhiddenr^r+r9r:rqr)r)r)r*r#s  $c@s"eZdZedd„ƒZddd„ZdS)ÚRequirementCommandc Cs"x6|jD],}x&t|d||||d�D]}|j|ƒq"WqWx&|D]}|jtj|d|j|d�ƒq>Wx*|jD] }|jtj||j|j|d�ƒqhWd} x8|j D].}x(t|||||d�D]}d} |j|ƒq°Wq˜W|j |_ |pÞ|jpÞ| �sd|i} |j �r d t | d j |j ƒd �} nd | } tj| ƒdS) z? Marshal cmd line args into a requirement set. T)Z constraintÚfinderr7r8Ú wheel_cacheN)r#rw)Ú default_vcsr#rwF)rvr7r8rwr!z^You must give at least one requirement to %(name)s (maybe you meant "pip %(name)s %(links)s"?)rV)ZlinkszLYou must give at least one requirement to %(name)s (see "pip help %(name)s"))Z constraintsrZadd_requirementrZ from_lineZ isolated_modeZ editablesZ from_editablerxZ requirementsZrequire_hashesÚ find_linksrar2rgZwarning) Zrequirement_setr;r7rvr8r!rwrGZreqZfound_req_in_fileZoptsÚmsgr)r)r*Úpopulate_requirement_setsF     z+RequirementCommand.populate_requirement_setNc CsR|jg|j}|jr*tjddj|ƒƒg}t|j|j||j |j |j |||||d� S)zR Create a package finder appropriate to this requirement command. zIgnoring indexes: %sú,) ryÚformat_controlÚ index_urlsr3Zallow_all_prereleasesÚprocess_dependency_linksr8ÚplatformZversionsÚabiÚimplementation) Z index_urlZextra_index_urlsrXrgrlr2rryr}r3Zprer)r(r7r8r€Zpython_versionsr�r‚r~r)r)r*Ú_build_package_finder:s z(RequirementCommand._build_package_finder)NNNN)rrrsrtÚ staticmethodr{rƒr)r)r)r*rus 8ru)3r$Z __future__rr]r0rbr'rdZpiprZ pip.indexrZ pip.locationsrZ pip.downloadrZpip.exceptionsrrr r r Z pip.compatr Zpip.baseparserr rZpip.reqrrZpip.status_codesrrrrrZ pip.utilsrrrZpip.utils.loggingrZpip.utils.outdatedrÚ__all__Z getLoggerrrrgÚobjectrrur)r)r)r*Ús.         _