a
    ‡Ààgy$  ã                   @   sr  d Z ddlmZmZ ddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZ ddlmZ ddlmZ ddlmZmZ ddlmZmZmZmZ dd	lmZmZmZmZmZmZ dd
l m!Z! ddl"m#Z# ddl$m%Z%m&Z& ddl'm(Z(m)Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 e.�rNddlm1Z1 ddl2m3Z3m4Z4m5Z5m6Z6 ddl*m7Z8 dgZ9e :e;¡Z<G dd„ deƒZ=dS )z(Base Command class, and related routinesé    )Úabsolute_importÚprint_functionN)ÚPY2)Ú
cmdoptions)ÚCommandContextMixIn)ÚConfigOptionParserÚUpdatingDefaultsHelpFormatter)ÚERRORÚPREVIOUS_BUILD_DIR_ERRORÚUNKNOWN_ERRORÚVIRTUALENV_NOT_FOUND)Ú
BadCommandÚCommandErrorÚInstallationErrorÚNetworkConnectionErrorÚPreviousBuildDirErrorÚUninstallationError)Ú
deprecated)Úcheck_path_owner)ÚBrokenStdoutLoggingErrorÚsetup_logging)Úget_progÚnormalize_path)Úglobal_tempdir_managerÚtempdir_registry)ÚMYPY_CHECK_RUNNING)Úrunning_under_virtualenv)ÚValues)ÚAnyÚListÚOptionalÚTuple)ÚTempDirectoryTypeRegistryÚCommandc                       sV   e Zd ZdZdZd‡ fdd„	Zdd„ Zdd„ Zd	d
„ Zdd„ Z	dd„ Z
dd„ Z‡  ZS )r#   NFc                    sœ   t t| ƒ ¡  | jd tƒ |¡tƒ d|| j|dœ}|| _|| _	t
f i |¤Ž| _d | _d | j ¡ ¡}t | j|¡| _t tj| j¡}| j |¡ |  ¡  d S )Nz{} {}F)ÚusageÚprogÚ	formatterÚadd_help_optionÚnameÚdescriptionÚisolatedz
{} Options)Úsuperr#   Ú__init__r$   Úformatr   r   Ú__doc__r(   Úsummaryr   Úparserr   Ú
capitalizeÚoptparseÚOptionGroupÚcmd_optsr   Úmake_option_groupÚgeneral_groupÚadd_option_groupÚadd_options)Úselfr(   r/   r*   Ú	parser_kwZoptgroup_nameÚgen_opts©Ú	__class__© úW/var/www/sistema_ama/venv/lib/python3.9/site-packages/pip/_internal/cli/base_command.pyr,   9   s*    ù
þzCommand.__init__c                 C   s   d S ©Nr>   )r9   r>   r>   r?   r8   Y   s    zCommand.add_optionsc                 C   s   t |dƒrJ ‚dS )zf
        This is a no-op so that commands by default do not do the pip version
        check.
        Úno_indexN)Úhasattr)r9   Úoptionsr>   r>   r?   Úhandle_pip_version_check]   s    z Command.handle_pip_version_checkc                 C   s   t ‚d S r@   )ÚNotImplementedError)r9   rC   Úargsr>   r>   r?   Úrung   s    zCommand.runc                 C   s   | j  |¡S r@   )r0   Ú
parse_args©r9   rF   r>   r>   r?   rH   k   s    zCommand.parse_argsc                 C   sX   zH|   ¡ �$ |  |¡W  d   ƒ W t ¡  S 1 s40    Y  W t ¡  n
t ¡  0 d S r@   )Zmain_contextÚ_mainÚloggingÚshutdownrI   r>   r>   r?   Úmainp   s    
þzCommand.mainc                 C   sr  |   tƒ ¡| _|   tƒ ¡ |  |¡\}}|j|j | _t| j|j|j	d�}t
jd d… dkrˆ|jsˆd}t ¡ dkrzd| }t|d dd� t
jd d… d	kr²|js²d
}t|d dd� |jrÂdtjd< |jrÚd |j¡tjd< |j�r| j�stƒ �st d¡ t
 t¡ |j�r:t|jƒ|_t|jƒ�s:t d|j¡ d |_t |dd ƒ�rXtddddd� d|j!v �rtt"�stt d¡ �zêz.|  #||¡}t$|t%ƒ�s–J ‚|W W |  &|¡ S  t'�yø } z8t t(|ƒ¡ tj)ddd� t*W  Y d }~W |  &|¡ S d }~0  t+t,t-t.f�yP } z8t t(|ƒ¡ tj)ddd� t/W  Y d }~W |  &|¡ S d }~0  t0�yž } z6t d|¡ tj)ddd� t/W  Y d }~W |  &|¡ S d }~0  t1�yè   t2dt
j3d� |t4j5k�rÔt6j7t
j3d� t/ Y W |  &|¡ S  t8�y"   t d¡ tj)ddd� t/ Y W |  &|¡ S  t9�yR   tjd dd� t: Y W |  &|¡ S 0 W |  &|¡ n|  &|¡ 0 d S )!N)Ú	verbosityÚno_colorÚuser_log_fileé   )rQ   é   zÁpip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-supportÚCPythonzPython 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. z21.0)ÚreplacementÚgone_in)é   é   z¼Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021.Ú1ÚPIP_NO_INPUTú ÚPIP_EXISTS_ACTIONz2Could not find an activated virtualenv (required).zèThe directory '%s' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.Ú	build_dirz\The -b/--build/--build-dir/--build-directory option is deprecated and has no effect anymore.zOuse the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-cleanz21.1i�   )ÚreasonrT   rU   Úissuez2020-resolverz”--use-feature=2020-resolver no longer has any effect, since it is now the default dependency resolver in pip. This will become an error in pip 21.0.zException information:T)Úexc_infoz%sz ERROR: Pipe to stdout was broken)ÚfilezOperation cancelled by userz
Exception:);Úenter_contextr   r   rH   ÚverboseÚquietrN   r   rO   ÚlogÚsysÚversion_infoÚno_python_version_warningÚplatformÚpython_implementationr   Úno_inputÚosÚenvironÚexists_actionÚjoinÚrequire_venvÚignore_require_venvr   ÚloggerÚcriticalÚexitr   Ú	cache_dirr   r   ÚwarningÚgetattrÚfeatures_enabledr   rG   Ú
isinstanceÚintrD   r   ÚstrÚdebugr
   r   r   r   r   r	   r   r   ÚprintÚstderrrK   ÚDEBUGÚ	tracebackÚ	print_excÚKeyboardInterruptÚBaseExceptionr   )r9   rF   rC   Úlevel_numberÚmessageÚstatusÚexcr>   r>   r?   rJ   x   sÊ    ýÿþÿüÿþÿ
ÿ
úöÿ#
Ý
â
ÿ
è

í

õ

ú
þzCommand._main)F)Ú__name__Ú
__module__Ú__qualname__r$   rp   r,   r8   rD   rG   rH   rM   rJ   Ú__classcell__r>   r>   r<   r?   r#   5   s    
)>r.   Ú
__future__r   r   rK   Zlogging.configr2   rk   rh   re   r   Úpip._vendor.sixr   Úpip._internal.clir   Ú!pip._internal.cli.command_contextr   Úpip._internal.cli.parserr   r   Úpip._internal.cli.status_codesr	   r
   r   r   Úpip._internal.exceptionsr   r   r   r   r   r   Úpip._internal.utils.deprecationr   Úpip._internal.utils.filesystemr   Úpip._internal.utils.loggingr   r   Úpip._internal.utils.miscr   r   Úpip._internal.utils.temp_dirr   r   Úpip._internal.utils.typingr   Úpip._internal.utils.virtualenvr   r   Útypingr   r   r    r!   r"   ZTempDirRegistryÚ__all__Ú	getLoggerr‡   rq   r#   r>   r>   r>   r?   Ú<module>   s8    
