3
Pf @ s d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
d dlmZmZ d d lmZ d d
lmZ ejeZG dd deZdS )
)absolute_importN)CommandError)
FormatControl)RequirementSet)RequirementCommand)
cmdoptions)
ensure_dirnormalize_path)BuildDirectory)check_path_ownerc s4 e Zd ZdZdZdZdZ fddZdd 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.
Zdownloada%
%prog [options] [package-index-options] ...
%prog [options] -r [package-index-options] ...
%prog [options] [-e] ...
%prog [options] [-e] ...
%prog [options] ...zDownload packages.c
s\ t t| j|| | j}|jtj |jtj |jtj |jtj |jtj
|jtj |jtj |jtj
|jtj |jtj |jtj |jtj |jddddddtjdd |jd d
d
d dd |jdd
d
d dd |jdddd dd |jdddd dd tjtj| j}| jjd| | jjd| d S )Nz-dz--destz--destination-dirz--destination-directorydownload_dirdirzDownload packages into .)destmetavardefaulthelpz
--platformplatformz`Only download wheels compatible with . Defaults to the platform of the running system.z--python-versionpython_versiona& Only download wheels compatible with Python interpreter 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--implementationimplementationzOnly download wheels compatible with Python 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--abiabizOnly download wheels compatible with Python 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 ZconstraintsZeditableZrequirements build_dirZno_depsZglobal_optionsZ no_binaryZonly_binarysrcZpreno_cleanrequire_hashesoscurdirZmake_option_groupZnon_deprecated_index_groupparserZinsert_option_group)selfargskwr Z
index_opts) __class__ /usr/lib/python3.6/download.pyr * sb zDownloadCommand.__init__c C s d|_ |jr|jg}nd }t|j|j|j|jg}tt tdg}|rZ|j|krZt dt
jj|j
|_
t|j|_t|j | j|}| j|||j||j|jd}|jp|j }|jrt|j rtjd|j d |_t|j|d} t| |j
|jd|j||j|jd}
| j|
||||| jd |
j s2d S |
j!| dj"d d
|
j#D }|rdtj$d| |jst|
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.)optionssessionr 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_installedignore_dependenciesr( isolatedr c S s g | ]
}|j qS r% )name).0Zreqr% r% r&