a *žeg™ã@s²ddlZddlZddlmZddlmZddlmZddlm Z ddl m Z m Z ddl mZddlmZdd lmZdd lmZmZmZdd lmZe e¡ZGd d „d e ƒZdS)éN)ÚValues)ÚList)Ú cmdoptions)Úmake_target_python)ÚRequirementCommandÚ with_cleanup)ÚSUCCESS)Úget_build_tracker)Úcheck_legacy_setup_py_options)Ú ensure_dirÚnormalize_pathÚ write_output)Ú TempDirectoryc@s<eZdZdZdZddœdd„Zeeee e dœdd „ƒZ dS) Ú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] ...N)Úreturnc Cs\|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 ¡¡|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Úno_depsÚglobal_optionsÚ no_binaryÚ only_binaryÚ prefer_binaryÚsrcÚpreÚrequire_hashesÚ progress_barÚno_build_isolationÚ use_pep517Ú no_use_pep517Zcheck_build_depsÚignore_requires_pythonÚosÚcurdirÚadd_target_python_optionsÚmake_option_groupÚ index_groupÚparserÚinsert_option_group)ÚselfÚ index_opts©r1úI/usr/local/lib/python3.9/site-packages/pip/_internal/commands/download.pyÚ add_options&sBø þzDownloadCommand.add_options)ÚoptionsÚargsrc CsJd|_g|_t |¡t|jƒ|_t|jƒ| |¡}t|ƒ}|j ||||j d}|  t ƒ¡}t |j ddd}| ||||¡}t||ƒ|j||||||jd|jd} |j| |||j |j|jd} | |¡| j|dd} g} | j ¡D]4} | jdurê| jdusJ‚|  | ¡|  | j¡qê|  | j ¡¡| rFtd d   | ¡ƒt!S) NT)r4ÚsessionÚ target_pythonr'Údownload)ÚdeleteÚkindÚglobally_managedF)Útemp_build_dirr4Ú build_trackerr6ÚfinderrÚ use_user_siteÚ verbosity)Úpreparerr>r4r'r%Úpy_version_info)Úcheck_supported_wheelszSuccessfully downloaded %sú )"Úignore_installedÚ editablesrÚcheck_dist_restrictionr rr Úget_default_sessionrÚ_build_package_finderr'Ú enter_contextr rÚno_cleanÚget_requirementsr Úmake_requirement_preparerr@Ú make_resolverr%Úpython_versionÚtrace_basic_infoÚresolverÚvaluesÚ satisfied_byÚnameÚsave_linked_requirementÚappendÚ prepare_linked_requirements_morer Újoinr)r/r4r5r6r7r>r=Ú directoryÚreqsrAÚresolverÚrequirement_setÚ downloadedÚreqr1r1r2ÚrunMsf    ü ý ø ú   zDownloadCommand.run) Ú__name__Ú __module__Ú __qualname__Ú__doc__Úusager3rrrÚstrÚintr_r1r1r1r2rs  'r)Úloggingr(ÚoptparserÚtypingrZpip._internal.clirZpip._internal.cli.cmdoptionsrÚpip._internal.cli.req_commandrrÚpip._internal.cli.status_codesrZ,pip._internal.operations.build.build_trackerr Zpip._internal.req.req_installr Úpip._internal.utils.miscr r r Úpip._internal.utils.temp_dirrÚ getLoggerr`Úloggerrr1r1r1r2Ús