shell bypass 403
U
��.e~S � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZddlm Z ddl
mZ ddl
mZ ddlmZ ddlmZmZmZmZmZmZ dd lmZmZ dd
lmZ ddlmZ e�rddlm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) dd
l*m+Z+ ddlm,Z, ddlm-Z- e'e%e. e%e. f Z/dgZ0e�1e2�Z3dd� Z4ddd�Z5dd� Z6G dd� de7�Z8G dd� de9�Z:G dd� de9�Z;e;� Z<G dd� de9�Z=dS ) z)Handles all VCS (version control) support� )�absolute_importN)�
pkg_resources)�parse)�
BadCommand)�samefile)�ask_path_exists�
backup_dir�display_path�hide_url�
hide_value�rmtree)�call_subprocess�make_command)�MYPY_CHECK_RUNNING)�get_url_scheme)
�Any�Dict�Iterable�List�Mapping�Optional�Text�Tuple�Type�Union)�SpinnerInterface)�
HiddenText)�CommandArgs�vcsc C s* t | �}|dkrdS |ddddgtj kS )z3
Return true if the name looks like a URL.
NFZhttpZhttps�fileZftp)r r �all_schemes)�name�scheme� r# �D/usr/lib/python3.8/site-packages/pip/_internal/vcs/versioncontrol.py�is_url0 s r% c C s. t �|�}d�| ||�}|r*|d�|�7 }|S )z�
Return the URL for a VCS requirement.
Args:
repo_url: the remote VCS url, with any needed VCS prefix (e.g. "git+").
project_name: the (unescaped) project name.
z{}@{}#egg={}z&subdirectory={})r Zto_filename�format)�repo_url�rev�project_name�subdirZegg_project_name�reqr# r# r$ �make_vcs_requirement_url; s
r, c C s` | }t j�t j�| d��sD| }t j�| �} | |krt�d|� dS qt|| �rRdS t j�| |�S )z�
Find the path to `setup.py` by searching up the filesystem from `location`.
Return the path to `setup.py` relative to `repo_root`.
Return None if `setup.py` is in `repo_root` or cannot be found.
zsetup.pyzGCould not find setup.py for directory %s (tried all parent directories)N) �os�path�exists�join�dirname�logger�warningr �relpath)�locationZ repo_rootZ
orig_locationZ
last_locationr# r# r$ �!find_path_to_setup_from_repo_rootK s �
r6 c @ s e Zd ZdS )�RemoteNotFoundErrorN)�__name__�
__module__�__qualname__r# r# r# r$ r7 f s r7 c @ sF e Zd ZdZddd�Zdd� Zedd� �Zd d
� Zdd� Z d
d� Z
dS )�
RevOptionsz�
Encapsulates a VCS-specific revision to install, along with any VCS
install options.
Instances of this class should be treated as if immutable.
Nc C s( |dkrg }|| _ || _|| _d| _dS )z�
Args:
vc_class: a VersionControl subclass.
rev: the name of the revision to install.
extra_args: a list of extra options.
N)�
extra_argsr( �vc_classZbranch_name)�selfr= r( r<