
    e                        U d Z ddlZddlZddlmZmZmZmZmZ ddl	m
Z
 ddlmZ dZ G d de          Zdaeed	<   	 	 d(d
eeef         dee         dededee         dee         ddfdZd)dZddddedee         dee         dee         dee         ddfdZ G d d          Z eddddd !          Z ed"d#dd$d %          Z ed&d#dd'd %          ZdS )*zN
A module that implements tooling to enable easy warnings about deprecations.
    N)AnyOptionalTextIOTypeUnion)parse)__version__zDEPRECATION: c                       e Zd ZdS )PipDeprecationWarningN)__name__
__module____qualname__     V/var/www/html/api/venv/lib/python3.11/site-packages/pip/_internal/utils/deprecation.pyr   r      s        Dr   r   _original_showwarningmessagecategoryfilenamelinenofilelinereturnc                     |t           t          | |||||           d S d S t          |t                    r+t          j        d          }|                    |            d S t          | |||||           d S )Nzpip._internal.deprecations)r   
issubclassr   logging	getLoggerwarning)r   r   r   r   r   r   loggers          r   _showwarningr       s      ,!'8XvtTRRRRR -,	H3	4	4 O "#?@@wgx64NNNNNr   c                      t          j        dt          d           t          t           j        at
          t           _        d S d S )NdefaultT)append)warningssimplefilterr   r   showwarningr    r   r   r   install_warning_loggerr'   ,   sB    )%:4HHHH $ ( 4+ %$r   )feature_flagissuereasonreplacementgone_inr(   r)   c                 2   |duo$t          t                    t          |          k    }| t           df||sdndf|df||sdndf|dfg}d                    d	 |D                       }|rt	          |          t          j        |t          d
           dS )a   Helper to deprecate existing functionality.

    reason:
        Textual reason shown to the user about why this functionality has
        been deprecated. Should be a complete sentence.
    replacement:
        Textual suggestion shown to the user about what alternative
        functionality they can use.
    gone_in:
        The version of pip does this functionality should get removed in.
        Raises an error if pip's current version is greater than or equal to
        this.
    feature_flag:
        Command-line flag of the form --use-feature={feature_flag} for testing
        upcoming functionality.
    issue:
        Issue number on the tracker that would serve as a useful place for
        users to find related discussion and provide feedback.
    Nz{}z*pip {} will enforce this behaviour change.z*Since pip {}, this is no longer supported.zA possible replacement is {}.zEYou can use the flag --use-feature={} to test the upcoming behaviour.z@Discussion can be found at https://github.com/pypa/pip/issues/{} c              3   N   K   | ] \  }}||	|                     |          V  !d S N)format).0value
format_strs      r   	<genexpr>zdeprecated.<locals>.<genexpr>n   sK        E:!e&7 	%  &7&7&7&7 r      )r   
stacklevel)r   current_versionDEPRECATION_MSG_PREFIXjoinr   r$   warn)r*   r+   r,   r(   r)   is_gonemessage_partsr   s           r   
deprecatedr>   7   s    : T!NeO&<&<g&NG 
*0001>88=		
 +	

 SS		
 N	
%M0 hh  !.    G  -#G,,,M'$9aHHHHHHr   c                       e Zd Z	 	 	 	 	 	 ddedee         dee         dee         dee         ded	efd
ZdeddfdZdS )LegacyInstallReasonNFr*   r+   r,   r(   r)   emit_after_successemit_before_installc                 h    || _         || _        || _        || _        || _        || _        || _        d S r0   )_reason_replacement_gone_in_feature_flag_issuerA   rB   )selfr*   r+   r,   r(   r)   rA   rB   s           r   __init__zLegacyInstallReason.__init__|   s?     ')"4#6   r   namer   c                     t          | j                            |          | j        | j        | j        | j                   d S )N)rK   )r*   r+   r,   r(   r)   )r>   rD   r1   rE   rF   rG   rH   )rI   rK   s     r   emit_deprecationz$LegacyInstallReason.emit_deprecation   sO    <&&D&11)M++	
 	
 	
 	
 	
 	
r   )NNNNFF)	r   r   r   strr   intboolrJ   rM   r   r   r   r@   r@   {   s         &*!%&*##($)7 77 c]7 #	7
 sm7 }7 !7 "7 7 7 7$
S 
T 
 
 
 
 
 
r   r@   zk{name} was installed using the legacy 'setup.py install' method, because a wheel could not be built for it.z+to fix the wheel build issue reported abovez23.1i   T)r*   r+   r,   r)   rA   z{name} is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed.z#to enable the '--use-pep517' optionio!  )r*   r+   r,   r)   rB   z{name} is being installed using the legacy 'setup.py install' method, because the '--no-binary' option was enabled for it and this currently disables local wheel building for projects that don't have a 'pyproject.toml' file.i,  )NN)r   N)__doc__r   r$   typingr   r   r   r   r   pip._vendor.packaging.versionr   pipr	   r8   r9   Warningr   r   __annotations__rN   rO   r    r'   r>   r@   #LegacyInstallReasonFailedBdistWheel&LegacyInstallReasonMissingWheelPackage2LegacyInstallReasonNoBinaryForcesSetuptoolsInstallr   r   r   <module>rZ      s       5 5 5 5 5 5 5 5 5 5 5 5 5 5 / / / / / / . . . . . .( 	 	 	 	 	G 	 	 	 " s ! ! ! "O O7C< O7mO O 	O
 6
O 3-O 
O O O O(, , , ,  #'AI AI AIAI #AI c]	AI
 3-AI C=AI 
AI AI AI AIH
 
 
 
 
 
 
 
: ':&9	= >
	' 	' 	' # *=)<	
 6
* * * & 6I5H	.
 6
6 6 6 2 2 2r   