add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
�

�Wc�����	ddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZdd	lmZeed
d�eedd�eedd�d
�ZGd�de�ZdS)�N)�standard_b64encode)�	HTTPError)�urlopen�Request)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�log�md5�sha256�blake2b)�
md5_digest�
sha256_digest�blake2_256_digestc�l�eZdZdZej
ddgzZejdgzZd�Zd�Zd�Z	d�Z
d	S)
�uploadzupload binary package to PyPI)�sign�szsign files to upload using gpg)z	identity=�izGPG identity used to sign filesrc�z�tj|�d|_d|_d|_d|_d|_dS)N�rF)r
�initialize_options�username�password�
show_responser�identity)�selfs �1/usr/lib64/python3.12/distutils/command/upload.pyrzupload.initialize_options*s;���(�(��.�.���
���
������	���
�
�
�c��tj|�|jr|js
t	d��|j�}|ikr4|d|_|d|_|d|_|d|_	|js5|jjr|jj|_dSdSdS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r
�finalize_optionsrrr	�_read_pypircrrr#r$�distribution)r�configs  r r%zupload.finalize_options2s����&�&�t�,�,��=�=�=�����&�@��
��"�"�$���R�<�<�"�:�.�D�M�"�:�.�D�M�$�\�2�D�O����D�J��}�}�}��!2�!2�!;�!;�!;� �-�-�6�6�D�M�M�M�"<�!;�}�}r!c��|jjsd}t|��|jjD]\}}}|j|||��dS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))r'�
dist_filesr	�upload_file)r�msg�command�	pyversion�filenames     r �runz
upload.runDsj��� � �+�+�+�2�C�&�s�+�+�,0�,=�,=�,H�,H�	;�	;�(�G�Y�����W�i��:�:�:�	;�	;r!c�^�t|j�\}}}}}}	|s|s|	rtd|jz��|dvrtd|z��|jr<ddd|g}
|jrd|jg|
ddt|
|j�	�t|d
�}	|j�}|j�|jj}
idd�d
d�d|
j��d|
j��dtjj!|�|f�d|�d|�dd�d|
j#��d|
j%��d|
j'��d|
j)��d|
j+��d|
j-��d|
j/��d|
j1��d|
j3��|
j5�|
j7�|
j9�|
j;�d��}d |d!<t<j?�D]$\}}|��		||�jA�||<�&|jrSt|d"zd
�5}tjj!|�d"z|j�f|d#<ddd�|jDd$z|jFzjId%�}d&tK|�jMd%�z}d'}d(|jId%�z}|d)z}tOjP�}|j?�D]�\}}d*|z}tS|tT�s|g}|D]�}tW|�tXur|d+|d,zz
}|d-}nt[|�jId.�}|j]|�|j]|jId.��|j]d/�|j]|�����|j]|�|j_�}d0|�d1|j��}|ja|tbjd�d2|zt[tg|��|d3�}ti|j||�4�}	tk|�}|jm�}|jn}|d5kr�|jad6|�d7|��tbjd�|jxrK|j{�}!d8j}d9|!d9f�}|ja|tbjd�dSdSd:|�d7|��}|ja|tbjv�t|��#|j�wxYw#tB$rY��xwxYw#1swY��xYw#tp$r#} | jr}| jn}Yd} ~ ��d} ~ wtt$r3} |jat[| �tbjv��d} ~ wwxYw);NzIncompatible url %s)�http�httpszunsupported schema �gpgz
--detach-signz-az--local-user�)�dry_run�rbz:action�file_upload�protocol_version�1�name�version�content�filetyper.�metadata_versionz1.0�summary�	home_page�author�author_email�license�description�keywords�platform�classifiers)�download_url�provides�requires�	obsoletesr�commentz.asc�
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"r�zutf-8s

zSubmitting z to z multipart/form-data; boundary=%s)zContent-typezContent-length�
Authorization)�data�headers��zServer response (z): �
zK---------------------------------------------------------------------------zUpload failed ()@rr#�AssertionErrorrrrr6�open�read�closer'�metadata�get_name�get_version�os�path�basename�get_description�get_url�get_contact�get_contact_email�get_licence�get_long_description�get_keywords�
get_platforms�get_classifiers�get_download_url�get_provides�get_requires�
get_obsoletes�_FILE_CONTENT_DIGESTS�items�	hexdigest�
ValueErrorrr�encoder�decode�io�BytesIO�
isinstance�list�type�tuple�str�write�getvalue�announcer�INFO�lenrr�getcoder,r�code�OSError�ERRORr�_read_pypi_response�joinr)"rr-r.r/�schema�netloc�url�params�query�	fragments�gpg_args�fr=�metarS�digest_name�digest_cons�	user_pass�auth�boundary�sep_boundary�end_boundary�body�key�value�titler,rT�request�result�status�reason�e�texts"                                  r r+zupload.upload_fileLs���
�T�_�_�%�	6����V�U�I��6�U�U�i�i� �!6����!H�I�I��*�*�*� �!6��!?�@�@��9�9�9����h�?�H��}�}�}�!/���� ?���1�
��(��,�,�
(�
(�
(�

��$���	��f�f�h�G�
�G�G�I�I�� � �)�)����}��
���
�D�M�M�O�
�
�t�'�'�)��
����(�(��2�7�;��
���
���
��� 
�t�+�+�-�!�"
�����#�$
�d�&�&�(�%�&
�D�2�2�4�'�(
�t�'�'�)�)�*
�4�4�4�6�+�,
��)�)�+�-�.
��*�*�,�/�0
�4�/�/�1�1�2!�1�1�3��)�)�+��)�)�+��+�+�-�;����@��Y��)>�(C�(C�(E�	�	�$�K���"��
�$/�K��$8�$B�$B�$D��[�!�!�
�9�9�9��h��'��.�
3�!�)+���)9�)9�(�)C�f�)L�)*����)3��_�%�
3�
3�
3�
3�
3�
�]�]�S�(�4�=�=�8�@�@��I�	��,�Y�7�>�>�w�G�G��I�� �8�?�?�7�#;�;��#�i�/���z�z�|���*�*�,�	"�	"�J�C��C�c�I�E��e�T�*�*�����	
"�	
"����;�%�'�'��.��q��9�9�E�!�!�H�E�E���J�-�-�g�6�E��
�
�<�(�(��
�
�5�<�<��0�1�1��
�
�;�'�'��
�
�5�!�!�!�	
"�	
�
�
�<� � ��}�}����'/�x�x�����A���
�
�c�3�8�8�$�$�?��I�!�#�d�)�n�!�
�
���$�/�/��")�+�+��		��W�%�F��^�^�%�F��Z�Z�F��S�=�=��M�M�M������G��(�(�
$�
$��!�!�!��/�/��7���i�i��4�� :�;���
�
�c�3�8�8�,�,�,�,�"�!��/5�f�f�f�f�=�C��M�M�#�s�y�y�)�)� ��%�%��g
�G�G�I�I�I�I�I�I��V�
�
�
���
����

3�
3�
3�
3�
3�
3�
3�
3�
3�����d�	�	�	��V�V�F��U�U�F�F�F�F�F�F������	�	�	��M�M�#�a�&�#�)�)�,�,������	���sN�*V�V&�>9V7�(*W�V#�&
V4�3V4�7W�
X,�W,�,
X,�9.X'�'X,N)�__name__�
__module__�__qualname__rEr
�user_options�boolean_optionsrr%r0r+�r!r rrs�������1�K� �-�-�	+�=�1
�
�L�$�3�3�v�h�>�O����7�7�7�$;�;�;�K&�K&�K&�K&�K&r!r)r^rt�hashlib�base64r�urllib.errorr�urllib.requestrr�urllib.parser�distutils.errorsrr	�distutils.corer
�distutils.spawnr�	distutilsr�getattrrnrr�r!r �<module>r�s4���
�	�	�	�	�	�	�	�����%�%�%�%�%�%�"�"�"�"�"�"�+�+�+�+�+�+�+�+�!�!�!�!�!�!�A�A�A�A�A�A�A�A�(�(�(�(�(�(�!�!�!�!�!�!��������'�'�5�$�/��W�W�h��5� ���)�T�:����y&�y&�y&�y&�y&�]�y&�y&�y&�y&r!