� ��^i����ddlZddlZddlZddlZddlZddlZddlmZm Z ddl m Z m Z ddl mZddlmZmZeje��Zeej����Zeedd��Zdefd �Zdefd �Zdefd �Zdefd �Zgd �Z ej!d���e �"d�� ddededej#edej#ededej#ede fd�Z$defd�Z%defd�Z&defd�Z'dedej(eeffd�Z)dS)�N)�InvalidSchemeCombination�UserInstallationInvalid)� SCHEME_KEYS�Scheme)�running_under_virtualenv�)�get_major_minor_version�is_osx_framework�get_preferred_scheme�returnc�N�dtvot�� 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_SCHEMESrr ����/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/locations/_sysconfig.py� _should_use_osx_framework_prefixrs1��( �#5�5� �(�*�*� *� � � � �rc�l�trtd��St��rdStjj�dt j��}|t vr|Stjjt vrtjjSt j�d�}|t vr|St jt vr t jSdS)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 8s����/�$�X�.�.�.�'�)�)�'�&�&�!$�!3�!8�D�D�2�7�D�D���"4�4�4�&�&� ���"4�4�4��!�&�&��'�"�"�"�H��%�%�%��� �w�$�$�$��w�� �>rc���trtd��St��rt��sd}ntj�d�}|t vr|Sdt vrt ���dS)z3Try to find a user scheme for the current platform.�user�osx_framework_user�_user� posix_user)rr rrrrr�rs r� _infer_userr'Wsy���-�$�V�,�,�,����%�":�"<�"<�%�'����g�$�$�$���%�%�%����-�-�-�%�'�'�'� ����-�$�V�,�,�,��'� � � �H��%�%�%��� �zget_scheme..�s���1�1�1��Q��1�1�1rc���i|]}|���Srr)r8r9rs �rr:zget_scheme..�s���3�3�3�1�Q��3�3�3r)�scheme�varsr2r.�python�include�site�UNKNOWN�platlib�purelib�scripts�data)rBrC�headersrDrE)rr,r'r � _HOME_KEYS� sysconfig� get_pathsr�getrrr r�path�joinrr� distutils�util� change_root�getattr�setattr)r3r"r)r4r5r� scheme_name� variables�pathsr.� python_xyr<�key�values ` ` r� get_schemerX}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� ��� (� (�C��N�.�.�t�W�V�S�5I�5I�J�J�E� �F�C�� '� '� '� '� �Mrc��tjdd�dkrtjdd�dkrdStj��dS)N��darwin�z/System/Library/z/usr/local/binrD)r�platformrrHrIrrr�get_bin_prefixr^�sG�� �|�B�Q�B��8�#�#�� �3�B�3��;M�(M�(M��� � � � �� +�+rc�4�tj��dS)NrC�rHrIrrr� get_purelibra���� � � � �� +�+rc�4�tj��dS)NrBr`rrr� get_platlibrd�rbrc�R�tj||d����}|d|dfS)N)r.r0)r=rCrBr`)rrTs r�get_prefixed_libsrf�s2�� � �f�&�%I�%I� J� J� J�E� �)� �e�I�.� /�/r)FNNFN)*�distutils.utilrM�loggingrrrH�typing�pip._internal.exceptionsrr�pip._internal.models.schemerr�pip._internal.utils.virtualenvrr.r r � getLogger�__name__�logger�set�get_scheme_namesrrPr�boolr�strr r'r,rG�get_config_var�append�OptionalrXr^rard�Tuplerfrrr�rxs����������� � � � � � � � ����� � � � �V�V�V�V�V�V�V�V�;�;�;�;�;�;�;�;�C�C�C�C�C�C�;�;�;�;�;�;�;�;� �� �8� $� $���S�3��3�5�5�6�6���� �+A�4�H�H���$�����4�s�����> �S� � � � ��S�������� ��9��J�'�'�3����j�!�!�!� �!%�!%��#'� J�J��J� �J� �/�#� �J� �/�#� � J� � J� �O�C� � J� �J�J�J�J�Z,��,�,�,�,�,�S�,�,�,�,�,�S�,�,�,�,�0�c�0�f�l�3��8�&<�0�0�0�0�0�0r