o ~Re@sxddlmZddlmmZddlZddlZddlZddl Z ddl m Z ddl Z e Zd ddZGdd d e ejZdS) )logN)sdist_add_defaultsccs.tdD]}||D]}|VqqdS)z%Find all files under revision controlzsetuptools.file_findersN) pkg_resourcesiter_entry_pointsload)dirnameepitemr /builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/sdist.py walk_revctrls rcseZdZdZgdZiZgdZeddeDZddZ dd Z d d Z d d Z e ejddZfddZddZddZddZfddZddZddZddZd d!ZZS)"sdistz=Smart sdist that finds anything supported by revision control))zformats=Nz6formats for source distribution (comma-separated list))z keep-tempkz@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).0extr r r +szsdist.cCs|d|d}|j|_|jtj|jd|| D]}||q"| t |j dg}|j D]}dd|f}||vrH||q8dS)Negg_infoz SOURCES.txt dist_filesrr) run_commandget_finalized_commandfilelistappendospathjoinr check_readmeget_sub_commandsmake_distributiongetattr distributionZ archive_files)selfZei_cmdcmd_namerfiledatar r r run-s       z sdist.runcCstj||dSN)origrinitialize_options_default_to_gztarr&r r r r-@s  zsdist.initialize_optionscCstjdkrdSdg|_dS)N)rbetargztar)sys version_infoformatsr/r r r r.Es  zsdist._default_to_gztarcCs:|tj|WddS1swYdS)z% Workaround for #516 N)_remove_os_linkr,rr#r/r r r r#Ks "zsdist.make_distributionc csvGddd}ttd|}zt`Wn tyYnwzdVW||ur-ttd|dSdS||ur:ttd|ww)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< Exceptionsetattr)r;Zorig_valr r r r7Rs   zsdist._remove_os_linkcs*ttjdr|jddSdS)Nzpyproject.toml)super_add_defaults_optionalrrisfilerrr/ __class__r r r@gs  zsdist._add_defaults_optionalcCs<|jr|d}|j||||dSdS)zgetting python filesbuild_pyN)r%has_pure_modulesrrextendZget_source_files_add_data_files_safe_data_filesr&rDr r r _add_defaults_pythonls  zsdist._add_defaults_pythoncCs|jjrdS|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|jdd|DdS)zA Add data files as found in build_py.data_files. css0|]\}}}}|D] }tj||Vq qdSr+)rrr )r_src_dir filenamesnamer r r rs  z(sdist._add_data_files..N)rrF)r&rKr r r rG}s  zsdist._add_data_filescs0ztWdStytdYdSw)Nz&data_files contains unexpected objects)r?_add_defaults_data_files TypeErrorrwarnr/rBr r rPs  zsdist._add_defaults_data_filescCs8|jD] }tj|rdSq|dd|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrRr )r&fr r r r!s   zsdist.check_readmecCs^tj|||tj|d}ttdr%tj|r%t|| d|| d |dS)Nz setup.cfgr<r) r,rmake_release_treerrr hasattrrTunlink copy_filerZsave_version_info)r&base_dirfilesdestr r r rVs   zsdist.make_release_treecCsTtj|js dSt|jd }|}Wdn1swY|dkS)NFrbz+# file GENERATED by distutils, do NOT edit )rrrAmanifestioopenreadlineencode)r&fp first_liner r r _manifest_is_not_generateds z sdist._manifest_is_not_generatedc Cstd|jt|jd}|D],}z|d}Wnty(td|Yqw|}|ds4|s5q|j |q| dS)zRead 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) rinfor^r`decodeUnicodeDecodeErrorrRstrip startswithrrclose)r&r^liner r r read_manifests   zsdist.read_manifest)r8r9r:__doc__ user_options negative_optZREADME_EXTENSIONStuplerSr*r-r.r# staticmethod contextlibcontextmanagerr7r@rJrHrGrPr!rVrern __classcell__r r rBr rs,      r)r) distutilsrZdistutils.command.sdistcommandrr,rr4r_rtZ py36compatrrlistZ_default_revctrlrr r r r s