
    Qh                    l   d dl m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ej                  j                   dej                  j                   dej                  j                   gZe	r4ddhZ ej                  ee      D  cg c]  } dj!                  |        c} Zddd	Zdd
ZddZyc c} w )    )annotationsN)main)WINDOWSpip. z.exec                V    t         j                  j                  d       t        |       S )a  Central wrapper for all old entrypoints.

    Historically pip has had several entrypoints defined. Because of issues
    arising from PATH, sys.path, multiple Pythons, their interactions, and most
    of them having a pip installed, users suffer every time an entrypoint gets
    moved.

    To alleviate this pain, and provide a mechanism for warning users and
    directing them to an appropriate place for help, we now define all of
    our old entrypoints as wrappers for the current one.
    a  WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
)sysstderrwriter   )argss    [/var/www/teggl/fontify/venv/lib/python3.12/site-packages/pip/_internal/utils/entrypoints.py_wrapperr      s'     JJ	" :    c                    t         rdnd} t        j                  j                  t        j
                  |       }t        j                  j                  t        j                  j                  dd            j                  t        j                        }t        j                  j                  |      |v }|rt        D ]~  }t        j                  |      }t        j                  j                  ||      }|s;t        j                  j                  |      s[t        j                  j                  ||      s||c S  t!                dS )zHTry to figure out the best way to invoke pip in the current environment.ScriptsbinPATHr   z -m pip)r   ospathjoinr
   prefixnormcaseenvirongetsplitpathsep_EXECUTABLE_NAMESshutilwhichexistssamefile#get_best_invocation_for_this_python)binary_directorybinary_prefix
path_partsexe_are_in_PATHexe_namefound_executablebinary_executables          r    get_best_invocation_for_this_pipr+   /   s    $+yGGLL-=>M !!"**.."<=CCBJJOJgg&&}5CO) 	 H%||H5 "]H E GGNN#45GG$$$%
  	  234G<<r   c                 "   t         j                  } t        j                  j	                  |       }t        j                  |      }|rHt        j                  j                  t        j                  |      t        j                  |             r|S | S )z<Try to figure out the best way to invoke the current Python.)	r
   
executabler   r   basenamer   r    samestatlstat)exer(   r)   s      r   r#   r#   J   sg    
..Cww$H ||H- BGG,,RXX6F-GRUW Jr   )N)r   zlist[str] | Nonereturnint)r2   str)
__future__r   	itertoolsr   r   r
   pip._internal.cli.mainr   pip._internal.utils.compatr   version_infomajorminorr   _allowed_extensionsproductr   r   r+   r#   )partss   0r   <module>r?      s    "  	  
 ' . 
	#


 
 	!"	#


 
 	!3#3#3#9#9":; 
 v, 'Y&&'8:MN 	.=6qs   B1