a XC?hÅ ã @ s¼ d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z m Z ddlmZ ddl mZmZ ddlmZ dd lmZ dd lmZ eeddƒeeddƒeed dƒdœZG dd„ deƒZdS )zm distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to a package index). é N)Ústandard_b64encode)Ú HTTPError)ÚurlopenÚRequest)Úurlparse)ÚDistutilsErrorÚDistutilsOptionError)Ú PyPIRCCommand)Úspawn)ÚlogZmd5Zsha256Zblake2b)Z md5_digestZ sha256_digestZblake2_256_digestc @ sJ e Zd ZdZejddg Zejdg Zdd„ Zdd„ Zd d „ Z dd„ Z d S )Úuploadzupload binary package to PyPI)ÚsignÚszsign files to upload using gpg)z identity=ÚizGPG identity used to sign filesr c C s, t | ¡ d| _d| _d| _d| _d | _d S )NÚ r F)r Úinitialize_optionsÚusernameÚpasswordÚ show_responser Úidentity)Úself© r ú=/opt/alt/python39/lib64/python3.9/distutils/command/upload.pyr * s zupload.initialize_optionsc C sr t | ¡ | jr| jstdƒ‚| ¡ }|i krV|d | _|d | _|d | _|d | _ | jsn| j jrn| j j| _d S )Nz.Must use --sign for --identity to have meaningr r Ú repositoryÚrealm)r Úfinalize_optionsr r r Z_read_pypircr r r r Údistribution)r Zconfigr r r r 2 s ÿ zupload.finalize_optionsc C s: | j jsd}t|ƒ‚| j jD ]\}}}| |||¡ qd S )NzHMust create and upload files in one command (e.g. setup.py sdist upload))r Z dist_filesr Úupload_file)r ÚmsgÚcommandÚ pyversionÚfilenamer r r ÚrunD s z upload.runc " C s t | jƒ\}}}}}} |s"|s"| r0td| j ƒ‚|dvrDtd| ƒ‚| jr|ddd|g} | jrnd| jg| dd…<