� ,�Red���ddlmZddlmZddlmZmZddlZddlZddl Z ddl Z ddl m Z ddl mZddl Z Gd�deje ��ZGd �d ��ZdS) �)� convert_path)�log)�DistutilsError�DistutilsOptionErrorN)� easy_install)� namespacesc��eZdZdZdZejddgzZejdgzZdZd�Z d�Z d �Z e d ���Z d �Zd �Zd �Zd�ZdS)�developzSet up package for developmentz%install package in 'development mode')� uninstall�uzUninstall this source package)z egg-path=Nz-Set the path to be used in the .egg-link filer Fc���|jr0d|_|���|���n|���|���dS)NT)r � multi_version�uninstall_link�uninstall_namespaces�install_for_development�warn_deprecated_options��selfs ��/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/develop.py�runz develop.runse�� �>� +�!%�D� � � � � !� !� !� � %� %� '� '� '� '� � (� (� *� *� *� �$�$�&�&�&�&�&�c�f�d|_d|_tj|��d|_d|_dS)N�.)r �egg_pathr�initialize_options� setup_path�always_copy_fromrs rrzdevelop.initialize_options%s6������� ��'��-�-�-���� #����rc �(�|�d��}|jr"d}|j|jf}t||z���|jg|_t j|��|���|� ��|j � tj d����|jdz}tj�|j|��|_|j|_|j�)tj�|j��|_t+j|j��}t+jtj�|j|j����}||krt/d|z���t+j|t+j|tj�|j����|j���|_|�|j|j|j��|_dS)N�egg_infoz-Please rename %r to %r before using 'develop'z*.eggz .egg-linkzA--egg-path must be a relative path from the install directory to �� project_name)�get_finalized_command�broken_egg_inforr�egg_name�argsr�finalize_options�expand_basedirs� expand_dirs� package_index�scan�glob�os�path�join� install_dir�egg_link�egg_baser�abspath� pkg_resources�normalize_pathr� Distribution� PathMetadata�dist�_resolve_setup_pathr)r�ei�templater%� egg_link_fn�targetrs rr&zdevelop.finalize_options,s��� � '� '� � 3� 3�� � � 2�F�H��;�� 2�2�D� ��D��1�1� 1��[�M�� ��%�d�+�+�+� ������ ������ ����� �'� 2� 2�3�3�3��k�K�/� ��� � �T�%5�{�C�C�� �� �� � �=� ��G�O�O�B�K�8�8�D�M��-�d�m�<�<�� �/� �G�L�L��)�4�=� 9� 9� � �� �v� � �&�!�#)�*��� � "�.� � � &�v�r�w���r�{�/K�/K� L� L��� � � �� � �2�2� �M� � � �M� � ����rc���|�tjd���d��}|tjkrd|�d��dzz}t jtj� |||����}|t jtj��kr-td|t jtj�����|S)z� Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. �/z../�zGCan't get a consistent path to setup script from installation directory) �replacer,�sep�rstrip�curdir�countr3r4r-r.r)r1r/r� path_to_setup�resolveds rr8zdevelop._resolve_setup_pathWs���!�(�(����5�5�<�<�S�A�A� � �B�I� %� %�!�]�%8�%8��%=�%=��%A�B�M� �/� �G�L�L��h� � >� >� � �� �}�3�B�I�>�>� >� >�&�*���,�R�Y�7�7� �� � �rc�T�|�d��|�dd���|�d��tjr+|�tj��dt_|���t jd|j|j ��|j sRt|jd��5}|� |j dz|jz��ddd��n #1swxYwY|�d|j|j ��dS)Nr� build_extr?)�inplacezCreating %s (link to %s)�w� )� run_command�reinitialize_command� setuptools�bootstrap_install_fromr�install_namespacesr�infor0r1�dry_run�open�writerr�process_distributionr7�no_deps)r�fs rrzdevelop.install_for_developmentmsb�� ����$�$�$� �!�!�+�q�!�9�9�9� ����%�%�%� � ,� 5� � � �j�?� @� @� @�04�J� -� ���!�!�!� ��+�T�]�D�M�J�J�J��|� @��d�m�S�)�)� @�Q����� ��,�t��>�?�?�?� @� @� @� @� @� @� @� @� @� @� @���� @� @� @� @� �!�!�$�� �t�|�3C�D�D�D�D�Ds� &C;�;C?�C?c��tj�|j��r�t jd|j|j��t|j��}d�|D��}|���||j g|j |j gfvrt j d|��dS|j stj |j��|j s|�|j��|jjrt j d��dSdS)NzRemoving %s (link to %s)c�6�g|]}|�����S�)rB)�.0�lines r� z*develop.uninstall_link..�s ��@�@�@�$�� � � � �@�@�@rz$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r,r-�existsr0rrQr1rS�closerr�warnrR�unlink� update_pthr7� distribution�scripts)r� egg_link_file�contentss rrzdevelop.uninstall_link�s�� �7�>�>�$�-� (� (� )� �H�/���� � N� N� N� ���/�/�M�@�@�-�@�@�@�H� � � � !� !� !�����$�-���1Q�R�R�R���?��J�J�J����<� )�� �$�-�(�(�(��|� '� �O�O�D�I� &� &� &� � � $� N� �H�L� M� M� M� M� M� N� Nrc���||jurtj||��S|�|��|jjpgD]�}t j�t|����}t j� |��}tj |��5}|� ��}ddd��n #1swxYwY|�||||����dS�N)r7r�install_egg_scripts�install_wrapper_scriptsrcrdr,r-r2r�basename�iorS�read�install_script)rr7� script_name� script_path�strm� script_texts rrizdevelop.install_egg_scripts�s�� �t�y� � ��3�D�$�?�?� ?� �$�$�T�*�*�*� �,�4�:�� M� M�K��'�/�/�,�{�*C�*C�D�D�K��'�*�*�;�7�7�K����%�%� *��"�i�i�k�k� � *� *� *� *� *� *� *� *� *� *� *���� *� *� *� *� � � ��k�;� � L� L� L� L�  M� Ms�#C�C � C c�J�t|��}tj||��Srh)�VersionlessRequirementrrj�rr7s rrjzdevelop.install_wrapper_scripts�s"��%�d�+�+���3�D�$�?�?�?rN)�__name__� __module__� __qualname__�__doc__� descriptionr� user_options�boolean_options�command_consumes_argumentsrrr&� staticmethodr8rrrirjrZrrr r s�������(�(�9�K��,�;�L�0��L� #�2�k�]�B�O�!&��'�'�'�$�$�$�) �) �) �V����\��*E�E�E�,N�N�N�"M�M�M�$@�@�@�@�@rr c�$�eZdZdZd�Zd�Zd�ZdS)rta� Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' c��||_dSrh)�_VersionlessRequirement__distrus r�__init__zVersionlessRequirement.__init__�s ���� � � rc�,�t|j|��Srh)�getattrr�)r�names r� __getattr__z"VersionlessRequirement.__getattr__�s���t�{�D�)�)�)rc��|jSrhr rs r�as_requirementz%VersionlessRequirement.as_requirement�s ��� � rN)rvrwrxryr�r�r�rZrrrtrt�sK������ � ����*�*�*�!�!�!�!�!rrt)�distutils.utilr� distutilsr�distutils.errorsrrr,r+rlr3�setuptools.command.easy_installrrNr�DevelopInstallerr rtrZrr�r�s ��'�'�'�'�'�'�������A�A�A�A�A�A�A�A� � � � � � � � � � � � �����8�8�8�8�8�8�!�!�!�!�!�!�����Z@�Z@�Z@�Z@�Z@�j�)�<�Z@�Z@�Z@�z!�!�!�!�!�!�!�!�!�!r