o 0i @ s d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZm Z d dl mZ d dlm Z mZ d dlmZ d dlmZ d d lmZ eed deeddeeddd ZG dd deZdS ) N)standard_b64encode) HTTPError)urlopenRequest)urlparse)DistutilsErrorDistutilsOptionError) 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)signszsign 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_optionsusernamepassword show_responser identity)self r ?/opt/alt/python310/lib64/python3.10/distutils/command/upload.pyr * s zupload.initialize_optionsc C sz t | | jr| jstd| }|i kr+|d | _|d | _|d | _|d | _ | js9| j jr;| j j| _d S d S d S )Nz.Must use --sign for --identity to have meaningr r repositoryrealm)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 js d}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 msgcommand pyversionfilenamer r r runD s z upload.runc " C s> t | j\}}}}}} |s|s| rtd| j |dvr"td| | jr>ddd|g} | jr7d| jg| dd<