o
    ñ‘OjT  ã                   @   sÎ   d dl Z d dlZd dlZd dlZd dlmZm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
rIddhZd	d
„ e  ee¡D ƒZddeee  defdd„Zdefdd„Zdefdd„ZdS )é    N)ÚListÚOptional)Úmain)ÚWINDOWSÚpipÚ.Ú z.exec                 C   s   g | ]}d   |¡‘qS )r   )Újoin)Ú.0Úparts© r   úe/var/www/html/pharmsmart-cdr-gen/venv/lib/python3.10/site-packages/pip/_internal/utils/entrypoints.pyÚ
<listcomp>   s    ÿÿr   ÚargsÚreturnc                 C   s   t 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   )r   r   r   r   Ú_wrapper   s   ÿr   c                  C   s’   t rdnd} tj tj| ¡}tj tj dd¡¡ 	tj
¡}tj |¡|v }|rCtD ]}t |¡}|rBtj |tj ||¡¡rB|  S q)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Úpathr	   r   ÚprefixÚnormcaseÚenvironÚgetÚsplitÚpathsepÚ_EXECUTABLE_NAMESÚshutilÚwhichÚsamefileÚ#get_best_invocation_for_this_python)Úbinary_directoryÚbinary_prefixÚ
path_partsÚexe_are_in_PATHÚexe_nameÚfound_executabler   r   r   Ú get_best_invocation_for_this_pip.   s   

þ€r+   c                  C   s6   t j} tj | ¡}t |¡}|rtj || ¡r|S | S )z<Try to figure out the best way to invoke the current Python.)r   Ú
executabler   r   Úbasenamer!   r"   r#   )Úexer)   r*   r   r   r   r$   D   s   
r$   )N)Ú	itertoolsr   r!   r   Útypingr   r   Úpip._internal.cli.mainr   Úpip._internal.utils.compatr   Úversion_infoÚmajorÚminorr    Ú_allowed_extensionsÚproductÚstrÚintr   r+   r$   r   r   r   r   Ú<module>   s&    ý
þ