� ,�Re�N���dZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&Z&dd l&m'Z'dd l(m)Z)dd l(m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2m3Z3m4Z4ddl-m5Z5m6Z6ddl7m8Z8ddl9m:Z:m;Z;mZ>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFdd l9Z9ddlGmHZHddlImJZJejKde9jL���gd�ZMd�ZNd�ZOd�ZPd�ZQGd�d e*��ZRd!�ZSd"�ZTd#�ZUd$�ZVd%�ZWGd&�d'e>��ZXGd(�d)eX��ZYejZ�[d*d+��d,kreYZXd-�Z\d.�Z]d/�Z^d0�Z_dPd1�Z`d2�Zad3�Zbd4ejcvrebZdnd5�ZddQd7�Zed8�Zfd9�Zgd:�Zh dd;lmiZjn#ek$rd<�ZjYnwxYwd=�ZiGd>�d?el��Zmem�n��ZoGd@�dAem��ZpGdB�dC��ZqGdD�dEeq��ZrGdF�dGer��ZseqjtZteqjuZudH�ZvdI�ZwdJe]fdK�ZxdL�ZydM�ZzGdN�dOe)��Z{d S)Ra) Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.pypa.io/en/latest/deprecated/easy_install.html �)�glob)� get_platform)� convert_path� subst_vars)�DistutilsArgError�DistutilsOptionError�DistutilsError�DistutilsPlatformError)�log�dir_util)� first_line_re)�find_executable)�installN)�get_path)�SetuptoolsDeprecationWarning)�Command)� run_setup)�setopt)�unpack_archive)� PackageIndex�parse_requirement_arg� URL_SCHEME)� bdist_egg�egg_info)�Wheel) �normalize_path�resource_string�get_distribution�find_distributions� Environment� Requirement� Distribution� PathMetadata� EggMetadata� WorkingSet�DistributionNotFound�VersionConflict� DEVELOP_DIST�)�ensure_directory)� yield_lines�default)�category)� easy_install�PthDistributions�extract_wininst_cfg�get_exe_prefixesc�2�tjd��dkS)N�P�)�struct�calcsize����/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/easy_install.py�is_64bitr:Ns�� �?�3� � �1� $�$r8c�,�|�d��S)N�utf8)�encode��ss r9� _to_bytesr@Rs�� �8�8�F� � �r8c�T� |�d��dS#t$rYdSwxYw)N�asciiTF)r=� UnicodeErrorr>s r9�isasciirDVs@��� ��������t�� �����u�u����s �� '�'c�v�tj|������dd��S)N� z; )�textwrap�dedent�strip�replace)�texts r9� _one_linerrL^s.�� �?�4� � � &� &� (� (� 0� 0��t� <� <��Z1d?�Z2dcd@�Z3edA���Z4dddD�Z5dE�Z6dF�Z7dG�Z8dH�Z9dI�Z:dJ�Z;ejdK�����Z<ejdL��Z=dedN�Z>ejdO�����Z?dP�Z@dQ�ZAdR�ZBdS�ZCdT�ZDdU�ZEdV�ZFdW�ZGejdX���H��ZIdY�ZJeKeKdZd[�\���]��ZLeKd^d_�\��ZMd`�ZNdS)fr.z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)�zip-ok�zzinstall package as a zipfile)� multi-version�mz%make apps have to require() a version)�upgrade�Uz1force upgrade (searches PyPI for latest versions))z install-dir=�dzinstall package to DIR)z script-dir=r?zinstall scripts to DIR)�exclude-scripts�xzDon't install scripts)� always-copy�az'Copy all needed packages to install dir)z index-url=�iz base URL of Python Package Index)z find-links=�fz(additional URL(s) to search for packages)zbuild-directory=�bz/download/extract/build in DIR; keep the results)z optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files)� always-unzip�Zz*don't install as a zipfile, no matter what)z site-dirs=�Sz)list of directories where .pth files work)�editable�ez+Install specified packages in editable form)�no-deps�Nzdon't install dependencies)z allow-hosts=�Hz$pattern(s) that hostnames must match)�local-snapshots-ok�lz(allow building eggs from local checkouts)�versionNz"print version information and exit)z no-find-linksNz9Don't load find-links defined in packages being installed�userNz!install in user site-package '%s') rNrPrUrRrWr`rbrergrhr]rNc� �tjdt��d|_dx|_|_dx|_x|_|_d|_ d|_ d|_ d|_ dx|_ |_dx|_x|_|_dx|_x|_|_dx|_x|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ tBj"|_#tBj$|_%d|_&d|_'dx|_(|_)d|_*i|_+d|_,|j-j.|_.|j-�/||j-�0d����dS)NzVeasy_install command is deprecated. Use build and pip and other standards-based tools.rr.)1�warnings�warn�EasyInstallDeprecationWarningrh�zip_ok�local_snapshots_ok� install_dir� script_dir�exclude_scripts� index_url� find_links�build_directory�args�optimize�recordrR� always_copy� multi_versionr`�no_deps� allow_hosts�root�prefix� no_reportrg�install_purelib�install_platlib�install_headers� install_lib�install_scripts� install_data� install_base�install_platbase�site� USER_BASE�install_userbase� USER_SITE�install_usersite� no_find_links� package_index�pth_file�always_copy_from� site_dirs�installed_projects�_dry_run� distribution�verbose�_set_command_options�get_option_dict��selfs r9�initialize_optionszeasy_install.initialize_options�s���� � A� )� � � ��� �04�4�� �d�-�DH�H���H�4�?�T�-A�������#����� �&*�*�� �� �?C�C�� �C�t�'�$�*<�:>�>�� �>�� �t�'7�37�7�� �7�D�K�$�.��� �#���#���#������#��� ��� ��� $��� $���� $����!���"���04�4�� ��-����"$��� �� ��(�0�� � ��.�.� �$�#�3�3�N�C�C� � � � � r8c�b�d�|D��}tt|j|����dS)Nc3�K�|]D}tj�|��stj�|���@|V��EdS�N)�os�path�exists�islink)�.0�filenames r9� z/easy_install.delete_blockers..�s`���� � �!��w�~�~�h�'�'� �+-�7�>�>�(�+C�+C� � � � � � � � r8)�list�map� _delete_path)r��blockers�extant_blockerss r9�delete_blockerszeasy_install.delete_blockers�sC�� � �%-� � � �� �S��"�O� 4� 4�5�5�5�5�5r8c��tjd|��|jrdStj�|��otj�|�� }|rtn tj}||��dS)Nz Deleting %s) r �info�dry_runr�r��isdirr��rmtree�unlink)r�r��is_tree�removers r9r�zeasy_install._delete_path�sm�� ����%�%�%� �<� � �F��'�-�-��%�%�B�b�g�n�n�T�.B�.B�*B��#�2�&�&������� � � � � r8c��djtj�}td��}d}t |jdit ������t ���)zT Render the Setuptools version and installation details, then exit. �{}.{}� setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})Nr7)�format�sys� version_infor�print�locals� SystemExit)�ver�dist�tmpls r9�_render_versionzeasy_install._render_version�sU�� �g�n�c�.�/��� �-�-��N�� �k�d�k�%�%�F�H�H�%�%�&�&�&��l�l�r8c�L �|jo|���tj���d}t t j����|_|j�|j � ��|j � ��|j � ��|tj j�dtj j��tj j�tj j��|jd|jdt!tdd��t!tdd��d � ��t#jt&��5|j�t)j�����t)j��d ���ddd��n #1swxYwY|j�d t!td d���dd����|j|jd <|j|jd<|jr t8jst=jd��|� ��|�!��|�"��|�#dddd��|j$� |j%|_$|j&�d|_&|�'dd��|�'dd��|jr|j(r|j(|_%|j)|_$|�'dd��tU��|_+|j+�,|�-|j.����|j/s|�0��tcj2dd��}|j3p||_3|j+dd�|_4|j%tk|j$��fD]&}||j4vr|j4�6d|���'|j7�%d�|j7�d��D��}ndg}|j8�'|�9|j3|j4|� ��|_8tu|j4tj;z��|_<|j=�9t}|j=t~��r|j=���|_=ng|_=|j@r,|j8�A|j4tj;z��|j&s|j8�B|j=��|�'dd!��|�C|jD��|_D|j/r|jEst�d"���|jGst�d#���g|_HdS)$Nr�.r}� exec_prefix�abiflags�� platlibdir�lib) � dist_name� dist_version� dist_fullname� py_version�py_version_short�py_version_nodot� sys_prefix�sys_exec_prefixr�r�)�implementation_lower�implementation�py_version_nodot_plat�windir�userbase�usersitez6WARNING: The user site-packages directory is disabled.rorprtr�Fr�)roror��rorpr)rwrw�__EASYINSTALL_INDEXzhttps://pypi.org/simple/c�6�g|]}|�����Sr7)rI�r�r?s r9� z1easy_install.finalize_options..0s ��D�D�D�1�Q�W�W�Y�Y�D�D�Dr8�,�*)� search_path�hosts)rvrvz9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))Irgr�r��split�dict� sysconfig�get_config_vars� config_vars�updater��get_name� get_version� get_fullnamer��major�minor�getattr� contextlib�suppress�AttributeErrorr�_get_implementation�lower� setdefaultrJr�r�rhr��ENABLE_USER_SITEr rk�_fix_install_dir_for_user_site�expand_basedirs� expand_dirs�_expandrpror��set_undefined_optionsrr�� get_site_dirs� all_site_dirs�extend�_process_site_dirsr�r`�check_site_dirr��getenvrr� shadow_pathr�insertr{r�� create_indexr r�� local_indexrs� isinstance�strrn�scan_egg_links�add_find_links�_validate_optimizervrtrru�outputs)r�r�� default_index� path_itemr�s r9�finalize_optionszeasy_install.finalize_options�s��� � �/��-�-�/�/���[�&�&�(�(��+� �� � 9� ;� ;�<�<��� �����*�3�3�5�5� �-�9�9�;�;�!�.�;�;�=�=�$�#&�#3�#9� T� T�C����Z��4�4�!�#�|�U�;�;� ! � ! � � � �� �� 0� 0� � � � � #� #�(/�(C�(E�(E�(K�(K�(M�(M�")�"=�"?�"?�%�%� � � � � � � � � � � � � � ���� � � � � ��#�#� #� �C��2� &� &� .� .�s�B� 7� 7� � � � (,�'<����$�'+�'<����$� �9� O�T�2� O� �H�M� N� N� N� �+�+�-�-�-� ������ ������ � � � �<�):� � � � � �?� "�"�.�D�O� � � %�!&�D� � �"�"� �9� � � � �"�"� �<� � � � �9� 3��-� 3�#�3�D� �"�2�D�O� �"�"�9�.B�C�C�C�*�_�_��� ��!�!�$�"9�"9�$�.�"I�"I�J�J�J��}� "� � � � !� !� !�� �"7�9S�T�T� ���8�=����-�a�a�a�0����)�>�$�/�+J�+J�J� 6� 6�I��� 0�0�0�� �'�'��9�5�5�5�� � � '�D�D��(8�(>�(>�s�(C�(C�D�D�D�E�E��E�E� � � %�!%�!2�!2���D�,<�E�"3�"�"�D� �'�t�'7�#�(�'B�C�C��� �?� &��$�/�3�/�/� :�"&�/�"7�"7�"9�"9���� �D�O� � "� K� � � -� -�d�.>���.I� J� J� J��!� ?� � � -� -�d�o� >� >� >� �"�"�=�2J�K�K�K��/�/�� �>�>�� � �=� ��!5� �#�K��� ��y� N�#�L�N�N� N��� � � s�+AG � G �G c#�jK�|�dStttj��}d�|�d��D��}|D]k}t j�|��stjd|���7t|��|vrt|dz���t|��V��ldS)Nc�p�g|]3}tj�|�������4Sr7)r�r�� expanduserrIr�s r9r�z3easy_install._process_site_dirs..Us=�� � � �./�B�G� � �q�w�w�y�y� )� )� � � r8r�z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.path) r�rr�r�r�r�r�r rkr)r��normpathrTs r9r�zeasy_install._process_site_dirsOs����� � � �F��~�s�x�0�0�� � � �O�O�C� � � � � � �� (� (�A��7�=�=��#�#� (���=�q�A�A�A�A���"�"�(�2�2�*��>�>����%�Q�'�'�'�'�'�'� (� (r8c�� t|��}|td��vrt�n"#t$r}td��|�d}~wwxYw|S)N�z--optimize must be 0, 1, or 2)�int�range� ValueErrorr)�valueras r9rzeasy_install._validate_optimizecsl�� ���J�J�E��E�!�H�H�$�$� � �%��� � � �&�/���� ����� ���� � s�'*� A �A�A c���|jsdS|���|j�d}t|���|jx|_|_t j�d�}|�|��dS)z; Fix the install_dir if "--user" was used. Nz$User base directory is not specified�_user) rh�create_home_pathr�r r�r�r��name� select_scheme)r��msg� scheme_names r9r�z+easy_install._fix_install_dir_for_user_siteps~���y� � �F� ������ � � (�8�C�(��-�-� -�48�4I�I���D�1���'�'�'� � ���;�'�'�'�'�'r8c���|D]y}t||��}|�etjdkstjdkrtj�|��}t ||j��}t|||���zdS)N�posix�nt)r�r�rr�r rr��setattr)r��attrs�attr�vals r9� _expand_attrszeasy_install._expand_attrss���� )� )�D��$��%�%�C����7�g�%�%���D����'�,�,�S�1�1�C� ��d�&6�7�7����d�C�(�(�(��  )� )r8c�4�|�gd���dS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.)r�r�r|N�r r�s r9r�zeasy_install.expand_basedirs�s%�� ���G�G�G�H�H�H�H�Hr8c�8�gd�}|�|��dS)z+Calls `os.path.expanduser` on install dirs.)rr�r�r�r�r�Nr")r��dirss r9r�zeasy_install.expand_dirs�s/�� � � �� ���4� � � � � r8c��|r |�dtj��|j|jjkrtj|j�� |jD]}|�||j ���|j r�|j }|j rFt|j ��}tt|����D]}|||d�||<�ddlm}|�|j|j |fd|j z��|���tj|jj��dS#tj|jj��wxYw)NzXWARNING: The easy_install command is deprecated and will be removed in a future version.r)� file_utilz'writing list of installed files to '%s')�announcer �WARNr�r�� set_verbosityrur.rzrwrr|�lenr� distutilsr&�execute� write_file�warn_deprecated_options)r��show_deprecation�specr�root_len�counterr&s r9�runzeasy_install.run�s{�� � � �M�M�;��� � � � �<�4�,�4� 4� 4� � �d�l� +� +� +� 9�� � :� :���!�!�$�D�L�(8�9�9�9�9��{� ��,���9�G�"�4�9�~�~�H�#(��W���#6�#6�G�G��+2�7�+;�H�I�I�+F���(�(�/�/�/�/�/�/�� � ��(�4�;��*@�=��K� ���� � (� (� *� *� *� � �d�/�7� 8� 8� 8� 8� 8��C� �d�/�7� 8� 8� 8� 8���s �CD8�8 Ec��� tj��}n/#t$r"tjdt j��}YnwxYwtj�|j d|z��S)z�Return a pseudo-tempname base in the install directory. This code is intentionally naive; if a malicious party can write to the target directory you're already in deep doodoo. rztest-easy-install-%s) r��getpid� Exception�random�randintr��maxsizer��joinro)r��pids r9�pseudo_tempnamezeasy_install.pseudo_tempname�se��  1��)�+�+�C�C��� 1� 1� 1��.��C�K�0�0�C�C�C� 1�����w�|�|�D�,�.D�s�.J�K�K�Ks��)A�Ac��dSr�r7r�s r9r.z$easy_install.warn_deprecated_options���� �r8c�*�t|j��}tj�|d��}tj�|��sA tj|��n+#ttf$r|� ��YnwxYw||j v}|s|j s|� ��}n�|� ��dz}tj�|��} |rtj|��t|d�����tj|��n+#ttf$r|� ��YnwxYw|sG|j s@tj�dd��}t'j|j|j|��|r"|j�t/||j ��|_nd|_|j r&tj�|��sd|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if needed�easy-install.pthz .write-test�w� PYTHONPATHr�N)rror�r�r:r��makedirs�OSError�IOError�cant_write_to_targetr�ry�check_pth_processingr<r��open�close�environ�getr rk�_easy_install__no_default_msgr�r/)r��instdirr�� is_site_dir�testfile� test_exists� pythonpaths r9r�zeasy_install.check_site_dir�s��!��!1�2�2���7�<�<��);�<�<���w�~�~�g�&�&� ,� ,�� �G�$�$�$�$���W�%� ,� ,� ,��)�)�+�+�+�+�+� ,������!3�3� �� ,�4�#5� ,��3�3�5�5�K�K��+�+�-�-� �=�H��'�.�.��2�2�K� ,��(��I�h�'�'�'��X�s�#�#�)�)�+�+�+�� �(�#�#�#�#���W�%� ,� ,� ,��)�)�+�+�+�+�+� ,����� J�4�#5� J����� �b�9�9�J� �H�T�*�D�,<�j� I� I� I� � !��}�$� 0��4�;M� N� N�� �� �D�M� � � !�b�g�n�n�X�&>�&>� !� �D�M�"����s%�A*�*%B�B�3A E�%E(�'E(aS can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: %s The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s z� This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). a� Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.pypa.io/en/latest/deprecated/easy_install.html Please make the appropriate changes for your system and try again. c���|jtj��d|jfz}tj�|j��s|d|jzz }n |d|jzz }t|���)N�rF) �_easy_install__cant_write_msgr��exc_inforor�r�r��_easy_install__not_exists_id�_easy_install__access_msgr )r�rs r9rFz!easy_install.cant_write_to_targetso���#�s�|�~�~�a�'8�$�:J�&L�L���w�~�~�d�.�/�/� ,� �4�$�.�.� .�C�C� �4�$�+�+� +�C��S�!�!�!r8c�l�|j}tjd|��|���dz}|dz}tj�|��}td��dz} |rt j|��tj� |��}t j |d���t|d��} |� |j dit������|���d }t j}tjd kr}tj�|��\}} tj�|d ��} | ���d kotj�| ��} | r| }d dlm} | |dddgd ��tj�|��r�tjd|�� |r|���tj�|��rt j|��tj�|��rt j|��dSdS |r|���tj�|��rt j|��tj�|��rt j|��n�#|r|���tj�|��rt j|��tj�|��rt j|��wwxYw#t0t2f$r|���YnwxYw|jstjd|��dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %s�.pthz.okzz import os f = open({ok_file!r}, 'w') f.write('OK') f.close() rFT)�exist_okrANr� pythonw.exe� python.exer)�spawnz-Ez-c�passz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesFr7)ror r�r<r�r�r�rLr��dirnamerCrH�writer�r�rIr�� executablerr�r:r��distutils.spawnr]rDrErFryrk) r�rMr��ok_file� ok_existsr�r_rZra�basename�alt�use_altr]s r9rGz!easy_install.check_pth_processings����"�� ��3�W�=�=�=��'�'�)�)�F�2���U�"���G�N�N�7�+�+� ����� � �� ) (�� #�� �'�"�"�"��g�o�o�g�.�.�G� �K��$� /� /� /� /��X�s�#�#�A� (���� �� �/�/�f�h�h�/�/�0�0�0���� � � ��� �^� ��7�d�?�?�(*�� � �j�(A�(A�%�G�X��'�,�,�w� �>�>�C� ���(�(�L�8�,�����s�+�+���)�%(� �1�1�1�1�1�1���z�4��v�6��:�:�:��7�>�>�'�*�*� ��H�G����� ����G�G�I�I�I��7�>�>�'�*�*�'��I�g�&�&�&��7�>�>�(�+�+�(��I�h�'�'�'�'�'�(�(� ����G�G�I�I�I��7�>�>�'�*�*�'��I�g�&�&�&��7�>�>�(�+�+�(��I�h�'�'�'��� ���G�G�I�I�I��7�>�>�'�*�*�'��I�g�&�&�&��7�>�>�(�+�+�(��I�h�'�'�'�'�(�����E��!� (� (� (� � %� %� '� '� '� '� '� (����H�!� M� �H�B�G� L� L� L��us!�+AM-�D%K+�+A?M*�-%N�Nc �$�|jss|�d��r^|�d��D]H}|�d|z��r�|�|||�d|z�����I|�|��dS)z=Write all the scripts for `dist`, unless scripts are excluded�scriptszscripts/N)rq�metadata_isdir�metadata_listdir�install_script� get_metadata�install_wrapper_scripts)r�r�� script_names r9�install_egg_scriptsz easy_install.install_egg_scriptsYs����#� ��(;�(;�I�(F�(F� �#�4�4�Y�?�?� � � ��&�&�z�K�'?�@�@����#�#��+��%�%�j�;�&>�?�?����� �$�$�T�*�*�*�*�*r8c�,�tj�|��rZtj|��D]C\}}}|D]:}|j�tj�||�����;�DdS|j�|��dSr�)r�r�r��walkr�appendr:)r�r��baser$�filesr�s r9� add_outputzeasy_install.add_outputgs��� �7�=�=�� � � &�%'�W�T�]�]� F� F�!��d�E� %�F�F�H��L�'�'��� � �T�8�(D�(D�E�E�E�E�F� F� F� �L� � �� %� %� %� %� %r8c�:�|jrtd|�d����dS)NzInvalid argument zW: you can't use filenames or URLs with --editable (except via the --find-links option).)r`r�r�r0s r9� not_editablezeasy_install.not_editableos9�� �=� �#�#��4�4���� � � r8c���|jsdStj�tj�|j|j����rt|j�d|j�d����dS)Nz already exists in z; can't do a checkout there)r`r�r�r�r:rt�keyrrxs r9�check_editablezeasy_install.check_editablewsq���}� � �F� �7�>�>�"�'�,�,�t�';�T�X�F�F� G� G� �#�����4�/�/�/�1��� � � r8c#�$K�tjd���} t|��V�tj�|��ot |��dSdS#tj�|��ot |��wwxYw)Nz easy_install-)r})�tempfile�mkdtemprr�r�r�r�)r��tmpdirs r9�_tmpdirzeasy_install._tmpdir�s������!�)9�:�:�:�� 6��f�+�+� � � � �G�N�N�6� "� "� 5�v�f�~�~�~�~�~� 5� 5� 5��B�G�N�N�6� "� "� 5�v�f�~�~�~�~� 5� 5���s �A�2BFc ��|���5}t|t��s�t|��rU|�|��|j�||��}|�d|||d��cddd��Stj � |��r:|�|��|�d|||d��cddd��St|��}|� |��|j� |||j|j|j |j��}|� d|z}|jr|dz }t%|���|jt(kr&|�|||d��|cddd��S|�||j||��cddd��S#1swxYwYdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)�Using)r�r�r!rryr��download� install_itemr�r�r�rr|�fetch_distributionrRr`rxr�r � precedencer(�process_distribution�location)r�r0�depsr��dlr�rs r9r.zeasy_install.easy_install�s��� �\�\�^�^� L�v��d�K�0�0� 7��d�#�#� 7��%�%�d�+�+�+��+�4�4�T�6�B�B�B��,�,�T�2�v�t�T�J�J�  L� L� L� L� L� L� L� L��W�^�^�D�)�)�7��%�%�d�+�+�+��,�,�T�4���t�L�L� L� L� L� L� L� L� L� L�1��6�6�D� � � �� %� %� %��%�8�8��f�d�l�D�M��$�$�d�&6���D��|�C�d�J���#�P��O�O�C�$�S�)�)�)���L�0�0��)�)�$��d�G�D�D�D��9 L� L� L� L� L� L� L� L�<�(�(��t�}�f�d�K�K�= L� L� L� L� L� L� L� L� L� L� L� L���� L� L� L� L� L� Ls&�A-G�A G�(B#G�G�G�Gc���|p|j}|p"tj�|��|k}|p|�d�� }|pJ|jduoAtj�t |����t |j��k}|r&|s$|j|jD]}|j |krn�d}tj dtj� |����|r4|� |||��}|D]}|�|||���n4|�|��g}|�||d|d��|� |D] }||vr|cS� dSdS)N�.eggTz Processing %srr�)rxr�r�r_�endswithr�rr�� project_namer�r r�re� install_eggsr��egg_distribution)r�r0r�r�r��install_neededr��distss r9r�zeasy_install.install_item�s���(�;�4�+;��'�N�2�7�?�?�8�+D�+D��+N��'�H�x�/@�/@��/H�/H�+H��'� � � !�� -� 2� �G�O�O�N�8�4�4� 5� 5� �4�0� 1� 1� 2� � � &�� &��(��):�;� &� &���=�H�,�,��E�-�"&�� ���"�'�"2�"2�8�"<�"<�=�=�=� � E��%�%�d�H�f�=�=�E�� <� <���)�)�$��d�;�;�;�;� <��*�*�8�4�4�5�E� � %� %�d�E�!�H�d�G� D� D� D� � �� � ���4�<�<��K�K�K� � � � � r8c�� tj||��dS#t$r8tj�||�dd����YdSwxYw)Nr�unix)r�_select_schemer�rrJ)r�rs r9rzeasy_install.select_scheme�so�� O� � "�4�� .� .� .� .� .��� O� O� O� �O� )� )�$�� � �W�f�0M�0M� N� N� N� N� N� N� O���s��>A�Ac���|�|��|j�|��||j|jvr|j�|��|j�|��|�|��||j|j<tj |j ||g|�R���|� d��r4|j s-|j� |�d����|s |jsdS|�'|j|jkrtjd|��dS|�||vr0|���}t%t'|����}tj d|�� t)g���|g|j|j��}n^#t.$r"}t1t'|����|�d}~wt2$r'}t1|�����|�d}~wwxYw|js|jr:|D]7}|j|jvr'|�|������8tj d|��dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s)� update_pthr��addr�r{�removerpr�r r��installation_report� has_metadatar�r�get_metadata_linesrxrk�as_requirementr!rr%�resolver.r&r r'�reportr�)r�� requirementr�r�r��distreq�distrosras r9r�z!easy_install.process_distribution�s��� ������� ����t�$�$�$� �4�#�D�H�-� -� -� � � #� #�D� )� )� )� ����T�"�"�"� � � ��&�&�&�,0�����)� ��)��)�+�t�C�d�C�C�C�D�D�D� � � �4� 5� 5� ��&� � � � -� -��'�'�(>�?�?� � � �� 4�D�,� 4� �F� � $���[�_�)D�)D� �H�3�T� :� :� :� �F� � �D� �$;�$;��)�)�+�+�G�%�c�'�l�l�3�3�K� ��1�;�?�?�?� 4� ��n�n�,�,�� �t�/��1B���G�G��$� 0� 0� 0� ��Q���(�(�a� /������ 4� 4� 4� ������,�,�!� 3����� 4���� � � =�t�4� =�� =� =���8�4�#:�:�:��%�%�d�&9�&9�&;�&;�<�<�<�� ��:�K�H�H�H�H�Hs$�/F6�6 H�G� H�*"H � Hc��|j�|j S|�d��rdS|�d��sdSdS)Nz not-zip-safeTzzip-safeF)rmr�)r�r�s r9� should_unzipzeasy_install.should_unzipsO�� �;� "��{�?� "� � � �^� ,� ,� ��4�� � ��,�,� ��4��ur8c��tj�|j|j��}tj�|��r%d}t j||j|j|��|Stj�|��r|}n�tj� |��|krtj |��tj |��}t|��dkrGtj�||d��}tj�|��r|}t|��tj||��|S)Nz<%r already exists in %s; build directory %s will not be keptrSr)r�r�r:rtr{r�r rkr�r_r��listdirr*r*�shutil�move)r�r0� dist_filename� setup_base�dstr�contentss r9� maybe_movezeasy_install.maybe_move s���g�l�l�4�/���:�:�� �7�>�>�#� � � �N� � �H�S�$�(�D�$8�*� E� E� E�� � �7�=�=�� '� '� /�&�J�J��w���}�-�-��;�;�� �-�(�(�(��z�*�-�-�H��8�}�}��!�!� "�� � �Z��!�� E� E� ��7�=�=��/�/�/�!.�J������� �J��$�$�$�� r8c��|jrdSt����|��D] }|j|�� dSr�)rq� ScriptWriter�best�get_args� write_script)r�r�rus r9rnz$easy_install.install_wrapper_scripts sX�� � � � �F� �%�%�'�'�0�0��6�6� %� %�D� �D� �t� $� $� $� %� %r8c�6�t|�����}t||��}|rA|�|��t ��z}t �|��|z}|�|t|��d��dS)z/Generate a legacy script wrapper and install itr[N) rr��is_python_script�_load_templater�r�� get_headerr�r@)r�r�ro� script_text�dev_pathr0� is_script�bodys r9rlzeasy_install.install_script&s����4�&�&�(�(�)�)��$�[�+�>�>� � � F��&�&�x�0�0�6�8�8�;�D�&�1�1�+�>�>��E�K� ���+�y��'=�'=�s�C�C�C�C�Cr8c��d}|r|�dd��}td|��}|�d��S)z� There are a couple of template scripts in the package. This function loads one of them and prepares it for use. z script.tmplz.tmplz (dev).tmplr��utf-8)rJr�decode)r�r� raw_bytess r9r�zeasy_install._load_template0sG���� � 8��<�<���7�7�D�#�L�$�7�7� �����(�(�(r8�tr7c�L�����fd�|D����tjd|�j��tj��j|��}��|���jrdSt��}t|��tj� |��rt j |��t|d|z��5}|�|��ddd��n #1swxYwYt|d|z ��dS)z1Write an executable file to the scripts directoryc�Z��g|]'}tj��j|����(Sr7)r�r�r:rp)r�rVr�s �r9r�z-easy_install.write_script..Bs+��� @� @� @�!�R�W�\�\�$�/�1� -� -� @� @� @r8zInstalling %s script to %sNrAi�)r�r r�rpr�r�r:rvr�� current_umaskr*r�r�rHr`�chmod)r�ror��moder��target�maskrZs` r9r�zeasy_install.write_script?sR��� ��� @� @� @� @�x� @� @� @� � � � ��-�{�D�O�L�L�L�����d�o�{�;�;�� ������� �<� � �F������� � � � �7�>�>�&� !� !� � �I�f� � � � �&�#��*� %� %� �� �G�G�H� � � � � � � � � � � � � � ���� � � � � �f�e�d�l�#�#�#�#�#s�$D�D � D c��|j|j|jd�} ||���dd�}|||��gS#t$rYnwxYw|}t j�|��r,|�d��st|||j ��n>t j� |��rt j� |��}|� |��r |jr|�|�|||��}t j�|d��}t j�|��s�t%t j�|dd����}|s/t'dt j� |��z���t)|��dkr/t'dt j� |��z���|d }|jr*t-j|�||����gS|�||��S) N)r��.exez.whl������.pyzsetup.pyr�z"Couldn't find a setup script in %srSzMultiple setup scripts in %sr)� install_egg� install_exe� install_wheelr��KeyErrorr�r��isfiler�r�unpack_progressr��abspath� startswithrtr�r:r�rr r*r`r r��report_editable�build_and_install) r�r0r�r�� installer_map� install_distr�� setup_script�setupss r9r�zeasy_install.install_eggsSsA���$��$��&� � � �  9�(��#�#�%�%�b�c�c�*��L� !�L���7�7�8� 8��� � � � �D� ���� � � �7�>�>�-� (� (� 8��1G�1G��1N�1N� 8� �=�&�$�2F� G� G� G� G� �W�]�]�=� )� )� 8������7�7�J� � !� !�&� )� )� J��(� J�-1�-=�����}�j�I�I�J��w�|�|�J� �;�;� ��w�~�~�l�+�+� %��"�'�,�,�z�3� �C�C�D�D�F�� �$�8��G�O�O�M�2�2�3�����6�{�{�Q���$�2��G�O�O�M�2�2�3����"�!�9�L� �=� D� �H�T�)�)�$� �=�=� >� >� >��I��)�)�,� �C�C� Cs�"A� A�Ac� �tj�|��r/t|tj�|d����}n!t t j|����}tj ||���S)N�EGG-INFO)�metadata) r�r�r�r#r:r$� zipimport� zipimporterr"� from_filename)r��egg_pathr�s r9r�zeasy_install.egg_distribution�sw�� �7�=�=�� "� "� D�#�H�b�g�l�l�8�;E�/G�/G�H�H�H�H�#�9�#8��#B�#B�C�C�H��)�(�X�F�F�F�Fr8c ��tj�|jtj�|����}tj�|��}|jst|��|�|��}tj� |��r!tj� ||���s�tj� |��r;tj� |��stj||j���nDtj� |��r%|�tj|fd|z�� d}tj� |��r3|�|��rt$jd}}nwt$jd}}nh|�|��r|�|��|jd}}n4d}|�|��rt$jd}}nt$jd}}|�|||f|dztj�|��tj�|��fz��t5||� ��n #t6$rt5|d� ���wxYw|�|��|�|��S) N�r�� Removing F�Moving�Copying� ExtractingTz %s to %s��fix_zipimporter_caches)r�r�r:rorer�r�r*r�r��samefiler�r�r � remove_treer,r�r�r�r��copytreer��mkpath�unpack_and_compile�copy2r_�update_dist_cachesr6rv)r�r�r�� destinationr��new_dist_is_zippedrZrQs r9r�zeasy_install.install_egg�s����g�l�l� � � �G� � �X� &� &� � � ��g�o�o�k�2�2� ��|� *� �[� )� )� )��$�$�X�.�.�� �G�N�N�;� '� '�) �,.�G�,<�,<�X�{�,S�,S�) ��w�}�}�[�)�)� �"�'�.�.��2M�2M� ��$�[�$�,�G�G�G�G�G����� �,�,� �� � ��I� �N��+�-����  �%*�"��7�=�=��*�*� 7��*�*�6�2�2�:�%�{�H�1���%�� �1����&�&�t�,�,�7��K�K� �,�,�,��2�L�q�A�A�)-�&��*�*�6�2�2�7�%�{�H�1���%�|�Y�1��� � ���{�+���_���(�(��2�2����� �4�4�)�����#��+=�������� � � �"�;�u�M�M�M�M�� ���� ��� �$�$�$��$�$�[�1�1�1s �,D(J�J2c��� �t|��}|�td|z���td|�dd��|�dd��t �����}t j�||���dz��}||_ |dz}t j�|d��}t j�|d ��}t|��t||��|_ |� ||��t j�|��s�t|d ��} | �d ��|�d��D]L\} } | d krA| �| �d d������d| �d����M| ���t j�|d��� |�� fd�t,�|��D����t1j|||j|j���|�||��S)Nz(%s is not a valid distutils Windows .exer�rrg)r�rg�platformr�z.tmpr��PKG-INFOrAzMetadata-Version: 1.0 �target_version�_�-z: rFric�\��g|](}tj��|d����)S)r)r�r�r:)r�rurps �r9r�z,easy_install.install_exe..�s=��� � � �� �G�L�L��T�!�W� -� -� � � r8)r�r�)r0r r"rKrr�r�r:�egg_namer�r*r#� _provider� exe_to_eggr�rHr`�itemsrJ�titlerIr�r�r�r� make_zipfiler�r�r�) r�r�r��cfgr�r��egg_tmp� _egg_info�pkg_infrZ�k�vrps @r9r�zeasy_install.install_exe�sT���!�-�0�0�� �;� �:�]�J��� �� �����V�4�4��G�G�J� �2�2�\�^�^� � � ���7�<�<��� � ���&�(@�A�A�� �� ��V�#���G�L�L��*�5�5� ��'�,�,�y�*�5�5����!�!�!�%�g�y�9�9��� ��� �w�/�/�/��w�~�~�g�&�&� ��W�c�"�"�A� �G�G�-� .� .� .�� � �*�-�-� K� K���1��(�(�(��G�G�!�)�)�C��*=�*=�*C�*C�*E�*E�*E�*E�q�q�q�I�J�J�J�� �G�G�I�I�I��W�\�\�)�Y�7�7� � ��� � � � �$�-�-�d�3�3� � � � � � � �� �g�t�|�T�\� � � � �����&�1�1�1r8c� �� � ���t|��� g�g� i��� � ��fd�}t|�|��g}� D]�}|����d��r�|�d��}|d}t j|d��dz|d<tjj �g|�R�}�� |��|� |��t j ||����|� ���t j tj� �d��t j�|����dD]�} t��| r�tj� �d| dz��} tj�| ��sat#| d ��} | �d � t��| ��d z��| �����d S) z;Extract a bdist_wininst to the directories an egg would usec�R��|���}� D�]c\}}|�|���rG||t|��d�z}|�d��}t jj�g|�R�}|���}|�d��s|�d��ratj |d��|d<d� tj� |d��d<�� |��n^|�d��rI|dkrCd� tj� |d��d<� � |��|cS��e|�d ��stj d |��dS) N�/�.pyd�.dll�����rSrr��SCRIPTS/rYzWARNING: can't process %s)r�r�r*r�r�r�r:r�r� strip_module�splitextrsr rk) �srcr�r?�old�new�partsr�r� native_libs�prefixes� to_compile� top_levels �����r9�processz(easy_install.exe_to_egg..process�s����� � � � �A�$� � ���S��<�<��$�$� ���C��H�H�I�I��.�C��I�I�c�N�N�E��'�,�w�7��7�7�7�C������B��{�{�6�*�*�/�b�k�k�&�.A�.A�/�$-�$:�5��9�$E�$E��b� �CD� �"�'�"2�"2�5��8�"<�"<�Q�"?�@�#�*�*�3�/�/�/�/����U�+�+�/��z�0A�0A�CD� �"�'�"2�"2�5��8�"<�"<�Q�"?�@�"�)�)�#�.�.�.��J�J�J� ��<�<��'�'� ;���4�c�:�:�:��4r8rrr r�r�)rrz.txtrArFN)r1rr�r�r�rr r�r�r:rs� write_stub� byte_compile�write_safety_flag� analyze_eggr�r�rHr`rI)r�r�rr�stubs�resr�resource�pyfiler�txtrZrrrrs ` @@@@r9r�zeasy_install.exe_to_egg�s�������$�M�2�2��� �� �� � � � � � � � � � �* �}�g�w�7�7�7���� 7� 7�C��y�y�{�{�#�#�F�+�+� 7�� � �#���� ��9��%�2�5��9�=�=��E��b� ����g�6��6�6�6���!�!�&�)�)�)�� � �V�$�$�$��$�X�v�6�6�6�� ���*�%�%�%��#� �G�L�L��*� -� -� � !�'�5� 1� 1� 3� 3� 3�/� � �D��x�x��~� ��g�l�l�7�J��v� �F�F���w�~�~�c�*�*���S�#���A��G�G�D�I�I�f�h�h�t�n�5�5��<�=�=�=��G�G�I�I�I��  � r8c ���t|��}|���sJ�tj�|j|�����}tj�|��}|jst|��tj� |��r;tj� |��stj ||j���nDtj�|��r%|�tj|fd|z�� |�|j|fdtj�|���dtj�|������t)|d���n#t)|d���wxYw|�|��|�|��S)Nr�r�z Installing z to Fr�)r� is_compatibler�r�r:ror�r�r�r*r�r�r r�r�r,r��install_as_eggrer_r�rvr�)r�� wheel_pathr��wheelr�s r9r�zeasy_install.install_wheel*s����j�!�!���"�"�$�$�$�$�$��g�l�l�4�#3�U�^�^�5E�5E�F�F� ��g�o�o�k�2�2� ��|� *� �[� )� )� )� �7�=�=�� %� %� �b�g�n�n�[�.I�.I� � � ��d�l� C� C� C� C� C� �W�^�^�K� (� (� � �L�L�� ����k�)� � � � J� �L�L��$�����G�$�$�Z�0�0�0�0��G�O�O�K�0�0�0�� � � � �{�5� I� I� I� I� I�� �{�5� I� I� I� I� I���� ��� �$�$�$��$�$�[�1�1�1s �1AF � F3a( Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher z� Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) � Installedc���d}|jrG|js@|d|jzz }|jt t t j��vr |d|jzz }|j }|j }|j }d}|t��zS)z9Helpful installation message for display to package usersz %(what)s %(eggloc)s%(extras)srFr�) ryr~�_easy_install__mv_warningror�rr�r��_easy_install__id_warningr�r�rgr�) r��reqr��whatr�egglocrrg�extrass r9r�z easy_install.installation_reportXs���/�� � � 0�d�n� 0� �4�$�+�+� +�C���s�>�3�8�'D�'D�D�D��t�d�/�/�/������ ���,�����V�X�X�~�r8aR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. c��tj�|��}tj}d|jt ��zzS)NrF)r�r�r_r�ra�_easy_install__editable_msgr�)r�r0r�r_�pythons r9r�zeasy_install.report_editableqs3���'�/�/�,�/�/������d�)�F�H�H�4�4�4r8c��tj�dt��tj�dt��t |��}|jdkr'd|jdz z}|�dd|z��n!|jdkr|�dd��|jr|�dd ��tj d |t|��dzd�d � |���� t||��dS#t$r#}td |jd����|�d}~wwxYw) Nzdistutils.command.bdist_eggzdistutils.command.egg_infor)rrSrr�z-qz-nz Running %s %s� zSetup script exited with )r��modulesr�rrr�r�r�r�r r�r*r:rr�r ru)r�r�r�rurs r9rzeasy_install.run_setupvsQ�� � ���<�i�H�H�H� � ���;�X�F�F�F��D�z�z�� �<�!� � ��t�|�a�'�(�A� �K�K��3��7� #� #� #� #� �\�A� � � �K�K��4� � � � �<� !� �K�K��4� � � � �� �\�#�j�/�/�A�*=�*>�*>�?����$��� � � � � �l�D� )� )� )� )� )��� � � � �.�12�����<���� ����� ���s� D� E �(E�E c��ddg}tjdtj�|�����} |�tj�|����|�|��|�|||��t|g��}g}|D];}||D]0}|�|� |j |�����1�<|s|j stj d|��|t|��tj|j��S#t|��tj|j��wxYw)Nrz --dist-dirz egg-dist-tmp-)r}�dirz+No eggs found in %s (setup script problem?))r~rr�r�r_�_set_fetcher_optionsrsrr r�r�r�r rkr�r)r�) r�r�r�ru�dist_dir�all_eggs�eggsr{r�s r9r�zeasy_install.build_and_install�sh���\�*���#�"����� �(E�(E� � � �� ,� � %� %�b�g�o�o�l�&C�&C� D� D� D� �K�K�� !� !� !� �N�N�<��T� :� :� :�"�H�:�.�.�H��D�� M� M��$�S�M�M�M�D��K�K�� 0� 0��� � K� K�L�L�L�L�M�� #�� � #���F�!�#�#�#�� �8� � � � � �d�l� +� +� +� +�� �8� � � � � �d�l� +� +� +� +���s �C D/�/*Ec�D�|j�d�����}d}i}|���D]\}}||vr� |d||<�t |���}t j�|d��}tj ||��dS)a When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. r.)rsr�rrrvr{rS)r.z setup.cfgN) r�r��copyr�r�r�r�r:r� edit_config) r�rt�ei_opts�fetch_directives� fetch_optionsr{r�settings� cfg_filenames r9r5z!easy_install._set_fetcher_options�s����#�3�3�N�C�C�H�H�J�J�� ��� �� � ��� (� (�H�C���*�*�*��!$�Q��M�#� � ��]�3�3�3���w�|�|�D�+�6�6� ���<��2�2�2�2�2r8c� �|j�dS|j|jD]v}|js|j|jkr�t jd|��|j�|��|j|jvr|j�|j���w|js�|j|jjvrt jd|��n\t jd|��|j� |��|j|jvr|j� |j��|j rdS|j� ��|jdkrdStj�|jd��}tj�|��rtj|��t'|d��5}|�|j�|j��dz��ddd��dS#1swxYwYdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filer��setuptools.pth�wtrF)r�r{ryr�r r�r�r��pathsr�rsr��saver�r�r:ror�r�rHr`� make_relative)r�r�rTr�rZs r9r�zeasy_install.update_pth�sI�� �=� � �F���t�x�(� 4� 4�A��%� �!�*�� �*E�*E�� �H�=�q� A� A� A� �M� � �� #� #� #��z�T�-�-�-�� �'�'�� �3�3�3���!� ;��}�� � 3�3�3���J������ ��=�t�D�D�D�� �!�!�$�'�'�'��=��(8�8�8��$�+�+�D�M�:�:�:� �<� � �F� � ������ �8�|� #� #� �F��7�<�<�� 0�2B�C�C�� �7�>�>�(� #� #� � �I�h� � � � �(�D� !� !� G�Q� �G�G�D�M�/�/�� �>�>��E� F� F� F� G� G� G� G� G� G� G� G� G� G� G� G���� G� G� G� G� G� Gs�66G9�9G=�G=c�2�tjd||��|S)NzUnpacking %s to %s)r �debug)r�rr�s r9r�zeasy_install.unpack_progress�s�� � �&��S�1�1�1�� r8c������g�g����fd�}t|||��������js?�D]>}tj|��tjdzdz}t ||���=dSdS)Nc�F��|�d��r+|�d��s��|��n?|�d��s|�d��r��|����||���j r|pdS)Nr�� EGG-INFO/r z.so)r�r�rsr�r�)rr�r��to_chmodrs ���r9�pfz+easy_install.unpack_and_compile..pf�s�����|�|�E�"�"� %�3�>�>�+�+F�+F� %��!�!�#�&�&�&�&����f�%�%� %����e�)<�)<� %�����$�$�$� � � ��c� *� *� *��|�#�+��3�t� 3r8imi�)rrr�r��stat�ST_MODEr�)r�r�r�rMrZr�rLrs` @@r9r�zeasy_install.unpack_and_compile�s������� ��� 4� 4� 4� 4� 4� 4� 4� �x��b�1�1�1� ���*�%�%�%��|� �� � �������D�L�1�U�:�f�D���a������ � � � r8c�>�tjrdSddlm} t j|jdz ��||dd|j���|jr|||jd|j���t j|j��dS#t j|j��wxYw)Nr)rrS)rv�forcer�) r��dont_write_bytecode�distutils.utilrr r)r�r�rv)r�rrs r9rzeasy_install.byte_compile�s��� � "� � �F�/�/�/�/�/�/� ,� � �d�l�Q�.� /� /� /� �L��a�q�$�,� O� O� O� O��}� �� ����a� �L����� � �d�l� +� +� +� +� +��C� �d�l� +� +� +� +���s �AB�Ba� bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again. c��|jsdSttj�d����}t |j�����D]c}|�|��rLtj� |��s-|� d|z��tj |d���ddS)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i�) rhrr�r�r � only_strsr��valuesr�r�� debug_printrC)r��homer�s r9rzeasy_install.create_home_path/s����y� � �F��B�G�.�.�s�3�3�4�4���d�.�5�5�7�7�8�8� )� )�D����t�$�$� )�R�W�]�]�4�-@�-@� )�� � �!;�d�!B�C�C�C�� �D�%�(�(�(�� )� )r8z/$base/lib/python$py_version_short/site-packagesz $base/binr��rz$base/Lib/site-packagesz $base/Scriptsc��|�d��j}|jrt|��}|j|d<|j�t j|j��}|� ��D]'\}}t||d���t|||���(ddl m }|D]`}t||��}|�L|||��}t jdkrt j�|��}t|||���adS)Nrrtr)rr)�get_finalized_commandr�r}r��INSTALL_SCHEMESrKr�r�DEFAULT_SCHEMEr�r�rrSrr�r )r�rr��schemerrrs r9r�zeasy_install._expandEs���0�0��;�;�G� � �;� -��{�+�+�K�"&�+�K�� ��)�-�-�b�g�t�7J�K�K�F�#�\�\�^�^� -� -� ��c��4��t�,�,�4��D�$��,�,�,��-�-�-�-�-�-�� )� )�D��$��%�%�C��� �j��k�2�2���7�g�%�%��'�,�,�S�1�1�C���d�C�(�(�(��  )� )r8)T)Fr�)r�r7)r%)O�__name__� __module__� __qualname__�__doc__� description�command_consumes_argumentsr�r�� user_options�boolean_options� negative_optrr�r�r�r�� staticmethodr�rr�rr�r r�r�r3r<r.r�rGrH�lstriprTrVrWrFrGrprvryr|r��contextmanagerr�r.r�rr�r�r�rnrlr�r�r�r�r�r�r�r�r'r(r�r.r�rr�r5r�r�r�rrIrLrr�r]r^r�r7r8r9r.r.bs}������1�1�4�K�!%�� 1�7�G�M�7�6�9�G�?�H� <� F� @�K�H�H�6�E� 5�?� F� ��:�T�^�K�L�9�L�<���O�#�H�-�L��L�/ �/ �/ �b6�6�6��������\��r�r�r�h�(�(��\�(�&� � ��\� � (� (� (�)�)�)�I�I�I� !� !� !�9�9�9�9�: L� L� L� � � �+#�+#�+#�Z'�x�� ( �  �  ��V�X�X��&�h�o�' � � ��V�X�X� � #�8�?�$ � � ��V�X�X�� "�"�"�9�9�9�v +� +� +�&�&�&���������6�6���6�L�L�L�L�B" �" �" �" �HO�O�O�+/�'I�'I�'I�'I�R������.%�%�%� D�D�D�D�� )� )��\� )�$�$�$�$�(1D�1D�1D�fG�G�G�62�62�62�p+2�+2�+2�\3�3�3�j2�2�2�:#�8�?� $ �  �  ��V�X�X��#�8�?�$ � � �L� � � � �%�X�_� & �  �  ��V�X�X��5�5�5� ���,,�,�,�03�3�3�.'G�'G�'G�R��� ���&,�,�,�&'�x��( � � �<�U�W�W�=�@)�)�)��d��d�I�"� � � ����O��T�-�"����N� )�)�)�)�)r8r.c��tj�dd���tj��}t d|��S)NrBr�)r�rJrKr��pathsep�filter)r�s r9� _pythonpathro\s7�� �J�N�N�<�� ,� ,� 2� 2�2�:� >� >�E� �$�� � �r8c ���g���t����tjg}tjtjkr|�tj��|D�]}}|s�tjdvr5��tj� |dd����n�tj dkri��tj� |ddj tj �d��tj� |dd��g��n6��|tj� |dd��g��tjdkr�� d |vr��tj �d ��}|s��3tj� |d d d j tj �d��}��|����td��td��f}���fd�|D����t jr��t j��t'jt*��5��t!j����ddd��n #1swxYwYt/t1t2�������S)z& Return a list of 'site' dirs )�os2emx�riscos�Libz site-packagesrr�z python{}.{}z site-python�darwinzPython.framework�HOME�Library�Pythonr��purelib�platlibc3�$�K�|] }|�v�|V�� dSr�r7)r�r?�sitedirss �r9r�z get_site_dirs..�s-�����>�>�!�A�X�,=�,=�A�,=�,=�,=�,=�>�>r8N)r�ror�r}r�rsr�r�r�r:�sepr�r�rJrKrr�r�r�r�r�r��getsitepackagesr�r�r)rr}rY�home_sp� lib_pathsr{s @r9r�r�as���� �H� �O�O�K�M�M�"�"�"�� �|�H� ��#�*�$�$������(�(�(��)!�)!��� � � �<�/� /� /� �O�O�B�G�L�L����H�H� I� I� I� I� �V�s�]�]� �O�O��� � ���(�M�(�#�*:�;�#� �� �� � �V�U�M�:�:�� � � � � �O�O���� � �V�U�O�<�<�� � � � �<�8� #� #� � �V� +� +� ��z�~�~�f�%�%��� � ��'�,�,� � � � �G�N�C�,� -� �  � �� ���� � � � ���#�#�X�i�%8�%8�8�I� �O�O�>�>�>�>�y�>�>�>�>�>�>� ��(������'�'�'� � �^� ,� ,�0�0�����,�.�.�/�/�/�0�0�0�0�0�0�0�0�0�0�0����0�0�0�0��C���1�1�2�2�H� �Os�/'J"�"J&�)J&c#�K�i}|D�]Q}t|��}||vr�d||<tj�|��s�d||<tj�|��s�c|tj|��fV��|����SdS)zBYield sys.path directories that might contain "old-style" packagesrSrY)r@rB�importN) rr�r�r�r�r�rHr:r�r+rIr��rstrip)�inputs�seenr_rurrZ�lines�lines r9� expand_pathsr��s����� �D��&-�&-�� ��)�)�� �d�?�?� ���W� ��w�}�}�W�%�%� � �� �7�#�#���u�n����� -� -�D��=�=��(�(� ���=�=�=���R�W�\�\�'�4�0�0�1�1�A���Q���(�(�E� �G�G�I�I�I�� -� -���?�?�8�,�,���%�d�k�k�m�m�4�4���4�<�<����T� ��w�}�}�T�*�*����B�J�t�,�,�,�,�,�,�,� -� -�&-�&-r8c�F�t|d��} tj|��}|� |���dS|d|dz |dz }|dkr |���dS|�|dz ��t jd|�d����\}}}|dvr |���dS|�|d|zz ��d d d �}tj |��} |�|��} | � d d ��d } | � tj ����} |�tj| ����n*#tj$rY|���dSwxYw|�d��r|�d��s |���dS||���S#|���wxYw)znExtract configuration data from a bdist_wininst .exe Returns a configparser.RawConfigParser, or None �rbN� ��� z��: ��� � � � � �7�A�Y����*�f�Q�i�7� � �r�>�>��2 ��� � � � � �1 ���y�2�~����#�]�6�1�6�6�"�:�:�>�>���V�U� �.� .� .��( ��� � � � � �% ���y�B��K�(�)�)�)���4�4���*�4�0�0�� ��6�6�&�>�>�D��Z�Z��q�)�)�!�,�F��]�]�3�#<�#>�#>�?�?�F� �M�M�"�+�f�-�-� .� .� .� .���!� � � �� ��� � � � � � �������z�*�*� �#�/�/�'�2J�2J� �� ��� � � � � �� ��� � � � ����� � � � ���sH�H � H �6AH �4H � A>F �H � F0�H �/F0�0-H �4H � H c �,�gd�}tj|��} |���D�]�}|j}|�d��}t |��dkr\|ddkrP|d�d��r5|�dd�|d d���d f��n�t |��dks|�d ��s��|�d ��r��|d� ��d vr�|� |��� ��}t|��D]b}|� ���dd��}|�d��s#|�|d�d|�d�df���c���|���n#|���wxYwd�|D��}|���|���|S)z4Get exe->egg path translations for a given .exe file))zPURELIB/r�)zPLATLIB/pywin32_system32r�)zPLATLIB/r�)r zEGG-INFO/scripts/)zDATA/lib/site-packagesr�rr r)r�rSz .egg-inforNrKrYz -nspkg.pth)�PURELIB�PLATLIB�\r�r�c�@�g|]\}}|���|f��Sr7)r�)r�rV�ys r9r�z$get_exe_prefixes..s(��4�4�4�4�1�a������A��4�4�4r8)r��ZipFile�infolistr�r�r*r�r�r:�upperr�r�r+rIrJr�rsrI�sort�reverse)� exe_filenamerrOr�rrr��pths r9r1r1�s������H� �� �%�%�A���J�J�L�L� L� L�D��=�D��J�J�s�O�O�E��5�z�z�Q���5��8�z�#9�#9���8�$�$�[�1�1���O�O�A�����r��r��(;�(;�[�'I�J�J�J��E��5�z�z�Q���d�m�m�F�&;�&;����}�}�\�*�*� ���Q�x�~�~���#9�9�9��6�6�$�<�<�.�.�0�0��&�x�0�0�L�L�C��)�)�+�+�-�-�d�C�8�8�C��>�>�(�3�3�L� ���e�A�h�h�h����*D�r�(J�K�K�K��� ��� � � � ����� � � � ����4�4�8�4�4�4�H� �M�M�O�O�O� ������ �Os �FG�Gc�d��eZdZdZdZd �fd� Zd�Zd�Zed���Z �fd�Z �fd �Z d �Z �xZ S) r/z)A .pth file with Distribution paths in itFr7c ����||_ttt|����|_tt j�|j����|_|� ��t��� gdd��t|j ��D]2}tt|jt|d�������3dS)NT)r�r�r�rr{r�r�r_�basedir�_load�super�__init__r+rDr�r)r�r�r{r�� __class__s �r9r�zPthDistributions.__init__(s���� �� ��S���:�:�;�;�� �%�b�g�o�o�d�m�&D�&D�E�E�� � � � � � � � ������T�4�(�(�(��� �+�+� @� @�D� ��T�X�1�$��=�=�>�>� ?� ?� ?� ?� @� @r8c��g|_d}t�|j��}tj�|j���r8t|jd��}|D�] }|� d��rd}�|� ��}|j� |��|� ��r'|� ��� d��r��ttj�|j|����x}|jd<tj�|��r||vr"|j���d|_��d||<�� |���|jr |sd|_|jr`|jd� ��sE|j���|jr#|jd� ���?dSdSdSdS)NF�rtr�T�#r rS)rDr��fromkeysr{r�r�r�r�rHr�r�rsrIrr:r�r��pop�dirtyrI)r�� saw_importr�rZr�r�s r9r�zPthDistributions._load1s����� �� ��}�}�T�]�+�+�� �7�>�>�$�-� (� (� ��T�]�D�)�)�A�� � ���?�?�8�,�,��!%�J���{�{�}�}��� �!�!�$�'�'�'��z�z�|�|��t�z�z�|�|�'>�'>�s�'C�'C���)7��G�L�L���t�4�4�)�)���t�z�"�~��w�~�~�d�+�+��t�t�|�|��J�N�N�$�$�$�!%�D�J����T� � � �G�G�I�I�I� �:� �j� ��D�J��j� ���B��!5�!5�!7�!7� � �J�N�N� � � ��j� ���B��!5�!5�!7�!7� � � � � � � � � r8c��|jsdStt|j|j����}|r�t jd|j��|�|��}d� |��dz}tj � |j��rtj |j��t|jd��5}|�|��ddd��n #1swxYwYnWtj �|j��r3t jd|j��tj |j��d|_dS)z$Write changed .pth file back to diskNz Saving %srFrCzDeleting empty %sF)r�r�r�rFrDr rHr�� _wrap_linesr:r�r�r�r�rHr`r�)r�� rel_pathsr��datarZs r9rEzPthDistributions.savePs\���z� � �F���T�/���<�<�=�=� � � %� �I�k�4�=� 1� 1� 1��$�$�Y�/�/�E��9�9�U�#�#�d�*�D��w�~�~�d�m�,�,� )�� �$�-�(�(�(��d�m�T�*�*� �a����� � � � � � � � � � � � � � ���� � � � ���W�^�^�D�M� *� *� %� �I�)�4�=� 9� 9� 9� �I�d�m� $� $� $��� � � s� C.�.C2�5C2c��|Sr�r7)r�s r9r�zPthDistributions._wrap_linesfs��� r8c� ��|j|jvo)|j|jvp|jtj��k}|r&|j�|j��d|_t���|��dS)z"Add `dist` to the distribution mapTN) r�rDr{r��getcwdrsr�r�r�)r�r��new_pathr�s �r9r�zPthDistributions.addjs���� �M��� +� �� �T�]�2�-�� �����,� � � � �J� � �d�m� ,� ,� ,��D�J� ��� � �D�����r8c����|j|jvr4|j�|j��d|_|j|jv�4t ���|��dS)z'Remove `dist` from the distribution mapTN)r�rDr�r�r�)r�r�r�s �r9r�zPthDistributions.removexs`����m�t�z�)�)� �J� � �d�m� ,� ,� ,��D�J��m�t�z�)�)� �����t�����r8c�.�tj�t|����\}}t |j��}|g}tjdkrdp tj}t |��|kr�||jkrH|�tj ��|� ��|� |��Stj�|��\}}|�|��t |��|k��|S)Nr) r�r�r�rr*r��altsepr|rs�curdirr�r:)r�r��npath�last�baselenrr|s r9rFzPthDistributions.make_relatives����g�m�m�N�4�$8�$8�9�9� ��t��d�l�#�#������i�3��&�3�0�"�&���%�j�j�G�#�#��� �$�$�� � �R�Y�'�'�'�� � �����x�x����&��'�-�-��.�.�K�E�4� �L�L�� � � � �%�j�j�G�#�#��Kr8)r7)r`rarbrcr�r�r�rErir�r�r�rF� __classcell__)r�s@r9r/r/#s��������3�3� �E�@�@�@�@�@�@����>���,����\�� � � � � ������ � � � � � � r8r/c�P�eZdZed���Zed��Zed��ZdS)�RewritePthDistributionsc#�@K�|jV�|D]}|V��|jV�dSr�)�prelude�postlude)�clsr�r�s r9r�z#RewritePthDistributions._wrap_lines�sB�����k����� � �D��J�J�J�J��l�����r8z? import sys sys.__plen = len(sys.path) z� import sys new = sys.path[sys.__plen:] del sys.path[sys.__plen:] p = getattr(sys, '__egginsert', 0) sys.path[p:p] = new sys.__egginsert = p + len(new) N)r`rarb� classmethodr�rLr�r�r7r8r9r�r��sW����������[�� �j� � � �G��z� � � �H�H�Hr8r��SETUPTOOLS_SYS_PATH_TECHNIQUE�raw�rewritec��ttjt��rtSt jtj�����S)z_ Return a regular expression based on first_line_re suitable for matching strings. )r�r �patternr�re�compiler�r7r8r9�_first_line_rer��s@�� �-�'��-�-���� �:�m�+�2�2�4�4� 5� 5�5r8c��|tjtjfvr5tjdkr%t |t j��||��Stj��\}}}|d|dd|�d|��zf�)NrrrSr1) r�r�r�rr�rN�S_IWRITEr�rU)�func�arg�exc�et�evr�s r9� auto_chmodr��sv�� �� �2�9�%�%�%�"�'�T�/�/� �c�4�=�!�!�!��t�C�y�y��� ���I�B��A� �a�5�"�Q�%�%�t�t�t�S�S�1�2� 3�3r8c��t|��}t|tj��|rt |��dSt |��dS)aa Fix any globally cached `dist_path` related data `dist_path` should be a path of a newly installed egg distribution (zipped or unzipped). sys.path_importer_cache contains finder objects that have been cached when importing data from the original distribution. Any such finders need to be cleared since the replacement distribution might be packaged differently, e.g. a zipped egg distribution might get replaced with an unzipped egg folder or vice versa. Having the old finders cached may then cause Python to attempt loading modules from the replacement distribution using an incorrect loader. zipimport.zipimporter objects are Python loaders charged with importing data packaged inside zip archives. If stale loaders referencing the original distribution, are left behind, they can fail to load modules from the replacement distribution. E.g. if an old zipimport.zipimporter instance is used to load data from a new zipped egg archive, it may cause the operation to attempt to locate the requested data in the wrong location - one indicated by the original distribution's zip archive directory information. Such an operation may then fail outright, e.g. report having read a 'bad local file header', or even worse, it may fail silently & return invalid data. zipimport._zip_directory_cache contains cached zip archive directory information for all existing zipimport.zipimporter instances and all such instances connected to the same archive share the same cached directory information. If asked, and the underlying Python implementation allows it, we can fix all existing zipimport.zipimporter instances instead of having to track them down and remove them one by one, by updating their shared cached zip archive directory information. This, of course, assumes that the replacement distribution is packaged as a zipped egg. If not asked to fix existing zipimport.zipimporter instances, we still do our best to clear any remaining zipimport.zipimporter related cached data that might somehow later get used when attempting to load data from the new distribution and thus cause such load operations to fail. Note that when tracking down such remaining stale data, we can not catch every conceivable usage from here, and we clear only those that we know of and have found to cause problems if left alive. Any remaining caches should be updated by whomever is in charge of maintaining them, i.e. they should be ready to handle us replacing their zip archives with new distributions at runtime. N)r�_uncacher��path_importer_cache�!_replace_zip_directory_cache_data�*_remove_and_clear_zip_directory_cache_data)� dist_pathr��normalized_paths r9r�r��sX��x%�Y�/�/�O� �_�c�5�6�6�6��D�)�/�:�:�:�:�:� 3�?�C�C�C�C�Cr8c���g}t|��}|D]V}t|��}|�|��r0|||dz�tjdfvr|�|���W|S)ap Return zipimporter cache entry keys related to a given normalized path. Alternative path spellings (e.g. those using different character case or those using alternative path separators) related to the same path are included. Any sub-path entries are included as well, i.e. those corresponding to zip archives embedded in other zip archives. rSr�)r*rr�r�r|rs)r��cache�result� prefix_len�p�nps r9�"_collect_zipimporter_cache_entriesr�s}���F��_�%�%�J� ���� �A� � �� �M�M�/� *� *� ��:�j�1�n�,�-�"�&�"��=�=� �M�M�!� � � �� �Mr8c�l�t||��D]"}||}||=|o |||��}|�|||<�#dS)a� Update zipimporter cache data for a given normalized path. Any sub-path entries are processed as well, i.e. those corresponding to zip archives embedded in other zip archives. Given updater is a callable taking a cache entry key and the original entry (after already removing the entry from the cache), and expected to update the entry and possibly return a new one to be inserted in its place. Returning None indicates that the entry should not be replaced with a new one. If no updater is given, the cache entries are simply removed without any additional processing, the same as if the updater simply returned None. N)r�)r�r��updaterr�� old_entry� new_entrys r9�_update_zipimporter_cacher�$s_��0��� G� G�!�!���!�H� � �!�H��5����9� 5� 5� � � � �E�!�H��!�!r8c�&�t||��dSr�)r�)r�r�s r9r�r�Ds���o�u�5�5�5�5�5r8c�D�d�}t|tj|���dS)Nc�.�|���dSr�)�clear�r�r�s r9�2clear_and_remove_cached_zip_archive_directory_datazf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_dataIs���������r8�r��r�r��_zip_directory_cache)r�r�s r9r�r�HsE��������7�B�D�D�D�D�D�Dr8�__pypy__c�D�d�}t|tj|���dS)Nc��|���tj|��|�tj|��|Sr�)r�r�r�r�rr�s r9�)replace_cached_zip_archive_directory_datazT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_data_sG�� �O�O� � � � � !�$� '� '� '� � � �Y�;�D�A� B� B� B�� r8rr)r�rs r9r�r�^s?�� � � � "� �Y�;�=� ?� ?� ?� ?� ?� ?r8�c�Z� t||d��dS#ttf$rYdSwxYw)z%Is this string a valid Python script?�execTF)r�� SyntaxError� TypeError)rKr�s r9� is_pythonr qsI�����h��'�'�'��t�� �� #�����u�u����s ��*�*c��� tj|d���5}|�d��}ddd��n #1swxYwYn#ttf$r|cYSwxYw|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)�encodingr)N�#!)r�rHr�rDrE)ra�fp�magics r9�is_shr{s���� �W�Z�)� 4� 4� 4� ���G�G�A�J�J�E� � � � � � � � � � � ���� � � � ��� �W� ������������ �D�=�s.�A�:� A�>�A�>�A�A�Ac�,�tj|g��S)z@Quote a command line argument according to Windows parsing rules�� subprocess� list2cmdline)r�s r9� nt_quote_argr�s�� � "�C�5� )� )�)r8c��|�d��s|�d��rdSt||��rdS|�d��r.d|���d���vSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. r��.pywTrr/rF)r�r r�� splitlinesr�)r�r�s r9r�r��s����������8�#4�#4�V�#<�#<���t���h�'�'���t����d�#�#�?��;�1�1�3�3�A�6�<�<�>�>�>�>� �5r8)r�c��dSr�r7)rus r9�_chmodr�r>r8c��tjd||�� t||��dS#tj$r }tjd|��Yd}~dSd}~wwxYw)Nzchanging mode of %s to %ozchmod failed: %s)r rHrr��error)r�r�ras r9r�r��sx���I�)�4��6�6�6�)��t�T������� �8�)�)�)� � �$�a�(�(�(�(�(�(�(�(�(�����)���s�*�A�A�Ac���eZdZdZgZe��Zed���Zed���Z ed���Z ed���Z ed���Z d�Z ed���Zd �Zed ���Zed ���Zd S) � CommandSpeczm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. c��|S)zV Choose the best CommandSpec class based on environmental conditions. r7�r�s r9r�zCommandSpec.best�s �� � r8c��tj�tj��}tj�d|��S)N�__PYVENV_LAUNCHER__)r�r�r r�rarJrK)r��_defaults r9�_sys_executablezCommandSpec._sys_executable�s0���7�#�#�C�N�3�3���z�~�~�3�X�>�>�>r8c��t||��r|St|t��r ||��S|�|���S|�|��S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. )r�r��from_environment� from_string)r��params r9� from_paramzCommandSpec.from_param�sd�� �e�S� !� !� ��L� �e�T� "� "� ��3�u�:�:� � �=��'�'�)�)� )����u�%�%�%r8c�>�||���g��Sr�)r&r"s r9r(zCommandSpec.from_environment�s!���s�C�'�'�)�)�*�+�+�+r8c�F�tj|fi|j��}||��S)z} Construct a command spec from a simple string representing a command line parseable by shlex.split. )�shlexr�� split_args)r��stringr�s r9r)zCommandSpec.from_string�s+�� � �F�5�5�c�n�5�5���s�5�z�z�r8c���tj|�|����|_t j|��}t |��sdg|jdd�<dSdS)Nz-xr)r.r��_extract_options�optionsrrrD)r�r��cmdlines r9�install_optionszCommandSpec.install_options�sc���{�4�#8�#8��#E�#E�F�F�� ��)�$�/�/���w��� &� $�v�D�L��!�� � � � &� &r8c���|dz���d}t���|��}|r|�d��pdnd}|���S)zH Extract any options from the first line of the script. rFrrSr�)rr��match�grouprI)� orig_script�firstr7r3s r9r2zCommandSpec._extract_options�sb�� �t�#�/�/�1�1�!�4��� � �&�&�u�-�-��*/�7�%�+�+�a�.�.�&�B��R���}�}���r8c�V�|�|t|j��z��Sr�)�_renderr�r3r�s r9� as_headerzCommandSpec.as_header�s#���|�|�D�4�� �#5�#5�5�6�6�6r8c��d}|D]8}|�|��r!|�|��r |dd�cS�9|S)Nz"'rSr )r�r�)�item�_QUOTES�qs r9� _strip_quoteszCommandSpec._strip_quotes�sW����� "� "�A����q�!�!� "�d�m�m�A�&6�&6� "��A�b�D�z�!�!�!��� r8c�N�tjd�|D����}d|zdzS)Nc3�nK�|]0}t�|�����V��1dSr�)r rBrI)r�r?s r9r�z&CommandSpec._render..�sQ����*G�*G�8<�K� %� %�d�j�j�l�l� 3� 3�*G�*G�*G�*G�*G�*Gr8rrFr)r�r4s r9r<zCommandSpec._render�sF���)�*G�*G�@E�*G�*G�*G�G�G���g�~��$�$r8N)r`rarbrcr3r�r/r�r�r&r+r(r)r5rir2r=rBr<r7r8r9r r �s$�������� �G�����J�����[�� �?�?��[�?�� &� &��[� &��,�,��[�,�����[��&�&�&� ����\��7�7�7�����\���%�%��\�%�%�%r8r c�&�eZdZed���ZdS)�WindowsCommandSpecFrZN)r`rarbr�r/r7r8r9rFrF�s ��������E�"�"�"�J�J�Jr8rFc��eZdZdZejd�����ZeZ e dd���Z e dd���Z e dd���Z ed���Ze d ���Ze d ���Ze d ���Ze dd ���ZdS)r�z` Encapsulates behavior around writing entry point scripts for console and gui apps. aJ # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r import re import sys # for compatibility with easy_install; see #2198 __requires__ = %(spec)r try: from importlib.metadata import distribution except ImportError: try: from importlib_metadata import distribution except ImportError: from pkg_resources import load_entry_point def importlib_load_entry_point(spec, group, name): dist_name, _, _ = spec.partition('==') matches = ( entry_point for entry_point in distribution(dist_name).entry_points if entry_point.group == group and entry_point.name == name ) return next(matches).load() globals().setdefault('load_entry_point', importlib_load_entry_point) if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(load_entry_point(%(spec)r, %(group)r, %(name)r)()) NFc���tjdt��|rtnt���}|�d||��}|�||��S)Nz Use get_argsr�)rjrkrl�WindowsScriptWriterr�r��get_script_headerr�)r�r�ra�wininst�writer�headers r9�get_script_argszScriptWriter.get_script_args.s^�� � �n�&C�D�D�D�)0�B�%�%�l�H�H�J�J���&�&�r�:�w�?�?�����t�V�,�,�,r8c�n�tjdtd���|rd}|�||��S)NzUse get_headerr))� stacklevelr\)rjrkrlr�)r�r�rarKs r9rJzScriptWriter.get_script_header6sJ�� � � �;�� K� K� K� K� � &�%�J��~�~�k�:�6�6�6r8c#�~K�|�|���}t|�����}dD]�}|dz}|�|�����D]Q\}}|�|��|jt��z}|�||||��} | D]} | V���R��dS)z� Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. N��console�gui�_scripts) r�rr�� get_entry_mapr��_ensure_safe_name�templater��_get_script_args) r�r�rMr0�type_r8r�epr�rurs r9r�zScriptWriter.get_args?s����� �>��^�^�%�%�F��4�&�&�(�(�)�)��%� � �E��J�&�E� �.�.�u�5�5�;�;�=�=� � ���b��%�%�d�+�+�+�!�l�V�X�X�5� ��+�+�E�4���M�M�����C��I�I�I�I��  � � r8c�R�tjd|��}|rtd���dS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)r��searchr)r� has_path_seps r9rWzScriptWriter._ensure_safe_nameQs9�� �y��4�0�0� � � L��J�K�K� K� L� Lr8c��tjdt��|rt���n|���S�NzUse best)rjrkrlrIr�)r�� force_windowss r9� get_writerzScriptWriter.get_writerZs<�� � �j�"?�@�@�@�-:�J�"�'�'�)�)�)���� � �Jr8c��tjdks tjdkr)tjdkrt ���S|S)zD Select the best ScriptWriter for this environment. �win32�javar)r�r�r�r�_namerIr�r"s r9r�zScriptWriter.best`s@�� �<�7� "� "�r�w�&�'8�'8�R�X��=M�=M�&�+�+�-�-� -��Jr8c#�K�|||zfV�dSr�r7)r�rZrrMr�s r9rYzScriptWriter._get_script_argsjs$�����V�k�)�*�*�*�*�*�*r8r�c��|j����|��}|�|��|���S)z;Create a #! line, getting options (if any) from script_text)�command_spec_classr�r+r5r=)r�r�ra�cmds r9r�zScriptWriter.get_headerosH���$�)�)�+�+�6�6�z�B�B�� ���K�(�(�(��}�}���r8)NFr�)r�N)r`rarbrcrGrHrjrXr rir�rNrJr�rirWrbr�rYr�r7r8r9r�r�sA�������� �x��! �! �! �B�V�X�X�C �F%���-�-�-��[�-��7�7�7��[�7������[��"�L�L��\�L��K�K��[�K� ����[���+�+��[�+������[���r8r�c��eZdZeZed���Zed���Zed���Zed���Z e d���Z dS)rIc�^�tjdt��|���Sr`)rjrkrlr�r"s r9rbzWindowsScriptWriter.get_writerzs%�� � �j�"?�@�@�@��x�x�z�z�r8c�~�tt|���}tj�dd��}||S)zC Select the best ScriptWriter suitable for Windows )ra�natural�SETUPTOOLS_LAUNCHERra)r��WindowsExecutableLauncherWriterr�rJrK)r�� writer_lookup�launchers r9r�zWindowsScriptWriter.best�sA�� �6�� � � � � �:�>�>�"7��F�F���X�&�&r8c#��K�tdd���|}|tjd����d��vr3djd it ����}tj|t��gd�}|� |��|� ||��}�fd�|D��}�|z||zd |fV�d S) z For Windows, add a .py extension�.pyarrR�PATHEXT�;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.)rtr�� -script.py�.pyc�.pyorr�c���g|]}�|z��Sr7r7�r�rVrs �r9r�z8WindowsScriptWriter._get_script_args..�����*�*�*��D�1�H�*�*�*r8r�Nr7) r�r�rJr�r�r�r�rjrk� UserWarningr��_adjust_header) r�rZrrMr��extrrr�s ` r9rYz$WindowsScriptWriter._get_script_args�s�������6�v�.�.�.�u�5�� �b�j��+�1�1�3�3�9�9�#�>�>� >� >��-��!�!��x�x�!�!�C� �M�#�{� +� +� +�K�K�K�� � � �3�����#�#�E�6�2�2��*�*�*�*�c�*�*�*���S�j�&�;�.��X�=�=�=�=�=�=r8c���d}d}|dkr||}}tjtj|��tj��}|�||���}|�|��r|n|S)z� Make sure 'pythonw' is used for gui and 'python' is used for console (regardless of what sys.executable is). r[r\rT)r0�repl)r�r��escape� IGNORECASE�sub� _use_header)r�rZ� orig_headerr�r�� pattern_ob� new_headers r9r~z"WindowsScriptWriter._adjust_header�sm��  ���� �E�>�>� �'�T�G��Z�� �'� 2� 2�B�M�B�B� ��^�^�;�T�^�B�B� � �_�_�Z�8�8�I�z�z�k�Ir8c�z�|dd��d��}tjdkpt|��S)z� Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. r)r �"rd)rIr�r�r)r�� clean_headers r9r�zWindowsScriptWriter._use_header�s:��"�!�B�$�'�-�-�c�2�2� ��|�w�&�G�/�,�*G�*G�Gr8N) r`rarbrFrir�rbr�rYr~rir�r7r8r9rIrIws�������+������[�� � '� '��[� '�� >� >��[� >�� J� J��[� J�� H� H��\� H� H� Hr8rIc�$�eZdZed���ZdS)rpc#��K�|dkrd}d}dg}nd}d}gd�}|�||��}�fd�|D��} �|z||zd| fV��d zt|��d fV�t��s�d z} | t���dfV�d Sd S) zG For Windows, add a .py extension and an .exe launcher rTz -script.pywr�clirw)r�rxryc���g|]}�|z��Sr7r7r{s �r9r�zDWindowsExecutableLauncherWriter._get_script_args..�r|r8r�r�r[z .exe.manifestN)r~�get_win_launcherr:�load_launcher_manifest) r�rZrrMr�� launcher_typerr�hdrr��m_names ` r9rYz0WindowsExecutableLauncherWriter._get_script_args�s������ �E�>�>�!�M��C��(�C�C�!�M��C�)�)�)�C�� � ���/�/��*�*�*�*�c�*�*�*���c�z�3��,�c�8�<�<�<�<� �6�M�+�M�:�:� � � � � ��z�z� >� �O�+�F��1�$�7�7��=� =� =� =� =� =� >� >r8N)r`rarbr�rYr7r8r9rprp�s-�������>�>��[�>�>�>r8rpc���d|z}t��r@t��dkr|�dd��}n-|�dd��}n|�dd��}td|��S)z� Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. z%s.exez win-arm64r�z-arm64.z-64.z-32.r�)r:rrJr)�type� launcher_fns r9r�r��s{���T�/�K��z�z�7� �>�>�[� (� (�%�-�-�c�9�=�=�K�K�%�-�-�c�6�:�:�K�K�!�)�)�#�v�6�6� � �<�� 5� 5�5r8c�~�tjtd��}|�d��t ��zS)Nzlauncher manifest.xmlr�)� pkg_resourcesrr`r��vars)r�manifests r9r�r��s0���,�X�7N�O�O�H� �?�?�7� #� #�d�f�f� ,�,r8Fc�.�tj|||��Sr�)r�r�)r�� ignore_errors�onerrors r9r�r��s�� �=��}�g� 6� 6�6r8c�V�tjd��}tj|��|S)N�)r��umask)�tmps r9r�r��s!�� �(�5�/�/�C��H�S�M�M�M� �Jr8c�$�td�|��S)z, Exclude non-str values. Ref #3063. c�,�t|t��Sr�)r�r)rs r9�zonly_strs.. s��j��c�2�2�r8)rn)rWs r9rVrV�s�� �2�2�F� ;� ;�;r8c��eZdZdZdS)rlzF Warning for EasyInstall deprecations, bypassing suppression. N)r`rarbrcr7r8r9rlrl s���������r8rlr�)r)|rcrrSrrr�distutils.errorsrrr r r+r r �distutils.command.build_scriptsr rbr�distutils.commandrr�r�r�r�r~r�r�rNr7rGrjr�r5r�rr.r�r�r�rr�rr�setuptools.sandboxr�setuptools.commandr�setuptools.archive_utilr�setuptools.package_indexrrrrr�setuptools.wheelrr�rrrrr r!r"r#r$r%r&r'r(�_pathr*�extern.jaraco.textr+�filterwarnings� PEP440Warning�__all__r:r@rDrLr.ror�r�r0r1r/r�rJrKr�r�r�r�r�r�r��builtin_module_namesr�r rrr�r�r� ImportErrorr�r r&�sys_executablerFr�rIrprNrJr�r�r�r�rVrlr7r8r9�r�sx�� � �������'�'�'�'�'�'�3�3�3�3�3�3�3�3�������������$�#�#�#�#�#�#�#�9�9�9�9�9�9�+�+�+�+�+�+�%�%�%�%�%�%� � � � � � � � ����� � � � ��������� � � � � � � � � � � � ��������� � � � � � � � ��������� � � � � � � � ���������������3�3�3�3�3�3�������(�(�(�(�(�(�%�%�%�%�%�%�2�2�2�2�2�2�����������3�2�2�2�2�2�2�2�"�"�"�"�"�"������������������������������� ����$�$�$�$�$�$�,�,�,�,�,�,���� �M�,G�H�H�H�H� � � �� %�%�%�������=�=�=�w)�w)�w)�w)�w)�7�w)�w)�w)�t'��� C�C�C�L+-�+-�+-�\&�&�&�R"�"�"�Ji�i�i�i�i�{�i�i�i�X � � � � �.� � � �,�:�>�>�1�5�9�9�Y�F�F�.�� 6� 6� 6�4�4�4�OD�OD�OD�d���(!�!�!�!�@6�6�6�D�D�D�"��)�)�)�2�&�%�?�?�?�&�������*�*�*� � � � �"�"�"�"�"�"�"��� � � � � � � � � ���� )�)�)�P%�P%�P%�P%�P%�$�P%�P%�P%�h�,�,�.�.��#�#�#�#�#��#�#�#�q�q�q�q�q�q�q�q�h>H�>H�>H�>H�>H�,�>H�>H�>H�B>�>�>�>�>�&9�>�>�>�@�.�� �2��6�6�6�&-�-�-� %�j�7�7�7�7���� <�<�<������$@�����s�'F.�.F9�8F9