3 Bu_6@sddlmZddlZddlZddlmZddlmZddlm Z m Z ddl m Z ddl mZddlmZmZmZdd lmZdd lmZerdd lmZdd lmZejeZGd dde ZdS))absolute_importN) cmdoptions)make_target_python)RequirementCommand with_cleanup)SUCCESS)get_requirement_tracker) ensure_dirnormalize_path write_output) TempDirectory)MYPY_CHECK_RUNNING)Values)Listc@s(eZdZdZdZddZeddZdS)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. a %prog [options] [package-index-options] ... %prog [options] -r [package-index-options] ... %prog [options] ... %prog [options] ... %prog [options] ...c CsL|jjtj|jjtj|jjtj|jjtj|jjtj|jjtj|jjtj |jjtj |jjtj |jjtj |jjtj |jjtj|jjtj|jjtj|jjtj|jjddddddtjddtj|jtjtj|j}|jjd ||jjd |jdS) Nz-dz--destz--destination-dirz--destination-directory download_dirdirzDownload packages into .)destmetavardefaulthelpr)cmd_opts add_optionr constraints requirements build_dirno_depsglobal_options no_binary only_binary prefer_binarysrcprerequire_hashes progress_barno_build_isolation use_pep517 no_use_pep517oscurdiradd_target_python_optionsmake_option_group index_groupparserinsert_option_group)self index_optsr1/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-1.el7.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/download.py add_options*s6 zDownloadCommand.add_optionsc Csd|_g|_tj|t|j|_t|j|j|}t|}|j |||d}|j pX|j }|j t }t|j |ddd}|j||||} |j||||||jdd} |j| |||jd} |j|| j| dd} d jd d | jjD} | rtd | tS) NT)optionssession target_pythondownload)deletekindglobally_managedF)temp_build_dirr4 req_trackerr5finderr use_user_site)preparerr=r4py_version_info)check_supported_wheels cSsg|]}|jr|jqSr1)successfully_downloadedname).0reqr1r1r2 sz'DownloadCommand.run..zSuccessfully downloaded %s)ignore_installed editablesrcheck_dist_restrictionr rr get_default_sessionr_build_package_finderno_cleanr enter_contextrr get_requirementsmake_requirement_preparer make_resolverpython_versiontrace_basic_inforesolvejoinrvaluesr r)r/r4argsr5r6r= build_deleter< directoryreqsr?resolverrequirement_set downloadedr1r1r2runNsP          zDownloadCommand.runN)__name__ __module__ __qualname____doc__usager3rr^r1r1r1r2rs $r) __future__rloggingr(Zpip._internal.clirZpip._internal.cli.cmdoptionsrpip._internal.cli.req_commandrrpip._internal.cli.status_codesrpip._internal.req.req_trackerrpip._internal.utils.miscr r r pip._internal.utils.temp_dirr pip._internal.utils.typingr optparsertypingr getLoggerr_loggerrr1r1r1r2s