�
,�Re�y �
�� � d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl
mZ ddlm
Z
ddlmZ ddlmZ ddlmZ dd lmZmZmZmZmZmZmZmZmZmZ dd
lm Z m!Z!m"Z"m#Z# ddl$m%Z& ddl'm(Z( dd
l)m*Z* erddl+m,Z, ej- dk rddlm.Z. nerddl/m.Z. nddl0m1Z. ee2ef Z3 ede3�� � Z4 ej5 e6� � Z7 G d� de� � Z8dZ9dZ: G d� de � � Z; G d� de.� � Z< G d� d� � Z= G d� de=� � Z> G d � d!� � Z?d"ed#e@fd$�ZAd%ee2 d&ee2e2f d'ed#e@fd(�ZBd)� ZCd*e*d#ee2 fd+�ZDd*e*d#ee2 fd,�ZEd%ee2 d&ee2e2f d-e3d#ee2e2f fd.�ZFd/e3d#e2fd0�ZGd1ee2e2f d#ee2 fd2�ZHd%ee2 d1ee2e2f d#eee2ee2 f fd3�ZId1ee2e2f d#ee2e2f fd4�ZJd5e2d6e2d7e2d8e2d#e@f
d9�ZKd:e3d#e2fd;�ZLde2d#e2fd?�ZN G d@� dAe#jO � � ZPdBZQd>e2dCee2e2f dDee2ee2 f d#e2fdE�ZR G dF� dGeS� � ZT G dH� dIe"jU � � ZVdS )Ja�
Create a wheel that, when installed, will make the source package 'editable'
(add it to the interpreter's path, including metadata) per PEP 660. Replaces
'setup.py develop'.
.. note::
One of the mechanisms briefly mentioned in PEP 660 to implement editable installs is
to create a separated directory inside ``build`` and use a .pth file to point to that
directory. In the context of this file such directory is referred as
*auxiliary build directory* or ``auxiliary_dir``.
� N)�suppress)�Enum)�cleandoc)�chain)�Path)�TemporaryDirectory)
�
TYPE_CHECKING�Dict�Iterable�Iterator�List�Mapping�Optional�Tuple�TypeVar�Union)�Command�SetuptoolsDeprecationWarning�errors�
namespaces)�build_py��find_package_path)�Distribution�� WheelFile)� � )�Protocol)�ABC�_P)�boundc �J � e Zd ZdZdZdZdZedee dd fd�� � Z
dS ) �
_EditableModea
Possible editable installation modes:
`lenient` (new files automatically added to the package - DEFAULT);
`strict` (requires a new installation when files are added/removed); or
`compat` (attempts to emulate `python setup.py develop` - DEPRECATED).
�strict�lenient�compat�mode�returnc �� � |st j S |� � � }|t j vrt j d|�d�� � �|dk rd}t
j |t � � t | S )NzInvalid editable mode: z. Try: 'strict'.�COMPATax
The 'compat' editable mode is transitional and will be removed
in future versions of `setuptools`.
Please adapt your code accordingly to use either the 'strict' or the
'lenient' modes.
For more information, please check:
https://setuptools.pypa.io/en/latest/userguide/development_mode.html
) r$ �LENIENT�upper�__members__r �OptionError�warnings�warnr )�clsr( �_mode�msgs ��/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/editable_wheel.py�convertz_EditableMode.convertG s} � �� )� �(�(��
�
�����
�1�1�1��$�%W�t�%W�%W�%W�X�X�X��H����C�
�M�#�;�<�<�<��U�#�#� N)�__name__�
__module__�__qualname__�__doc__�STRICTr, r+ �classmethodr �strr6 � r7 r5 r$ r$ ; s_ � � � � � �� � �F��G�
�F��$�8�C�=� $�_� $� $� $� �[�$� $� $r7 r$ zU
New or renamed files may not be automatically picked up without a new installation.
zt
Options like `package-data`, `include/exclude-package-data` or
`packages.find.exclude/include` may have no effect.
c �V � e Zd ZdZdZdddd eej pd� � fgZd� Zd � Z d
� Z
d� Zd� Zd
e
e fd�Zdedededefd�Zd� Zd
eee eeef f fd�Zdedededed
eee eeef f f
d�Zd� Zdefd�Zd� Zdefd�Zdededed
dfd �ZdS )!�editable_wheelzkBuild 'editable' wheel for development.
(This command is reserved for internal use of setuptools).
z!create a PEP 660 'editable' wheel)z dist-dir=�dz-directory to put final built distributions in)zdist-info-dir=�Iz(path to a pre-build .dist-info directoryzmode=N� c �> � d | _ d | _ d | _ d | _ d S �N)�dist_dir�
dist_info_dir�project_dirr( ��selfs r5 �initialize_optionsz!editable_wheel.initialize_optionsv s$ � ���
�!�������� � � r7 c �� � | j }|j pt j | _ |j pi | _ t
| j p$t j � | j d� � � � | _ d S )N�dist)
�distribution�src_root�os�curdirrI �package_dirr rG �path�join)rK rN s r5 �finalize_optionszeditable_wheel.finalize_options| sX � �� ���=�5�B�I����+�1�r����T�]�T�b�g�l�l�4�;K�V�.T�.T�U�U��
�
�
r7 c � � | j � d�� � | � � � | � d� � | � d� � }|� | j � � | � |� � d S # t $ r<}t j
� � d}t j t |� � � � |�d }~ww xY w)NT)�exist_ok�bdist_wheela�
Support for editable installs via PEP 660 was recently introduced
in `setuptools`. If you are seeing this error, please report to:
https://github.com/pypa/setuptools/issues
Meanwhile you can try the legacy behavior by setting an
environment variable and trying to install again:
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
)rG �mkdir�_ensure_dist_info�reinitialize_command�get_finalized_command�write_wheelfilerH �_create_wheel_file� Exception� traceback� print_excr �
InternalErrorr )rK rY �exr4 s r5 �runzeditable_wheel.run� s� � � >��M�����.�.�.��"�"�$�$�$�
�%�%�m�4�4�4��4�4�]�C�C�K��'�'��(:�;�;�;��#�#�K�0�0�0�0�0���
>�
>�
>���!�!�!�
�C� �&�x��}�}�5�5�2�=�����
>���s �BB �
C�7C
�
Cc �f � | j �W| � d� � }| j |_ |� � � |� � � |j | _ d S t
| j � � � d� � sJ �t | j d� � � � � sJ �d S )N� dist_infoz
.dist-info�METADATA)
rH r\ rG �
output_dir�ensure_finalizedre r> �endswithr �exists)rK rg s r5 r[ z editable_wheel._ensure_dist_info� s� � ���%��1�1�+�>�>�I�#'�=�I� ��&�&�(�(�(��M�M�O�O�O�!*�!8�D�����t�)�*�*�3�3�L�A�A�A�A�A���*�J�7�7�>�>�@�@�@�@�@�@�@r7 c �� � | j }|j sd S t | j | j � dd� � � � � � � }t ||||� � }|� � � d S )NrD �.) rO �namespace_packagesr rI rS �get�resolve�_NamespaceInstaller�install_namespaces)rK �installation_dir�
pth_prefixrN rP � installers r5 �_install_namespacesz"editable_wheel._install_namespaces� sw � �� ���&� ��F���(�$�*:�*>�*>�r�3�*G�*G�H�H�P�P�R�R��'��.>�
�H�U�U� ��$�$�&�&�&�&�&r7