B š•Re6ã@sÂddlmZddlZddlZddlmZddlmZddlm Z m Z ddl m Z ddl mZddlmZmZmZdd lmZdd lmZer¤dd lmZdd lmZe e¡ZGd d„de ƒZdS)é)Úabsolute_importN)Ú cmdoptions)Úmake_target_python)ÚRequirementCommandÚ with_cleanup)ÚSUCCESS)Úget_requirement_tracker)Ú ensure_dirÚnormalize_pathÚ write_output)Ú TempDirectory)ÚMYPY_CHECK_RUNNING)ÚValues)ÚListc@s(eZdZdZdZdd„Zedd„ƒZdS)Ú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|j t ¡¡|j t ¡¡|j t ¡¡|j t ¡¡|j t ¡¡|j t ¡¡|j t  ¡¡|j t  ¡¡|j t  ¡¡|j t  ¡¡|j t  ¡¡|j t ¡¡|j t ¡¡|j t ¡¡|j t ¡¡|jjddddddtjddt |j¡t tj|j¡}|j d |¡|j d |j¡dS) Nz-dz--destz--destination-dirz--destination-directoryÚ download_dirÚdirzDownload packages into .)ÚdestÚmetavarÚdefaultÚhelpr)Úcmd_optsÚ add_optionrÚ constraintsÚ requirementsÚ build_dirÚno_depsÚglobal_optionsÚ no_binaryÚ only_binaryÚ prefer_binaryÚsrcÚpreÚrequire_hashesÚ progress_barÚno_build_isolationÚ use_pep517Ú no_use_pep517ÚosÚcurdirÚadd_target_python_optionsÚmake_option_groupÚ index_groupÚparserÚinsert_option_group)ÚselfÚ index_opts©r1úŽ/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/commands/download.pyÚ add_options*s6 zDownloadCommand.add_optionsc Csüd|_g|_t |¡t|jƒ|_t|jƒ| |¡}t|ƒ}|j |||d}|j pX|j }|  t ƒ¡}t|j |ddd}| ||||¡} |j||||||jdd} |j| |||jd} | |¡| j| dd} d  d d „| j ¡Dƒ¡} | røtd | ƒtS) NT)ÚoptionsÚsessionÚ target_pythonÚdownload)ÚdeleteÚkindÚglobally_managedF)Útemp_build_dirr4Ú req_trackerr5ÚfinderrÚ use_user_site)Úpreparerr=r4Úpy_version_info)Úcheck_supported_wheelsú cSsg|]}|jr|j‘qSr1)Úsuccessfully_downloadedÚname)Ú.0Úreqr1r1r2ú ‰sz'DownloadCommand.run..zSuccessfully downloaded %s)Úignore_installedÚ editablesrÚcheck_dist_restrictionr rr Úget_default_sessionrÚ_build_package_finderÚno_cleanrÚ enter_contextrr Úget_requirementsÚmake_requirement_preparerÚ make_resolverÚpython_versionÚtrace_basic_infoÚresolveÚjoinrÚvaluesr r)r/r4Úargsr5r6r=Ú build_deleter<Ú directoryÚreqsr?ÚresolverÚrequirement_setÚ downloadedr1r1r2ÚrunNsP          zDownloadCommand.runN)Ú__name__Ú __module__Ú __qualname__Ú__doc__Úusager3rr^r1r1r1r2rs $r)Ú __future__rÚloggingr(Zpip._internal.clirZpip._internal.cli.cmdoptionsrÚpip._internal.cli.req_commandrrÚpip._internal.cli.status_codesrÚpip._internal.req.req_trackerrÚpip._internal.utils.miscr r r Úpip._internal.utils.temp_dirr Úpip._internal.utils.typingr ÚoptparserÚtypingrÚ getLoggerr_Úloggerrr1r1r1r2Ús