� ,�Re#7�� �ddlmZddlmZddlmZddlmcmZddl Z ddl Z ddl Z ddl Z ddl ZddlZddlZddlZddlmZddlmZmZmZmZmZmZddlmZddlmZd �ZGd �d ej��Zd �Z Gd �d��Z!dS)�)�partial)�glob)� convert_pathN)�Path)�Dict�Iterable�Iterator�List�Optional�Tuple)�SetuptoolsDeprecationWarning)�unique_everseenc�x�tj|tj|��jtjz��dS�N)�os�chmod�stat�st_mode�S_IWRITE)�targets ��/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/build_py.py� make_writablers,���H�V�R�W�V�_�_�,�t�}�<�=�=�=�=�=�c�x��eZdZUdZdZeed<dZee ed<d�Z d �fd� Z d �Z d �Z d �Zd �Zd �Zd�Zd�Zd!dee f�fd� Zdee e ffd�Zdeee e ffd�Zdeee e ffd�Zd�Zd�Zdee de dee fd�Zd�Zd�Z d�Z!d�Z"d�Z#e$d���Z%�xZ&S)"�build_pyaXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. F� editable_modeN�existing_egg_info_dirc��tj�|��|jj|_|jjpi|_d|jvr|jd=g|_dS)N� data_files)�origr�finalize_options� distribution� package_data�exclude_package_data�__dict__�_build_py__updated_files��selfs rr!zbuild_py.finalize_options$s^�� � �&�&�t�,�,�,� �-�:���$(�$5�$J�$P�b��!� �4�=� (� (�� �l�+�!����r�c� ��|r\tt|�������}tt|�������}t���||||||��Sr)�strr�resolve�super� copy_file)r(�infile�outfile� preserve_mode�preserve_times�link�level� __class__s �rr.zbuild_py.copy_file,st��� � 3���f���-�-�/�/�0�0�F��$�w�-�-�/�/�1�1�2�2�G��w�w� � ���-��!%�u�.�.� .rc�0�|js|jr|jrdS|jr|���|jr(|���|���|�tj� |d�����dS)z?Build modules, packages, and copy data files to build directoryNr)�include_bytecode) � py_modules�packagesr� build_modules�build_packages�build_package_data� byte_compiler r� get_outputsr's r�runz build_py.run5s����� �4�=� �T�5G� � �F� �?� !� � � � � � � �=� &� � � � !� !� !� � #� #� %� %� %� ���$�-�3�3�D�1�3�M�M�N�N�N�N�Nrc��|dkr |���|_|jStj�||��S)zlazily compute data filesr)�_get_data_filesrr r� __getattr__)r(�attrs rrBzbuild_py.__getattr__Es@�� �<� � �"�2�2�4�4�D�O��?� "��}�(�(��t�4�4�4rc��tj�||||��\}}|r|j�|��||fSr)r r� build_moduler&�append)r(�module� module_file�packager0�copieds rrEzbuild_py.build_moduleLsK���-�4�4�T�6�;�PW�X�X���� � 1� � � '� '�� 0� 0� 0����rc�|�|���tt|j|jpd����S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples�)�analyze_manifest�list�map�_get_pkg_data_filesr9r's rrAzbuild_py._get_data_filesRs6�� �������C��0�$�-�2E�2�F�F�G�G�Grc��|j�di��tt|j|jpd����S)z� Generate list of ``(package,src_dir,build_dir,filenames)`` tuples, but without triggering any attempt to analyze or build the manifest. �manifest_filesrL)r%� setdefaultrNrOrPr9r's r�get_data_files_without_manifestz(build_py.get_data_files_without_manifestWs?�� � � � �!1�2�6�6�6��C��0�$�-�2E�2�F�F�G�G�Grc����|�|���tjj|jg|�d��z�}�fd�|�|���D��}|�||fS)N�.c�P��g|]"}tj�|�����#SrL)r�path�relpath)�.0�file�src_dirs �r� z0build_py._get_pkg_data_files..is9��� � � �� �G�O�O�D�'� *� *� � � r)�get_package_dirrrX�join� build_lib�split�find_data_files)r(rI� build_dir� filenamesr\s @rrPzbuild_py._get_pkg_data_filesas�����&�&�w�/�/���G�L�D�N�#3�g�m�m�C�6H�6H�#H�J� � � � � ��,�,�W�g�>�>� � � � ����I�5�5rc��|�|j||��}tttd���|��}t j�|��}ttj j |��}t j|j � |g��|��}|�|||��S)z6Return filenames for package's data files in 'src_dir'T)� recursive)�_get_platform_patternsr#rOrr� itertools�chain� from_iterable�filterrrX�isfilerR�get�exclude_data_files)r(rIr\�patterns�globs_expanded� globs_matches� glob_files�filess rrbzbuild_py.find_data_filesos����.�.� � � � � � �� �W�T�T�:�:�:�H�E�E��!��5�5�n�E�E� ��B�G�N�M�:�:� ��� � � #� #�G�R� 0� 0� � � ���&�&�w���?�?�?r�returnc���|jr3t|��������St ���|��S)�1See :class:`setuptools.commands.build.SubCommand`)rrN�get_output_mapping�keysr-r>)r(r7r5s �rr>zbuild_py.get_outputs�sM��� � � :���/�/�1�1�6�6�8�8�9�9� 9��w�w�"�"�#3�4�4�4rc��tj|���|�����}t t |d������S)rvc��|dS)NrrL)�xs r�z-build_py.get_output_mapping..�s ��!�A�$�r)�key)rhri� _get_package_data_output_mapping�_get_module_mapping�dict�sorted)r(�mappings rrwzbuild_py.get_output_mapping�sP���/� � 1� 1� 3� 3� � $� $� &� &� � ���F�7���7�7�7�8�8�8rc#�K�|���D]=\}}}|�d��}|�|j||��}||fV��>dS)z5Iterate over all modules producing (dest, src) pairs.rVN)�find_all_modulesra�get_module_outfiler`)r(rIrGrH�filenames rrzbuild_py._get_module_mapping�sp����.2�.C�.C�.E�.E� *� *� *�W�f�k��m�m�C�(�(�G��.�.�t�~�w��O�O�H��[�)� )� )� )� )� *� *rc#�K�|jD]R\}}}}|D]H}tj�||��}tj�||��}||fV��I�SdS)z6Iterate over package data producing (dest, src) pairs.N)rrrXr_)r(rIr\rcrdr�r�srcfiles rr~z)build_py._get_package_data_output_mapping�s|����6:�o� (� (� 2�G�W�i��%� (� (������i��:�:���'�,�,�w��9�9���w�'�'�'�'�'� (� (� (rc���|���D]_\}}|�tj�|����|�||��\}}t |���`dS)z$Copy data files into build directoryN)r~�mkpathrrX�dirnamer.r)r(rr��_outf�_copieds rr<zbuild_py.build_package_data�ss��#�D�D�F�F� "� "�O�F�G� �K�K������/�/� 0� 0� 0�!�^�^�G�V�<�<�N�E�7� �&� !� !� !� !� "� "rc�z�ix|_}|jjsdSi}|jpdD]'}||t |�|����<�(t |dd��rgt|jd��� ��r@|j}t|d��}|� d���� ��}n=|� d��|� d��}|j}|jj}t#��}|�||��D�]} t&j�t | ����\} } d} | } | rZ| | krT| |vrP| } t&j�| ��\} }t&j�|| ��} | r | | kr| |v�P| |vr| | kr|�| ��r��n3|�|| | ��}|r|�|��|�|| g���| ����dS)NrLrz SOURCES.txtzutf-8)�encoding�egg_info)rRr"�include_package_datar9�assert_relativer^�getattrrr�exists� read_text� splitlines� run_command�get_finalized_commandr��filelistrs�_IncludePackageDataAbuse�_filter_build_filesrrXrar_� is_module�importable_subpackage�warnrSrF)r(�mf�src_dirsrI� egg_info_dir�manifestrs�ei_cmd�checkrX�d�f�prev�oldf�df� importables rrMzbuild_py.analyze_manifest�s_��#%�%���b�� �5� � �F����}�*�� O� O�G�GN�H�_�T�%9�%9�'�%B�%B�C�C� D� D� �D�1�4� 8� 8� *��T�/��?�?�F�F�H�H� *� �5�L��L�-�8�8�H��&�&��&�8�8�C�C�E�E�E�E� � � �Z� (� (� (��/�/� �;�;�F�!�?�L��O�)�E�(�*�*���,�,�U�L�A�A� <� <�D��7�=�=���!6�!6�7�7�D�A�q��D��D�� (��T� � �a�x�&7�&7����� � �a�(�(���2��G�L�L��Q�'�'��� (��T� � �a�x�&7�&7��H�}�}���9�9����q�)�)�!� �!�"'�!<�!<�X�a�[�!�!L�!L�J�!�/�� � �:�.�.�.�� � �h�q�k�2�.�.�5�5�d�;�;�;��! <� .�s-��B�B�B�Q��B�R�W�%�%�a�(�(�B�B�Brc3� �K�|]}|�vV�� dSrrL)rZr�� norm_paths �r� z/build_py._filter_build_files..�s(�����-T�-T�Q�a�y�.@�-T�-T�-T�-T�-T�-TrN) r�r`� build_temp� build_baserrXr��isabs�all)r(rsr�r�� build_dirs� norm_dirsr[r�s @rr�zbuild_py._filter_build_files�s�������*�*�7�3�3������0@�%�BR�S� �B�B�*�B�B�B� �� � �D���(�(��.�.�I��7�=�=��&�&� �#�-T�-T�-T�-T�)�-T�-T�-T�*T�*T� �� � � �� � rc��dSrrLr's r�get_data_fileszbuild_py.get_data_files�s�� �rc��� |j|S#t$rYnwxYwtj�|||��}||j|<|r |jjs|S|jjD]"}||ks|�|dz��rn�#|Stj |d��5}|� ��}ddd��n #1swxYwYd|vr#tj � d|�d����|S)z8Check namespace packages' __init__ for declare_namespacerV�rbNsdeclare_namespacezNamespace package problem: z� is a namespace package, but its __init__.py does not call declare_namespace()! Please fix it. (See the setuptools manual under "Namespace Packages" for details.) ")�packages_checked�KeyErrorr r� check_packager"�namespace_packages� startswith�io�open�read� distutils�errors�DistutilsError)r(rI� package_dir�init_py�pkgr��contentss rr�zbuild_py.check_package�sk�� ��(��1� 1��� � � � �D� �����-�-�-�d�G�[�I�I��)0���g�&�� �d�/�B� ��N��$�7� � �C��g�~�~�����#� �!>�!>�~�����N� �W�W�d� #� #� �q��v�v�x�x�H� � � � � � � � � � � ���� � � � � �x� /� /��"�1�1�1�.s/�����O�O�7���u�g�6�6�O�O�O�O�O�Orc3�$�K�|] }|�v�|V�� dSrrL)rZ�fn�bads �rr�z.build_py.exclude_data_files..s'�����7�7�"��3���2�����7�7r)rNrgr$rhrirj�setr) r(rIr\rsro� match_groups�matches�keepersr�s ` @rrnzbuild_py.exclude_data_files s������U� � ���.�.� � %� � � � �� P�O�O�O�h�O�O�O� ��/�/�/� �=�=���'�l�l��7�7�7�7��7�7�7���O�G�,�,�-�-�-rc���tj|�dg��|�|g����}�fd�|D��S)z� yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. �c3�r�K�|]1}tj��t|����V��2dSr)rrXr_r)rZr�r\s �rr�z2build_py._get_platform_patterns..)sQ����� � �� �G�L�L��,�w�"7�"7� 8� 8� � � � � � r)rhrirm)�specrIr\� raw_patternss ` rrgzbuild_py._get_platform_patternsse���!�� �H�H�R�� � � �H�H�W�b� !� !� � � � � � � �(� � � � r)r)r)Nr))r))'�__name__� __module__� __qualname__�__doc__r�bool�__annotations__rr r+r!r.r?rBrErArTrPrbr r>rrwr r rr~r<rMrr�r�r�r�r^rn� staticmethodrg� __classcell__)r5s@rrrsV���������� �M�4����+/��8�C�=�/�/�/�"�"�"�JK�#$�.�.�.�.�.�.�O�O�O� 5�5�5���� H�H�H� H�H�H� 6� 6� 6�@�@�@�"5�5��c��5�5�5�5�5�5� 9�D��c��N�9�9�9�9�*�X�e�C��H�o�%>�*�*�*�*�(�(�5��c��?�2K�(�(�(�(�"�"�"�'<�'<�'<�R��#���#��(�SV�-�����& � � ����<*�*�*� ��� .�.�.� � � ��\� � � � � rrc��tj�|��s|Sddlm}t jd�����|z}||���)Nr)�DistutilsSetupErrorz� Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. )rrXr��distutils.errorsr��textwrap�dedent�lstrip)rXr��msgs rr�r�0sp�� �7�=�=�� � ��� �4�4�4�4�4�4� �� � � � �&�(�(� � �� � �c� "� "�"rc�.�eZdZdZdZd�Zd�Zd�Zd�ZdS)r�z>Inform users that package or module is included as 'data file'a� Installing {importable!r} as data is deprecated, please list it in `packages`. !! ############################ # Package would be ignored # ############################ Python recognizes {importable!r} as an importable package, but it is not listed in the `packages` configuration of setuptools. {importable!r} has been automatically added to the distribution only because it may contain data files, but this behavior is likely to change in future versions of setuptools (and therefore is considered deprecated). Please make sure that {importable!r} is included as a package by using the `packages` configuration field or the proper discovery methods (for example by using `find_namespace_packages(...)`/`find_namespace:` instead of `find_packages(...)`/`find:`). You can read more about "package discovery" and "data files" on setuptools documentation page. !! c�,�t��|_dSr)r��_already_warnedr's r�__init__z!_IncludePackageDataAbuse.__init___s��"�u�u����rc��|�d��o)|dtd�� ����S)Nz.py)�endswith�len� isidentifier)r(r[s rr�z"_IncludePackageDataAbuse.is_modulebs6���}�}�U�#�#�I��\�s�5�z�z�k�\�(:�(G�(G�(I�(I�Irc���t|��j}ttjt j|j����}|rd�|g|���SdS)NrV) r�parentrNrh� takewhiler+r��partsr_)r(r�r[r�r�s rr�z._IncludePackageDataAbuse.importable_subpackageesV���4�j�j����Y�(��)9�3�9�E�E�F�F�� � .��8�8�V�,�e�,�-�-� -��trc���||jvretj|j���|���}t j|td���|j�|��dSdS)N)r��)� stacklevel) r�r�r��MESSAGE�format�warningsr�r �add)r(r�r�s rr�z_IncludePackageDataAbuse.warnlso�� �T�1� 1� 1��/�$�,�/�/�6�6�*�6�M�M�C� �M�#�;�� J� J� J� J� � � $� $�Z� 0� 0� 0� 0� 0� 2� 1rN) r�r�r�r�r�r�r�r�r�rLrrr�r�Es`������H�H��G�.%�%�%�J�J�J����1�1�1�1�1rr�)"� functoolsrr�distutils.utilr�distutils.command.build_py�commandrr rr�r�r�r�r�rhrr�pathlibr�typingrrr r r r �setuptools._deprecation_warningr � setuptools.extern.more_itertoolsrrr�r�rLrr�r s���������������'�'�'�'�'�'�)�)�)�)�)�)�)�)�)� � � � ��������� � � � ��������� � � � �����������B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�H�H�H�H�H�H�<�<�<�<�<�<�>�>�>�U �U �U �U �U �t�}�U �U �U �p#�#�#�*+1�+1�+1�+1�+1�+1�+1�+1�+1�+1r