a Ðöøcœã@sˆddlmZddlmmZddlZddlZddlZddl Z ddl m Z m Z ddl mZddlZeZd dd„ZGd d „d eejƒZdS) é)ÚlogN)ÚsixÚ ordered_seté)Ú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úe/workspaces/shunt/resources/test-fastapi/venv/lib/python3.9/site-packages/setuptools/command/sdist.pyÚ walk_revctrlsrcseZdZdZgd¢ZiZgd¢Zedd„eDƒƒZdd„Z dd „Z d d „Z d d „Z e ejdd„ƒƒZdd„Zejdkp¨dejkoŠdknp¨dejko¤dknZer²eZ‡fdd„Zdd„Zdd„Zdd„Z‡fdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Z‡Z S)+Ú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])rz.rstz.txtz.mdccs|]}d |¡VqdS)z README{0}N)Úformat)Ú.0ÚextrrrÚ )ózsdist.cCs–| d¡| d¡}|j|_|j tj |jd¡¡| ¡|  ¡D]}| |¡qD|  ¡t |j dgƒ}|j D] }dd|f}||vrp| |¡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ÚdatarrrÚrun+s      z sdist.runcCstj |¡| ¡dS©N)ÚorigrÚinitialize_optionsÚ_default_to_gztar©r'rrrr.>s zsdist.initialize_optionscCstjdkrdSdg|_dS)N)éérÚbetarÚgztar)ÚsysÚ version_infoÚformatsr0rrrr/Cs zsdist._default_to_gztarcCs8| ¡tj |¡Wdƒn1s*0YdS)z% Workaround for #516 N)Ú_remove_os_linkr-rr$r0rrrr$Is zsdist.make_distributionc cspGdd„dƒ}ttd|ƒ}zt`Wnty4Yn0zdVW||urlttd|ƒn||urjttd|ƒ0dS)zG In a context, remove and restore os.link if it exists c@s eZdZdS)z&sdist._remove_os_link..NoValueN)Ú__name__Ú __module__Ú __qualname__rrrrÚNoValueWsr<ÚlinkN)r%rr=Ú ExceptionÚsetattr)r<Zorig_valrrrr8Ps  ÿzsdist._remove_os_linkcCsJztj |¡Wn4tyDt ¡\}}}|jjjd  ¡‚Yn0dS)NÚtemplate) r-rÚ read_templater>r5Úexc_infoÚtb_nextÚtb_frameÚf_localsÚclose)r'Ú_ÚtbrrrZ__read_template_hackes  zsdist.__read_template_hack)éérI)r1r)r1ré)r1rI)r1rIrcs8tjrt |¡n tƒ ¡tj d¡r4|j  d¡dS)Nzpyproject.toml) rÚPY2rÚ_add_defaults_optionalÚsuperrr Úisfilerrr0©Ú __class__rrrM|s    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'rRrrrÚ_add_defaults_python„s  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_filesrWrrrrV‹szsdist._safe_data_filescCs|j dd„|Dƒ¡dS)zA Add data files as found in build_py.data_files. css.|]&\}}}}|D]}tj ||¡VqqdSr,)rr r!)rrGÚsrc_dirÚ filenamesÚnamerrrr™s þz(sdist._add_data_files..N)rrT)r'rYrrrrU•s þzsdist._add_data_filescsBz tjrt |¡n tƒ ¡Wnty<t d¡Yn0dS)Nz&data_files contains unexpected objects)rrLrÚ_add_defaults_data_filesrNÚ TypeErrorrÚwarnr0rPrrr]Ÿs   zsdist._add_defaults_data_filescCs8|jD]}tj |¡rdSq| dd |j¡¡dS)Nz,standard file not found: should have one of z, )ÚREADMESrr Úexistsr_r!)r'Úfrrrr"¨s   ÿÿzsdist.check_readmecCs^tj |||¡tj |d¡}ttdƒrJtj |¡rJt |¡|  d|¡|  d¡  |¡dS)Nz setup.cfgr=r) r-rÚmake_release_treerr r!ÚhasattrraÚunlinkÚ copy_filerZsave_version_info)r'Úbase_dirÚfilesÚdestrrrrc²s   zsdist.make_release_treecCsTtj |j¡sdSt |jd¡}| ¡}Wdƒn1s>0Y|d ¡kS)NFÚrbz+# file GENERATED by distutils, do NOT edit )rr rOÚmanifestÚioÚopenÚreadlineÚencode)r'ÚfpÚ first_linerrrÚ_manifest_is_not_generated¿s&ÿz sdist._manifest_is_not_generatedc CsŽt d|j¡t|jdƒ}|D]b}tjs\z| d¡}Wn$tyZt d|¡YqYn0|  ¡}|  d¡s|stq|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'rjzUTF-8z"%r not UTF-8 decodable -- skippingú#N)rÚinforkrmrrLÚdecodeÚUnicodeDecodeErrorr_ÚstripÚ startswithrrrF)r'rkÚlinerrrÚ read_manifestÉs   zsdist.read_manifestcCs°t ¡}|j d¡}| dd¡\}}|dur8t d¡n | |¡z| |jj j ¡Wnt yrt  d¡Yn0|D]&}t j |¡sxt  d|¡| |¡qx|j |¡dS)zvChecks if license_file' or 'license_files' is configured and adds any valid paths to 'self.filelist'. ÚmetadataÚ license_file)NNNz''license_file' option was not specifiedz,warning: 'license_files' option is malformedz8warning: Failed to find the configured license file '%s')rZ OrderedSetr&Úget_option_dictÚgetrÚdebugÚaddÚupdater{Z license_filesr^r_rr raÚremoverrT)r'rhÚoptsrGr|rbrrrÚ check_licenseßs$     þ zsdist.check_license)!r9r:r;Ú__doc__Ú user_optionsÚ negative_optZREADME_EXTENSIONSÚtupler`r+r.r/r$Ú staticmethodÚ contextlibÚcontextmanagerr8Z_sdist__read_template_hackr5r6Zhas_leaky_handlerArMrXrVrUr]r"rcrrrzr„Ú __classcell__rrrPrrs<   ÿý      r)r)Ú distutilsrZdistutils.command.sdistÚcommandrr-rr5rlrŠZsetuptools.externrrZ py36compatrrÚlistZ_default_revctrlrrrrrÚs