Your IP : 18.118.128.17
�
,�Re� � � � d Z ddlZddlZddlZddlZddlZddlmZ ddl Z ddl
Z
g Z d� Zd� Z
d� Zd� Zd� Zd � Zd
� Zd� ZdS )z
Monkey patching of distutils.
� N)�
import_modulec �n � t j � � dk r| f| j z S t j | � � S )am
Returns the bases classes for cls sorted by the MRO.
Works around an issue on Jython where inspect.getmro will not return all
base classes if multiple classes share the same name. Instead, this
function will return a tuple containing the class itself, and the contents
of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024.
�Jython)�platform�python_implementation� __bases__�inspect�getmro)�clss ��/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/monkey.py�_get_mror
s7 � � �%�'�'�8�3�3��v��
�%�%��>�#���� c � � t | t � � rt n#t | t j � � rt
nd� } || � � S )Nc � � d S )N� )�items r �<lambda>zget_unpatched.<locals>.<lambda>( s � �T� r )�
isinstance�type�get_unpatched_class�types�FunctionType�get_unpatched_function)r �lookups r �
get_unpatchedr $ sP � �)�$��5�5� ���",�T�5�3E�"F�"F� ����� �
�6�$�<�<�r c � � d� t | � � D � � }t |� � }|j � d� � sd| z }t |� � �|S )z�Protect against re-patching the distutils if reloaded
Also ensures that no other distutils extension monkeypatched the distutils
first.
c 3 �N K � | ] }|j � d � � �|V � �!dS )�
setuptoolsN)�
__module__�
startswith)�.0r s r � <genexpr>z&get_unpatched_class.<locals>.<genexpr>3 sL � � � � � ���~�(�(��6�6���� � � � � r � distutilsz(distutils has already been patched by %r)r
�nextr r �AssertionError)r �external_bases�base�msgs r r r - sj � �� ��C�=�=�� � �N�
����D��?�%�%�k�2�2� "�8�3�>���S�!�!�!��Kr c �� � t j t j _ t j dk } | rt j t j _ dt j cxk odk nc pdt j cxk odk nc }|rd}|t j j _
t � � t j t j t j
fD ]}t j j |_ �t j j t j _ t j j t j _ dt j v r&t j j t j d _ t% � � d S )N)� � r* )r* � )r* r, � )r* r+ zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)r �Commandr# �core�sys�version_info�findall�filelist�config�
PyPIRCCommand�DEFAULT_REPOSITORY�_patch_distribution_metadata�dist�cmd�Distribution� extension� Extension�modules�#patch_for_msvc_specialized_compiler)�has_issue_12885�needs_warehouse� warehouse�modules r � patch_allrC ? s7 � �'�/�I�N���&�)�3�O�� 8�%/�%7� ��"� ��!�-�-�-�-�I�-�-�-�-� /���!�.�.�.�.�Y�.�.�.�.� � � F�5� �<E� ��&�9� �"�"�"� �.�)�.�)�-�?� ;� ;��(�o�:���� *�3�=�I�N��$.�$8�$B�I��!�$���3�3�� �*� ��1�2�<� (�)�)�)�)�)r c � � dD ]<} t t j | � � }t t j j | |� � �=dS )zDPatch write_pkg_file and read_pkg_file for higher metadata standards)�write_pkg_file�
read_pkg_file�get_metadata_versionN)�getattrr r8 �setattrr# �DistributionMetadata)�attr�new_vals r r7 r7 d sJ � �K� D� D���*�/�4�0�0��� ��3�T�7�C�C�C�C�D� Dr c � � t ||� � }t | � � � d|� � t ||| � � dS )z�
Patch func_name in target_mod with replacement
Important - original must be resolved by name to avoid
patching an already patched function.
� unpatchedN)rH �vars�
setdefaultrI )�replacement�
target_mod� func_name�originals r �
patch_funcrU k sM � � �z�9�-�-�H� ���� � ��h�7�7�7� �J� �;�/�/�/�/�/r c �"