ó
    Þ j,  ã                   ó  • S SK r S SKrS SKrS SKrS SKrS SKJrJr  S SKJ	r	J
r
  S SKJr  SSKJrJrJr  \ R"                  " \5      r\" \R*                  " 5       5      r\" \SS5      rS\4S	 jrS\4S
 jrS\4S jrS\4S jr/ SQr\R@                  " S5      b  \RC                  S5             SS\S\S\RD                  \   S\RD                  \   S\S\RD                  \   S\
4S jjr#S\4S jr$S\4S jr%S\4S jr&g)é    N)ÚInvalidSchemeCombinationÚUserInstallationInvalid)ÚSCHEME_KEYSÚScheme)Úrunning_under_virtualenvé   )Úchange_rootÚget_major_minor_versionÚis_osx_frameworkÚget_preferred_schemeÚreturnc                  ób   • S[         ;   =(       a     [        5       (       + =(       a
    [        5       $ )ax  Check for Apple's ``osx_framework_library`` scheme.

Python distributed by Apple's Command Line Tools has this special scheme
that's used when:

* This is a framework build.
* We are installing into the system prefix.

This does not account for ``pip install --prefix`` (also means we're not
installing to the system prefix), which should use ``posix_prefix``, but
logic here means ``_infer_prefix()`` outputs ``osx_framework_library``. But
since ``prefix`` is not available for ``sysconfig.get_default_scheme()``,
which is the stdlib replacement for ``_infer_prefix()``, presumably Apple
wouldn't be able to magically switch between ``osx_framework_library`` and
``posix_prefix``. ``_infer_prefix()`` returning ``osx_framework_library``
means its behavior is consistent whether we use the stdlib implementation
or our own, and we deal with this special case in ``get_scheme()`` instead.
Úosx_framework_library)Ú_AVAILABLE_SCHEMESr   r   © ó    Ú\/var/www/html/gaurav/venv/lib/python3.13/site-packages/pip/_internal/locations/_sysconfig.pyÚ _should_use_osx_framework_prefixr      s+   € ð( 	 Ô#5Ñ5÷ 	Ü(Ó*Ô*÷	äÓðr   c                  óÈ  • [         (       a  [        S5      $ [        5       (       a  g[        R                  R                   S[
        R                   3n U [        ;   a  U $ [        R                  R                  [        ;   a  [        R                  R                  $ [
        R                   S3nU[        ;   a  U$ [
        R                  [        ;   a  [
        R                  $ g)aý  Try to find a prefix scheme for the current platform.

This tries:

* A special ``osx_framework_library`` for Python distributed by Apple's
  Command Line Tools, when not running in a virtual environment.
* Implementation + OS, used by PyPy on Windows (``pypy_nt``).
* Implementation without OS, used by PyPy on POSIX (``pypy``).
* OS + "prefix", used by CPython on POSIX (``posix_prefix``).
* Just the OS name, used by CPython on Windows (``nt``).

If none of the above works, fall back to ``posix_prefix``.
Úprefixr   Ú_Ú_prefixÚposix_prefix)Ú_PREFERRED_SCHEME_APIr   ÚsysÚimplementationÚnameÚosr   )Úimplementation_suffixedÚsuffixeds     r   Ú_infer_prefixr!   7   s°   € ÷ ÒÜ$ XÓ.Ð.Ü'×)Ñ)Ø&Ü!$×!3Ñ!3×!8Ñ!8Ð 9¸¼2¿7¹7¸)ÐDÐØÔ"4Ó4Ø&Ð&Ü
×Ñ×ÑÔ"4Ó4Ü×!Ñ!×&Ñ&Ð&Ü—'‘'�˜'Ð"€HØÔ%Ó%ØˆÜ	‡w�wÔ$Ó$Ü�w‰wˆØr   c                  óØ   • [         (       a  [        S5      $ [        5       (       a  [        5       (       d  Sn O[        R                   S3n U [
        ;   a  U $ S[
        ;  a
  [        5       eg)z3Try to find a user scheme for the current platform.ÚuserÚosx_framework_userÚ_userÚ
posix_user)r   r   r   r   r   r   r   ©r    s    r   Ú_infer_userr(   V   s]   € çÒÜ$ VÓ,Ð,Ü×ÑÔ":×"<Ñ"<Ø'‰ä—g‘g�Y˜eÐ$ˆØÔ%Ó%ØˆØÔ-Ó-Ü%Ó'Ð'Ør   c                  ón   • [         (       a  [        S5      $ [        R                   S3n U [        ;   a  U $ g)z,Try to find a home for the current platform.ÚhomeÚ_homeÚ
posix_home)r   r   r   r   r'   s    r   Ú_infer_homer-   e   s4   € çÒÜ$ VÓ,Ð,Ü—'‘'�˜%Ð €HØÔ%Ó%ØˆØr   )Úinstalled_baseÚbaseÚinstalled_platbaseÚplatbaser   Úexec_prefixÚuserbaseÚ	dist_namer#   r*   ÚrootÚisolatedr   c                 ó~  • U(       a  U(       a  [        SS5      eU(       a  U(       a  [        SS5      eUb  [        5       nOU(       a  [        5       nO
[        5       nUb  US:X  a  SnUb  [         Vs0 sH  owU_M     nnOUb  [         Vs0 sH  owU_M     nnO0 n[
        R                  " XhS9n	[        5       (       a{  U(       a!  UR                  S[        R                  5      n
O UR                  S[        R                  5      n
S	[        5        3n[        R                  R                  U
S
SU5      U	S
'   O	U (       d  Sn [        U	S   U	S   [        R                  R                  U	S
   U 5      U	S   U	S   S9nUb1  0 n[          H  n[#        U[%        XÎ5      5      XÞ'   M     [        S0 UD6nU$ s  snf s  snf )a0  
Get the "scheme" corresponding to the input parameters.

:param dist_name: the name of the package to retrieve the scheme for, used
    in the headers scheme path
:param user: indicates to use the "user" scheme
:param home: indicates to use the "home" scheme
:param root: root under which other directories are re-based
:param isolated: ignored, but kept for distutils compatibility (where
    this controls whether the user-site pydistutils.cfg is honored)
:param prefix: indicates to use the "prefix" scheme and provides the
    base directory for the same
z--userz--prefixz--homer   r   )ÚschemeÚvarsr3   r/   ÚpythonÚincludeÚsiteÚUNKNOWNÚplatlibÚpurelibÚscriptsÚdata)r>   r?   Úheadersr@   rA   r   )r   r-   r(   r!   Ú
_HOME_KEYSÚ	sysconfigÚ	get_pathsr   Úgetr   r   r
   r   ÚpathÚjoinr   r   r	   Úgetattr)r4   r#   r*   r5   r6   r   Úscheme_nameÚkÚ	variablesÚpathsr/   Ú	python_xyr8   Úconverted_keysÚkeys                  r   Ú
get_schemerQ   |   sž  € ö* –Ü& x°Ó<Ð<Þ–Ü& x°Ó<Ð<àÑÜ!“m‰Þ	Ü!“m‰ä#“oˆð
 Ñ˜kÐ-DÓDØ$ˆàÑÝ&0Ó1¡j ˜’W¡jˆ	Ð1ˆ	Ø	Ñ	Ý(2Ó3©
 1˜’Y©
ˆ	Ð3ˆ	àˆ	ä×Ò {ÑC€Eô  ×!Ñ!ÞØ—=‘= ¬S¯Z©ZÓ8‰Dà—=‘= ¬¯©Ó4ˆDØÔ4Ó6Ð7Ð8ˆ	ÜŸ7™7Ÿ<™<¨¨i¸ÀÓKˆˆiÒÞØˆ	äØ�iÑ Ø�iÑ Ü—‘—‘˜U 9Ñ-¨yÓ9Ø�iÑ Ø�6‰]ñ€Fð ÑØˆßˆCÜ"-¨d´G¸FÓ4HÓ"IˆNÓñ äÑ)˜.Ñ)ˆØ€MùòG 2ùâ3s   Á5F5ÂF:c                  ó�   • [         R                  S S S:X  a  [         R                  S S S:X  a  g[        R                  " 5       S   $ )Né   Údarwiné   z/System/Library/z/usr/local/binr@   )r   Úplatformr   rD   rE   r   r   r   Úget_bin_prefixrW   Ê   s>   € ä
‡|�|�B�QÐ˜8Ó#¬¯
©
°3°B¨Ð;MÓ(MØÜ×ÒÓ  Ñ+Ð+r   c                  ó2   • [         R                  " 5       S   $ )Nr?   ©rD   rE   r   r   r   Úget_purelibrZ   Ñ   ó   € Ü×ÒÓ  Ñ+Ð+r   c                  ó2   • [         R                  " 5       S   $ )Nr>   rY   r   r   r   Úget_platlibr]   Õ   r[   r   )FNNFN)'Úloggingr   r   rD   ÚtypingÚpip._internal.exceptionsr   r   Úpip._internal.models.schemer   r   Úpip._internal.utils.virtualenvr   r/   r	   r
   r   Ú	getLoggerÚ__name__ÚloggerÚsetÚget_scheme_namesr   rI   r   Úboolr   Ústrr!   r(   r-   rC   Úget_config_varÚappendÚOptionalrQ   rW   rZ   r]   r   r   r   Ú<module>rm      sQ  ðÛ Û 	Û 
Û Û ç Vß ;Ý Cç HÑ Hà	×	Ò	˜8Ó	$€ñ ˜×3Ò3Ó5Ó6Ð á 	Ð+AÀ4ÓHÐ ð¨$ô ð4�sô ð>�Sô ð�Sô ò€
ð ×Ò˜JÓ'Ñ3Ø×Ñ�jÔ!ð
 Ø!%Ø!%ØØ#'ñKØðKà
ðKð �/‰/˜#Ñ
ðKð �/‰/˜#Ñ
ð	Kð
 ðKð �O‰O˜CÑ ðKð õKð\,˜ô ,ð,�Sô ,ð,�Sõ ,r   