U Ù üeã@sxddlmZddlmmZddlZddlZddlZddl Z ddl m Z ddl Z e Zd dd„ZGdd „d e ejƒZdS) é)ÚlogNé)Úsdist_add_defaultsÚccs,t d¡D]}| ¡|ƒD] }|Vqq dS)z%Find all files under revision controlzsetuptools.file_findersN)Ú pkg_resourcesÚiter_entry_pointsÚload)ÚdirnameÚepÚitem©r úF/opt/hc_python/lib/python3.8/site-packages/setuptools/command/sdist.pyÚ walk_revctrlsrcsÆeZdZdZdddddgZiZddd d gZed d „eDƒƒZd d„Z dd„Z dd„Z dd„Z e ejdd„ƒƒZ‡fdd„Zdd„Zdd„Zdd„Z‡fdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Z‡ZS))Úsdistz=Smart sdist that finds anything supported by revision control)zformats=Nz6formats for source distribution (comma-separated list))z keep-tempÚkz@keep the distribution tree around after creating archive file(s))z dist-dir=ÚdzFdirectory to put the source distribution archive(s) in [default: dist])zowner=Úuz@Owner name used when creating a tar file [default: current user])zgroup=ÚgzAGroup name used when creating a tar file [default: current group]rz.rstz.txtz.mdccs|]}d |¡VqdS)z README{0}N)Úformat)Ú.0Úextr r r Ú +szsdist.cCs–| d¡| d¡}|j|_|j tj |jd¡¡| ¡|  ¡D]}| |¡qD|  ¡t |j dgƒ}|j D] }dd|f}||krp| |¡qpdS)NÚegg_infoz SOURCES.txtÚ dist_filesrr)Ú run_commandÚget_finalized_commandÚfilelistÚappendÚosÚpathÚjoinrÚ check_readmeÚget_sub_commandsÚmake_distributionÚgetattrÚ distributionZ archive_files)ÚselfZei_cmdÚcmd_namerÚfileÚdatar r r Úrun-s      z sdist.runcCstj |¡| ¡dS©N)ÚorigrÚinitialize_optionsÚ_default_to_gztar©r&r r r r-@s zsdist.initialize_optionscCstjdkrdSdg|_dS)N)éérÚbetarÚgztar)ÚsysÚ version_infoÚformatsr/r r r r.Es zsdist._default_to_gztarc Cs$| ¡tj |¡W5QRXdS)z% Workaround for #516 N)Ú_remove_os_linkr,rr#r/r r r r#Ks zsdist.make_distributionc cs^Gdd„dƒ}ttd|ƒ}zt`Wntk r6YnXz dVW5||k rXttd|ƒXdS)zG In a context, remove and restore os.link if it exists c@s eZdZdS)z&sdist._remove_os_link..NoValueN)Ú__name__Ú __module__Ú __qualname__r r r r ÚNoValueYsr;ÚlinkN)r$rr<Ú ExceptionÚsetattr)r;Zorig_valr r r r7Rs  zsdist._remove_os_linkcs&tƒ ¡tj d¡r"|j d¡dS)Nzpyproject.toml)ÚsuperÚ_add_defaults_optionalrrÚisfilerrr/©Ú __class__r r r@gs  zsdist._add_defaults_optionalcCs8|j ¡r4| d¡}|j | ¡¡| | |¡¡dS)zgetting python filesÚbuild_pyN)r%Úhas_pure_modulesrrÚextendZget_source_filesÚ_add_data_filesÚ_safe_data_files©r&rDr r r Ú_add_defaults_pythonls  zsdist._add_defaults_pythoncCs|jjr dS|jS)z¶ Extracting data_files from build_py is known to cause infinite recursion errors when `include_package_data` is enabled, so suppress it in that case. r )r%Zinclude_package_dataÚ data_filesrIr r r rHsszsdist._safe_data_filescCs|j dd„|Dƒ¡dS)zA Add data files as found in build_py.data_files. css.|]&\}}}}|D]}tj ||¡VqqdSr+)rrr )rÚ_Úsrc_dirÚ filenamesÚnamer r r rs þz(sdist._add_data_files..N)rrF)r&rKr r r rG}s þzsdist._add_data_filescs2ztƒ ¡Wntk r,t d¡YnXdS)Nz&data_files contains unexpected objects)r?Ú_add_defaults_data_filesÚ TypeErrorrÚwarnr/rBr r rP‡szsdist._add_defaults_data_filescCs8|jD]}tj |¡rdSq| dd |j¡¡dS)Nz,standard file not found: should have one of z, )ÚREADMESrrÚexistsrRr )r&Úfr r r r!s   ÿÿzsdist.check_readmecCs^tj |||¡tj |d¡}ttdƒrJtj |¡rJt |¡|  d|¡|  d¡  |¡dS)Nz setup.cfgr<r) r,rÚmake_release_treerrr ÚhasattrrTÚunlinkÚ copy_filerZsave_version_info)r&Úbase_dirÚfilesÚdestr r r rV—s   zsdist.make_release_treec Cs@tj |j¡sdSt |jd¡}| ¡}W5QRX|d ¡kS)NFÚrbz+# file GENERATED by distutils, do NOT edit )rrrAÚmanifestÚioÚopenÚreadlineÚencode)r&ÚfpÚ first_liner r r Ú_manifest_is_not_generated¤sÿz sdist._manifest_is_not_generatedc CsŠt d|j¡t|jdƒ}|D]^}z| d¡}Wn&tk rVt d|¡YqYnX| ¡}| d¡s|spq|j   |¡q|  ¡dS)zªRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. zreading manifest file '%s'r]zUTF-8z"%r not UTF-8 decodable -- skippingú#N) rÚinfor^r`ÚdecodeÚUnicodeDecodeErrorrRÚstripÚ startswithrrÚclose)r&r^Úliner r r Ú read_manifest®s  zsdist.read_manifest)r8r9r:Ú__doc__Ú user_optionsÚ negative_optZREADME_EXTENSIONSÚtuplerSr*r-r.r#Ú staticmethodÚ contextlibÚcontextmanagerr7r@rJrHrGrPr!rVrernÚ __classcell__r r rBr rs4õ        r)r)Ú distutilsrZdistutils.command.sdistÚcommandrr,rr4r_rtZ py36compatrrÚlistZ_default_revctrlrr r r r Ús