Your IP : 216.73.217.129


Current Path : /opt/alt/python37/lib64/python3.7/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/Tools/scripts/__pycache__/verify_ensurepip_wheels.cpython-37.pyc

B

� f{�@s�dZddlZddlZddlZddlZddlmZddlmZdZ	ee
�jjjdZedZ
edjd	d
�Ze�d�dkZeedd
�dd�Zeedd
�dd�Zeed�dd�Zedkr�dZxe	D]Zee�s�dZq�Wee��dS)a
Compare checksums for wheels in :mod:`ensurepip` against the Cheeseshop.

When GitHub Actions executes the script, output is formatted accordingly.
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message
�N)�Path)�urlopen)ZpipZ
setuptoolsz
Lib/ensurepipZ_bundledz__init__.pyzutf-8)�encoding�GITHUB_ACTIONS�true)�	file_path�message�returncCs$trd|�d|��}t|dd�dS)Nz::notice file=z::z

)�end)r�print)rr�r�J/opt/alt/python37/lib64/python3.7/Tools/scripts/verify_ensurepip_wheels.py�print_noticesrcCs$trd|�d|��}t|dd�dS)Nz
::error file=z::z

)r
)rr)rrrrr
�print_errorsr)�package_namer	c		Csztt�|�d��d�}|s0tdd|�d��dStd|�d��t�d|���d	�t�}|srt|d
|�d��dS|d}yt	d
|�d���
�}Wn*ttfk
r�t|d|�d��dSXt
�|�d|}xD|D]&}|j|dkr�q�|d�dd�}Pq�Wt|d|�d��dSt�|�����}td|���td|���||k�rdt|d|�d��dSt|d|�d��dS)Nz*.whl�zCould not find a z wheel on disk.FzVerifying checksum for �.�_z_VERSION = "([^"]+)zNo z, version found in Lib/ensurepip/__init__.py.�zhttps://pypi.org/pypi/z/jsonz"Could not fetch JSON metadata for Zreleases�filenameZdigests�sha256zNo digest for z found from PyPI.zExpected digest: zActual digest:   z%Failed to verify the checksum of the z wheel.z*Successfully verified the checksum of the T)�next�	WHEEL_DIRZglobrr�re�search�upper�ENSURE_PIP_INIT_PY_TEXTr�read�OSError�
ValueError�json�loads�name�get�hashlibrZ
read_bytesZ	hexdigestr)	rZpackage_pathZpackage_version_matchZpackage_versionZraw_textZ
release_filesZrelease_infoZexpected_digestZ
actual_digestrrr
�verify_wheel$sJ

r%�__main__r)�__doc__r$r �osrZpathlibrZurllib.requestrZ
PACKAGE_NAMES�__file__�parentZENSURE_PIP_ROOTrZ	read_textr�getenvr�strrr�boolr%�__name__Zexit_statusr�
SystemExitrrrr
�<module>s(9