OwlCyberSecurity - MANAGER
Edit File: install.cpython-39.pyc
a )��e�} � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ d dl m Z mZmZ d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d d lmZmZmZ d d lmZmZ d dlmZm Z d dl!m"Z" d d l#m$Z$ d dl%m&Z& d dl'm(Z( d dl)m*Z* d dl+m,Z,m-Z- d dl.m/Z/ d dl0m1Z1m2Z2m3Z3 d dl4m5Z5 d dl6m7Z7m8Z8 d dl9m:Z: d dl;m<Z< d dl=m>Z> d dl?m@Z@mAZAmBZBmCZCmDZD d dlEmFZF d dlGmHZHmIZI d dlJmKZKmLZLmMZM e>eN�ZOe&eKd�dd�ZPG d d!� d!e�ZQd2eReeS eeS eReeS eeS d#�d$d%�ZTeeS eReRd&�d'd(�ZUd3eeR eeS eeS eeS eReRd)�d*d+�ZVee1 eeeS dd,�d-d.�ZWeXeReReSd/�d0d1�ZYdS )4� N)� SUPPRESS_HELP�Values)�Iterable�List�Optional)�canonicalize_name)� print_json)� WheelCache)� cmdoptions)�make_target_python)�RequirementCommand�warn_if_run_as_root�with_cleanup)�ERROR�SUCCESS)�CommandError�InstallationError)� get_scheme)�get_environment)� FormatControl)�InstallationReport)�get_build_tracker)�ConflictDetails�check_install_conflicts)�install_given_reqs)�InstallRequirement�LegacySetupPyOptionsCheckMode�check_legacy_setup_py_options)�WINDOWS)�#LegacyInstallReasonFailedBdistWheel� deprecated)�parse_distutils_args��test_writable_dir)� getLogger)�check_externally_managed� ensure_dir�get_pip_version�(protect_pip_from_modification_on_windows�write_output)� TempDirectory)�running_under_virtualenv�virtualenv_no_global)�BdistWheelAllowedPredicate�build� should_build_for_install_command)�format_control�returnc s t td�� fdd�}|S )N)�reqr1 c s t | jp d�}� �|�}d|v S )N� �binary)r �name�get_allowed_formats)r2 �canonical_nameZallowed_formats�r0 � �_/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/pip/_internal/commands/install.py�check_binary_allowedC s z;get_check_bdist_wheel_allowed.<locals>.check_binary_allowed)r �bool)r0 r; r9 r8 r: �get_check_bdist_wheel_allowed@ s r= c @ sz e Zd ZdZdZdd�dd�Zeeee e d�dd ��Ze ee dd �dd�Zee ee d �dd�Zee dd�dd�ZdS )�InstallCommandaI Install packages from: - PyPI (and other indexes) using requirement specifiers. - VCS project urls. - Local project directories. - Local or remote source archives. pip also supports installing from "requirements files", which provide an easy way to specify a whole environment to be installed. a% %prog [options] <requirement specifier> [package-index-options] ... %prog [options] -r <requirements file> [package-index-options] ... %prog [options] [-e] <vcs project url> ... %prog [options] [-e] <local project path> ... %prog [options] <archive url/path> ...N)r1 c C s� | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j jdddddd� | j jddd d d dd� t�| j � | j jd dddd� | j jdddt d� | j jddd d dd� | j jddd d dd� | j �t� � � | j jdddddd� | j jddddd gd!d"� | j jd#d$dd%d� | j jd&d'd(dd)d� | j �t�� � | j �t�� � | j �t� � � | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j jd*dd+d,d-d� | j jd.dd+d/d0� | j jd1dd2d,d3d� | j jd4dd5d,d6d� | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j �t�� � t�tj| j�}| j�d7|� | j�d7| j � | j jd8d9d:d d;d� d S )<Nz --dry-run� store_true�dry_runFz�Don't actually install anything, just print what would be. Can be used in combination with --ignore-installed to 'resolve' the requirements.)�action�dest�default�helpz-tz--target� target_dir�dirz�Install packages into <dir>. By default this will not replace existing files/folders in <dir>. Use --upgrade to replace existing packages in <dir> with new versions.)rB �metavarrC rD z--user� use_user_sitez�Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python documentation for site.USER_BASE for full details.))rB rA rD z --no-user�store_falsez--root� root_pathz=Install everything relative to this alternate root directory.z--prefix�prefix_pathzIInstallation prefix where lib, bin and other top-level folders are placedz-Uz --upgrade�upgradez�Upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.z--upgrade-strategy�upgrade_strategyzonly-if-neededZeageraG Determines how dependency upgrading should be handled [default: %default]. "eager" - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s). "only-if-needed" - are upgraded only when they do not satisfy the requirements of the upgraded package(s).)rB rC �choicesrD z--force-reinstall�force_reinstallz;Reinstall all packages even if they are already up-to-date.z-Iz--ignore-installed�ignore_installedz�Ignore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed with a different package manager!z --compile�compileTz'Compile Python source files to bytecodez--no-compilez.Do not compile Python source files to bytecode)rA rB rD z--no-warn-script-location�warn_script_locationz0Do not warn when installing scripts outside PATHz--no-warn-conflicts�warn_about_conflictsz%Do not warn about broken dependenciesr z--report�json_report_file�fileaW Generate a JSON file describing what pip did to install the provided requirements. Can be used in combination with --dry-run and --ignore-installed to 'resolve' the requirements. When - is used as file name it writes to stdout. When writing to stdout, please combine with the --quiet option to avoid mixing pip logging output with JSON output.)�cmd_opts� add_optionr �requirements�constraints�no_deps�pre�editable�add_target_python_optionsr �src�ignore_requires_python�no_build_isolation� use_pep517� no_use_pep517�check_build_deps�config_settings�install_options�global_options� no_binary�only_binary� prefer_binary�require_hashes�progress_bar�root_user_action�make_option_group�index_group�parser�insert_option_group)�selfZ index_optsr9 r9 r: �add_options_ s �� �������� ������zInstallCommand.add_options)�options�argsr1 c - sh |j r|jd urtd��|jo"|j oB|jd u oB|jd u oB|jd u }|rNt� d}|jr^|j }t j|dd� |jptg }t �dt� � t|j |j|j|j|jd�|_ d }d }|j�rd|_tj�|j�|_tj�|j�r�tj�|j�s�td��tdd �}|j}| �|� |j�pg }| �|�} t|�} | j|| | |jd �}| �t� �}t|j ddd�} �z�| �!|||| �}t"||t#j$� d |j%v �r�t&|j'�}n*|j(j)�r�t*ddd ddd� t&|j'|j(�}|D ]}d|_+�q�t,||j� | j-| ||| ||j | j.d�}| j/|||||j |j|j|j0||j1d� }| �2|� |j3||j d�}|j�r�t4|j5�}|jdk�rft6|�7� d� nHt8|jddd��&}t9j:|�7� |ddd� W d � n1 �s�0 Y |j�r�t;dd� |j5D ��}|�r�t<d d!�=d"d� |D ��� t>W S z|�?d#�}W n t@�y d}Y n0 |jAd u }tB|d$� tC|j(�� � fd%d&�|jD�E� D �}tF||dg |d'�\}}d(d&� |D �}|�r�tGd)�Hd*�=|����|D ]}|j1�s�tI|_J�q�|�K|�}d }|jL �o�|jM} | �r�| �N|�}|jO}!|j�s�|j�r�d}!tP||||j||j|!|j |jQd+� }"tR|j ||j|j|jd,�}#tS|#�}$|"jTtU�Vd-�d.� g }%|"D ]T}&|&jW}'z(|$�X|'�}(|(d u�r||'� d|(jY� �}'W n tZ�y� Y n0 |%�[|'� �qL|d u�r�| j\|| �]|�d/� d!�=|%�})|)�r�t<d0|)� W nP t^�y, }* z6| j.d1k}+t_|*|+|j �},t j`|,|+d2� taW Y d }*~*S d }*~*0 0 |j�rR|�s@J �| �b|j||j� |jcd3k�rdtd� t>S )4Nz'Can not combine '--user' and '--target'zto-satisfy-onlyT)�check_targetzUsing %s)rK rE rJ � isolated_modez=Target path exists but is not a directory, will not continue.�target)�kind)rs �session� target_pythonr_ �install)�deleterx �globally_managedzno-binary-enable-wheel-cachez�--no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache.z to use the --no-cache-dir optioni�, z23.1)�reason�replacement�feature_flag�issue�gone_in)Ztemp_build_dirrs � build_trackerry �finderrH � verbosity) �preparerr� rs �wheel_cacherH rP r_ rO rM ra )Zcheck_supported_wheels�-)�data�wzutf-8)�encoding� F)�indent�ensure_asciic s s"