U Ù üeRã@sXddlZddlmZddlmZddlmZGdd„dƒZeejdƒrTGdd„dƒZdS) éN)Úglob)Ú convert_path)Úsdistc@s\eZdZdZdd„Zedd„ƒZdd„Zdd „Zd d „Z d d „Z dd„Z dd„Z dd„Z dS)Úsdist_add_defaultszö Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. cCs<| ¡| ¡| ¡| ¡| ¡| ¡| ¡dS)a9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N)Ú_add_defaults_standardsÚ_add_defaults_optionalÚ_add_defaults_pythonÚ_add_defaults_data_filesÚ_add_defaults_extÚ_add_defaults_c_libsÚ_add_defaults_scripts)Úself©rúK/opt/hc_python/lib/python3.8/site-packages/setuptools/command/py36compat.pyÚ add_defaultsszsdist_add_defaults.add_defaultscCs:tj |¡sdStj |¡}tj |¡\}}|t |¡kS)zË Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False F)ÚosÚpathÚexistsÚabspathÚsplitÚlistdir)ÚfspathrÚ directoryÚfilenamerrrÚ_cs_path_exists&s  z"sdist_add_defaults._cs_path_existscCs–|j|jjg}|D]~}t|tƒrj|}d}|D]"}| |¡r,d}|j |¡qPq,|s| dd  |¡¡q| |¡r‚|j |¡q| d|¡qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found) ZREADMESÚ distributionÚ script_nameÚ isinstanceÚtuplerÚfilelistÚappendÚwarnÚjoin)r Z standardsÚfnZaltsZgot_itrrrr7s"   ÿ z*sdist_add_defaults._add_defaults_standardscCs4ddg}|D]"}ttjjt|ƒƒ}|j |¡q dS)Nz test/test*.pyz setup.cfg)ÚfilterrrÚisfilerrÚextend)r ÚoptionalÚpatternÚfilesrrrrLsz)sdist_add_defaults._add_defaults_optionalcCs\| d¡}|j ¡r$|j | ¡¡|jD],\}}}}|D]}|j tj   ||¡¡q:q*dS)NÚbuild_py) Úget_finalized_commandrÚhas_pure_modulesrr&Úget_source_filesÚ data_filesr rrr")r r*ÚpkgÚsrc_dirÚ build_dirÚ filenamesrrrrrRs   z'sdist_add_defaults._add_defaults_pythoncCsz|j ¡rv|jjD]b}t|tƒrBt|ƒ}tj |¡rt|j   |¡q|\}}|D]$}t|ƒ}tj |¡rN|j   |¡qNqdS)N) rÚhas_data_filesr.rÚstrrrrr%rr )r ÚitemÚdirnamer2Úfrrrr bs     z+sdist_add_defaults._add_defaults_data_filescCs(|j ¡r$| d¡}|j | ¡¡dS)NÚ build_ext)rÚhas_ext_modulesr+rr&r-)r r8rrrr ss  z$sdist_add_defaults._add_defaults_extcCs(|j ¡r$| d¡}|j | ¡¡dS)NÚ build_clib)rÚhas_c_librariesr+rr&r-)r r:rrrr xs  z'sdist_add_defaults._add_defaults_c_libscCs(|j ¡r$| d¡}|j | ¡¡dS)NÚ build_scripts)rÚ has_scriptsr+rr&r-)r r<rrrr }s  z(sdist_add_defaults._add_defaults_scriptsN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚ staticmethodrrrrr r r r rrrrrs rrc@s eZdZdS)rN)r>r?r@rrrrr…s)rrÚdistutils.utilrÚdistutils.commandrrÚhasattrrrrrÚs    |