U ÀÒ.eÉã@s¢ddlmZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZmZmZdd lmZe e¡ZGd d „d e ƒZdS) é)Úabsolute_importN)Ú cmdoptions)Úmake_target_python)ÚRequirementCommand)ÚRequirementSet)ÚRequirementTracker)Úcheck_path_owner)Ú ensure_dirÚnormalize_pathÚ write_output)Ú TempDirectorycs,eZdZdZdZ‡fdd„Zdd„Z‡ZS)Ú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 sNtt|ƒj||Ž|j}| t ¡¡| t ¡¡| t ¡¡| t  ¡¡| t  ¡¡| t  ¡¡| t  ¡¡| t  ¡¡| t ¡¡| t ¡¡| t ¡¡| t ¡¡| t ¡¡| t ¡¡| t ¡¡| t ¡¡|jddddddtjddt |¡t tj|j¡}|j d |¡|j d |¡dS) Nz-dz--destz--destination-dirz--destination-directoryÚ download_dirÚdirzDownload packages into .)ÚdestÚmetavarÚdefaultÚhelpr)Úsuperr Ú__init__Úcmd_optsZ add_optionrZ constraintsZ requirementsÚ build_dirZno_depsZglobal_optionsZ no_binaryZ only_binaryZ prefer_binaryÚsrcZpreÚno_cleanÚrequire_hashesZ progress_barZno_build_isolationZ use_pep517Z no_use_pep517ÚosÚcurdirZadd_target_python_optionsZmake_option_groupZ index_groupÚparserZinsert_option_group)ÚselfÚargsÚkwrZ index_opts©Ú __class__©úC/usr/lib/python3.8/site-packages/pip/_internal/commands/download.pyr)sFû þzDownloadCommand.__init__c CsLd|_g|_t |¡tj |j¡|_t|j ƒ|_ t |j ƒ|  |¡}t |ƒ}|j |||d}|jph|j }|jrt|jƒst d|j¡d|_tƒ¬}t|j|dd}t|jd} | | ||||d¡|j||||j d} |j| ||||jd} |  | ¡d  d d „| jDƒ¡} | r$td | ƒ|js4|   ¡W5QRXW5QRX| S) NT)ÚoptionsÚsessionÚ target_pythonzÝThe 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.Zdownload)ÚdeleteZkind)r)Ztemp_build_dirr%Ú req_trackerr)ÚpreparerÚfinderr&r%Zpy_version_infoú cSsg|] }|j‘qSr#)Úname)Ú.0Zreqr#r#r$Ú ’sz'DownloadCommand.run..zSuccessfully downloaded %s)!Zignore_installedZ editablesrZcheck_dist_restrictionrÚpathÚabspathZsrc_dirr rr Zget_default_sessionrZ_build_package_finderrrÚ cache_dirrÚloggerZwarningrr rrZpopulate_requirement_setZmake_requirement_preparerZ make_resolverZpython_versionZresolveÚjoinZsuccessfully_downloadedr Z cleanup_files) rr%rr&r'r+Z build_deleter)Z directoryZrequirement_setr*ZresolverZ downloadedr#r#r$ÚrunQsv    ýú ÿÿú üû  ÿ zDownloadCommand.run)Ú__name__Ú __module__Ú __qualname__Ú__doc__Zusagerr5Ú __classcell__r#r#r!r$r s  (r )Z __future__rZloggingrZpip._internal.clirZpip._internal.cli.cmdoptionsrZpip._internal.cli.req_commandrZpip._internal.reqrZpip._internal.req.req_trackerrZpip._internal.utils.filesystemrZpip._internal.utils.miscr r r Zpip._internal.utils.temp_dirr Z getLoggerr6r3r r#r#r#r$Ús