관리-도구
편집 파일: pip_invoke.cpython-38.pyc
U *�e� � @ sr d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl m Z d dlmZm Z mZ G dd � d e �Zd gZdS ) � )�annotationsN)�contextmanager)�Popen)�LogCmd)� BaseEmbed)�Version� get_wheel�pip_wheel_env_runc sB e Zd Zdd�� fdd�Zdd� Zedd� �Zed d � �Z� Z S )� PipInvoke�None)�returnc s t � �|� d S �N)�super�__init__)�self�options�� __class__� �N/opt/hc_python/lib/python3.8/site-packages/virtualenv/seed/embed/pip_invoke.pyr s zPipInvoke.__init__c C sN | j s d S |jj}| �|j|��$}t| j| j| j�}| � ||� W 5 Q R X d S r ) �enabled�interpreterZversion_release_str�get_pip_install_cmd�exer �extra_search_dir�app_data�env�_execute)r Zcreator�for_py_version�cmdr r r r �run s z PipInvoke.runc C sH t �dt| |�� t| |d�}|�� |jdkrDd|j� �}t|��|S )Nzpip seed by running: %s)r r zfailed seed with code )�logging�debugr r �communicate� returncode�RuntimeError)r r �process�msgr r r r s zPipInvoke._executec c s� t |�dddddddg}| js(|�d� t� }| �� �� D ]h\}}t|||| jd | j| j | j d �}|d kr|d|� �}t|��|�t |j j�� |�t�||j�� q:t|�D ]} |�dt | �g� q�|V d S ) Nz-m�pipz-q�installz --only-binaryz:all:z--disable-pip-version-checkz --no-indexF)�distribution�versionr Zsearch_dirs�downloadr Zdo_periodic_updater z%could not get wheel for distribution z--find-links)�strr, �append�setZdistribution_to_versions�itemsr r r Zperiodic_updater r% �add�path�parentr Z as_pip_reqr+ �sorted�extend) r r r r �folders�distr+ �wheelr'