3 (\@sddlmZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZdd lmZmZdd lmZejeZGd d d eZdS))absolute_importN) cmdoptions)RequirementCommand)RequirementPreparer)RequirementSet)RequirementTracker)Resolver)check_path_owner) ensure_dirnormalize_path) TempDirectorycs4eZdZdZdZdZdZfddZddZZ 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. downloada %prog [options] [package-index-options] ... %prog [options] -r [package-index-options] ... %prog [options] ... %prog [options] ... %prog [options] ...zDownload packages.c s|tt|j|||j}|jtj|jtj|jtj|jtj |jtj |jtj |jtj |jtj |jtj|jtj|jtj|jtj|jtj|jtj|jtj|jtj|jddddddtjdd|jtj|jtj|jtj|jtjtjtj|j}|jjd ||jjd |dS) Nz-dz--destz--destination-dirz--destination-directory download_dirdirzDownload packages into .)destmetavardefaulthelpr) superr __init__cmd_opts add_optionr constraints requirements build_dirno_depsglobal_options no_binary only_binaryZ prefer_binarysrcpreno_cleanrequire_hashes progress_barZno_build_isolationZ use_pep517Z no_use_pep517oscurdirplatformpython_versionimplementationabimake_option_group index_groupparserinsert_option_group)selfargskwr index_opts) __class__r/private/var/folders/pf/wv4htv3x0qs2c2mp0dnn0kchsvlck3/T/pip-build-k1a8l1r5/pip/pip/_internal/commands/download.pyr*sBzDownloadCommand.__init__c "Csd|_g|_|jr|jg}nd}tj|tjj|j|_t |j |_ t |j |j |,}|j |||j||j|jd}|jp|j }|jrt|j rtjd|jd|_t}t|j|dd}t|jd} |j| |||||jdt|j|j|j d|j|j|d} t | ||ddd d|j!dd|j"d } | j#| d j$d d | j%D} | r`tj&d| |jsp| j'WdQRXWdQRXWdQRX| S)NT)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.r)deletekind)r#)rsrc_dirrwheel_download_dirr$build_isolation req_trackerFzto-satisfy-only) preparerfinderr7 wheel_cache use_user_siteupgrade_strategyforce_reinstallignore_dependenciesignore_requires_pythonignore_installedisolated cSsg|] }|jqSr4)name).0reqr4r4r5 sz'DownloadCommand.run..zSuccessfully downloaded %s)(rG editablesr(rZcheck_dist_restrictionr%pathabspathr;r rr _build_session_build_package_finderr'r*r)r"r cache_dirr loggerwarningrr rr#populate_requirement_setrJrr$r=rrE isolated_moderesolvejoinsuccessfully_downloadedinfo cleanup_files) r/r6r0r8r7r@ build_deleter> directoryrequirement_setr?resolver downloadedr4r4r5runUs          &zDownloadCommand.run) __name__ __module__ __qualname____doc__rJusagesummaryrrb __classcell__r4r4)r3r5r s   +r ) __future__rloggingr%Zpip._internal.clirZpip._internal.cli.base_commandrZ pip._internal.operations.preparerZpip._internal.reqrZpip._internal.req.req_trackerrZpip._internal.resolverZpip._internal.utils.filesystemr Zpip._internal.utils.miscr r Zpip._internal.utils.temp_dirr getLoggerrcrTr r4r4r4r5s