<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
Pf                 @   s   d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZmZ d d	lmZ d d
lmZ ejeZG dd deZdS )    )absolute_importN)CommandError)FormatControl)RequirementSet)RequirementCommand)
cmdoptions)
ensure_dirnormalize_path)BuildDirectory)check_path_ownerc                   s4   e Zd ZdZdZdZdZ fddZdd Z  Z	S )	DownloadCommandaL  
    Download packages from:

    - PyPI (and other indexes) using requirement specifiers.
    - VCS project urls.
    - Local project directories.
    - Local or remote source archives.

    pip also supports downloading from "requirements files", which provide
    an easy way to specify a whole environment to be downloaded.
    Zdownloada%  
      %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> ...zDownload packages.c          
      s\  t t| j|| | j}|jtj  |jtj  |jtj  |jtj	  |jtj
  |jtj  |jtj  |jtj  |jtj  |jtj  |jtj  |jtj  |jddddddtjdd |jd	d
d
d dd |jdddd dd |jdddd dd |jdddd dd tjtj| j}| jjd| | jjd| d S )Nz-dz--destz--destination-dirz--destination-directorydownload_dirdirzDownload packages into <dir>.)destmetavardefaulthelpz
--platformplatformz`Only download wheels compatible with <platform>. Defaults to the platform of the running system.z--python-versionpython_versiona&  Only download wheels compatible with Python interpreter version <version>. If not specified, then the current system interpreter minor version is used. A major version (e.g. '2') can be specified to match all minor revs of that major version.  A minor version (e.g. '34') can also be specified.z--implementationimplementationzOnly download wheels compatible with Python implementation <implementation>, e.g. 'pp', 'jy', 'cp',  or 'ip'. If not specified, then the current interpreter implementation is used.  Use 'py' to force implementation-agnostic wheels.z--abiabizOnly download wheels compatible with Python abi <abi>, e.g. 'pypy_41'.  If not specified, then the current interpreter abi tag is used.  Generally you will need to specify --implementation, --platform, and --python-version when using this option.r   )superr   __init__cmd_optsZ
add_optionr   ZconstraintsZeditableZrequirements	build_dirZno_depsZglobal_optionsZ	no_binaryZonly_binarysrcZpreno_cleanrequire_hashesoscurdirZmake_option_groupZnon_deprecated_index_groupparserZinsert_option_group)selfargskwr   Z
index_opts)	__class__ /usr/lib/python3.6/download.pyr   *   sb    zDownloadCommand.__init__c             C   s  d|_ |jr|jg}nd }t|j|j|j|jg}tt tdg}|rZ|j|krZt	dt
jj|j|_t|j|_t|j | j|}| j|||j||j|jd}|jp|j }|jrt|j rtjd|j d |_t|j|d}	t|	|j|jd|j||j|jd}
| j|
||||| jd  |
j s2d S |
j!| dj"d	d
 |
j#D }|rdtj$d| |jst|
j%  W d Q R X W d Q R X |
S )NTz:all:z--only-binary=:all: must be set and --no-binary must not be set (or must be set to :none:) when restricting platform and interpreter constraints using --python-version, --platform, --abi, or --implementation.)optionssessionr   python_versionsr   r   zThe directory '%s' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.)delete)r   src_dirr   ignore_installedignore_dependenciesr(   isolatedr    c             S   s   g | ]
}|j qS r%   )name).0Zreqr%   r%   r&   
<listcomp>   s    z'DownloadCommand.run.<locals>.<listcomp>zSuccessfully downloaded %s)&r,   r   anyr   r   r   r   setZformat_controlr   r   pathabspathr+   r	   r   r   Z_build_sessionZ_build_package_finderr   r   	cache_dirr   loggerZwarningr
   r   r-   Zisolated_moder   Zpopulate_requirement_setr0   Zhas_requirementsZprepare_filesjoinZsuccessfully_downloadedinfoZcleanup_files)r!   r'   r"   r)   Zdist_restriction_setZbinary_onlyr(   finderZbuild_deleter   Zrequirement_setZ
downloadedr%   r%   r&   run{   sx    






zDownloadCommand.run)
__name__
__module____qualname____doc__r0   ZusageZsummaryr   r<   __classcell__r%   r%   )r$   r&   r      s   Qr   )Z
__future__r   Zloggingr   Zpip.exceptionsr   Z	pip.indexr   Zpip.reqr   Zpip.basecommandr   Zpipr   Z	pip.utilsr   r	   Zpip.utils.buildr
   Zpip.utils.filesystemr   Z	getLoggerr=   r8   r   r%   r%   r%   r&   <module>   s   
