§
    �’jF  ã                  ó’  — U 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	m
Z
 d dlmZmZ d dlmZ ddlmZmZmZ  ej        e¦  «        Z e ej        ¦   «         ¦  «        Z eed	d¦  «        Zd
ed<   d"d„Zd#d„Zd#d„Zd#d„Z g d¢Z! ej"        d¦  «        �e! #                    d¦  «         	 	 	 	 	 d$d%d„Z$d#d„Z%d#d „Z&d#d!„Z'dS )&é    )ÚannotationsN)ÚCallable)ÚInvalidSchemeCombinationÚUserInstallationInvalid)ÚSCHEME_KEYSÚScheme)Úrunning_under_virtualenvé   )Úchange_rootÚget_major_minor_versionÚis_osx_frameworkÚget_preferred_schemezCallable[[str], str] | NoneÚ_PREFERRED_SCHEME_APIÚreturnÚboolc                 óN   — dt           v ot          ¦   «          ot          ¦   «         S )a°  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   © ó    úPC:\Projects\DSCons\.venv\Lib\site-packages\pip\_internal\locations\_sysconfig.pyÚ _should_use_osx_framework_prefixr   !   s1   € ð( 	 Õ#5Ð5ð 	Ý(Ñ*Ô*Ð*ð	åÑÔðr   Ústrc                 ól  — t           rt          d¦  «        S t          ¦   «         rdS t          j        j        › dt
          j        › �} | t          v r| S t          j        j        t          v rt          j        j        S t
          j        › d�}|t          v r|S t
          j        t          v rt
          j        S dS )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)r   r   ÚsysÚimplementationÚnameÚosr   )Úimplementation_suffixedÚsuffixeds     r   Ú_infer_prefixr%   ;   sµ   € õ ð /Ý$ XÑ.Ô.Ð.Ý'Ñ)Ô)ð 'Ø&Ð&Ý!$Ô!3Ô!8ÐDÐD½2¼7ÐDÐDÐØÕ"4Ð4Ð4Ø&Ð&Ý
ÔÔÕ"4Ð4Ð4ÝÔ!Ô&Ð&Ý”'Ð"Ð"Ð"€HØÕ%Ð%Ð%ØˆÝ	„wÕ$Ð$Ð$ÝŒwˆØˆ>r   c                 óÒ   — t           rt          d¦  «        S t          ¦   «         rt          ¦   «         sd} nt          j        › d�} | t
          v r| S dt
          vrt          ¦   «         ‚dS )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,   Z   sy   € åð -Ý$ VÑ,Ô,Ð,ÝÑÔð %Õ":Ñ"<Ô"<ð %Ø'ˆˆå”gÐ$Ð$Ð$ˆØÕ%Ð%Ð%ØˆØÕ-Ð-Ð-Ý%Ñ'Ô'Ð'Øˆ<r   c                 óf   — t           rt          d¦  «        S t          j        › d�} | t          v r| S dS )z,Try to find a home for the current platform.ÚhomeÚ_homeÚ
posix_home)r   r"   r!   r   r+   s    r   Ú_infer_homer1   i   s>   € åð -Ý$ VÑ,Ô,Ð,Ý”'Ð Ð Ð €HØÕ%Ð%Ð%ØˆØˆ<r   )Úinstalled_baseÚbaseÚinstalled_platbaseÚplatbaser   Úexec_prefixÚuserbaseFÚ	dist_namer'   r.   ú
str | NoneÚrootÚisolatedr   r   c                ó„  ‡‡— |r‰rt          dd¦  «        ‚‰r‰rt          dd¦  «        ‚‰�t          ¦   «         }n|rt          ¦   «         }nt          ¦   «         }‰�|dk    rd}‰�ˆfd„t          D ¦   «         }n‰�ˆfd„t          D ¦   «         }ni }t          j        ||¬	¦  «        }t          ¦   «         rz|r!|                     d
t          j
        ¦  «        }	n |                     dt          j
        ¦  «        }	dt          ¦   «         › �}
t          j                             |	dd|
¦  «        |d<   n| sd} t          |d         |d         t          j                             |d         | ¦  «        |d         |d         ¬¦  «        }|�9i }t           D ]#}t#          |t%          ||¦  «        ¦  «        ||<   Œ$t          di |¤Ž}|S )a\  
    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--homeNr   r   c                ó   •— i | ]}|‰“ŒS r   r   )Ú.0Úkr.   s     €r   ú
<dictcomp>zget_scheme.<locals>.<dictcomp>¨   s   ø€ Ð1Ð1Ð1 �Q˜Ð1Ð1Ð1r   c                ó   •— i | ]}|‰“ŒS r   r   )r>   r?   r   s     €r   r@   zget_scheme.<locals>.<dictcomp>ª   s   ø€ Ð3Ð3Ð3 1�Q˜Ð3Ð3Ð3r   )ÚschemeÚvarsr7   r3   ÚpythonÚincludeÚsiteÚUNKNOWNÚplatlibÚpurelibÚscriptsÚdata)rH   rI   ÚheadersrJ   rK   r   )r   r1   r,   r%   Ú
_HOME_KEYSÚ	sysconfigÚ	get_pathsr	   Úgetr   r   r   r"   ÚpathÚjoinr   r   r   Úgetattr)r8   r'   r.   r:   r;   r   Úscheme_nameÚ	variablesÚpathsr3   Ú	python_xyrB   Úconverted_keysÚkeys     `  `        r   Ú
get_schemerZ   €   s  øø€ ð* ð =�ð =Ý& x°Ñ<Ô<Ð<Øð =�ð =Ý& x°Ñ<Ô<Ð<àÐÝ!‘m”mˆˆØ	ð &Ý!‘m”mˆˆå#‘o”oˆð
 Ð˜kÐ-DÒDÐDØ$ˆàÐØ1Ð1Ð1Ð1¥jÐ1Ñ1Ô1ˆ	ˆ	Ø	Ð	Ø3Ð3Ð3Ð3­
Ð3Ñ3Ô3ˆ	ˆ	àˆ	åÔ {¸ÐCÑCÔC€Eõ  Ñ!Ô!ð Øð 	5Ø—=’= ­S¬ZÑ8Ô8ˆDˆDà—=’= ­¬Ñ4Ô4ˆDØ8Õ4Ñ6Ô6Ð8Ð8ˆ	Ýœ7Ÿ<š<¨¨i¸ÀÑKÔKˆˆiÑÐØð Øˆ	åØ�iÔ Ø�iÔ Ý”—’˜U 9Ô-¨yÑ9Ô9Ø�iÔ Ø�6Œ]ðñ ô €Fð ÐØˆÝð 	Jð 	JˆCÝ"-¨dµG¸FÀCÑ4HÔ4HÑ"IÔ"IˆN˜3ÑÐÝÐ)Ð)˜.Ð)Ð)ˆØ€Mr   c                 ó˜   — t           j        d d…         dk    rt           j        d d…         dk    rdS t          j        ¦   «         d         S )Né   Údarwiné   z/System/Library/z/usr/local/binrJ   )r   Úplatformr   rN   rO   r   r   r   Úget_bin_prefixr`   Î   sG   € å
„|�B�Q�BÔ˜8Ò#Ð#­¬
°3°B°3¬Ð;MÒ(MÐ(MØÐÝÔÑ Ô  Ô+Ð+r   c                 ó4   — t          j        ¦   «         d         S )NrI   ©rN   rO   r   r   r   Úget_purelibrc   Õ   ó   € ÝÔÑ Ô  Ô+Ð+r   c                 ó4   — t          j        ¦   «         d         S )NrH   rb   r   r   r   Úget_platlibrf   Ù   rd   r   )r   r   )r   r   )FNNFN)r8   r   r'   r   r.   r9   r:   r9   r;   r   r   r9   r   r   )(Ú
__future__r   Úloggingr"   r   rN   Úcollections.abcr   Úpip._internal.exceptionsr   r   Úpip._internal.models.schemer   r   Úpip._internal.utils.virtualenvr	   r3   r   r   r   Ú	getLoggerÚ__name__ÚloggerÚsetÚget_scheme_namesr   rS   r   Ú__annotations__r   r%   r,   r1   rM   Úget_config_varÚappendrZ   r`   rc   rf   r   r   r   ú<module>ru      s  ðØ "Ð "Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø 
€
€
€
Ø Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $à VÐ VÐ VÐ VÐ VÐ VÐ VÐ VØ ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø CÐ CÐ CÐ CÐ CÐ Cà HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ Hà	ˆÔ	˜8Ñ	$Ô	$€ð �SÐ3˜Ô3Ñ5Ô5Ñ6Ô6Ð à5<°WØÐ% tñ6ô 6Ð ð ð ð ñ ð
ð ð ð ð4ð ð ð ð>ð ð ð ðð ð ð ðð ð €
ð €9Ô˜JÑ'Ô'Ð3Ø×Ò�jÑ!Ô!Ð!ð
 ØØØØðKð Kð Kð Kð Kð\,ð ,ð ,ð ,ð,ð ,ð ,ð ,ð,ð ,ð ,ð ,ð ,ð ,r   