3

Q'íczã@sdddlZddlmZddlmZddlmZddlmZGdd„dƒZe	ejdƒr`Gd	d„dƒZdS)
éN)Úglob)Úconvert_path)Úsdist)Úfilterc@s\eZdZdZdd„Zedd„ƒZdd„Zdd	„Zd
d„Z	dd
„Z
dd„Zdd„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<|jƒ|jƒ|jƒ|jƒ|jƒ|jƒ|jƒ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úC/tmp/pip-build-l_bcah40/setuptools/setuptools/command/py36compat.pyÚadd_defaultsszsdist_add_defaults.add_defaultscCs:tjj|ƒsdStjj|ƒ}tjj|ƒ\}}|tj|ƒ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}xˆ|D]€}t|tƒrn|}d}x(|D] }|j|ƒr0d}|jj|ƒPq0W|s”|jddj	|ƒƒq|j|ƒr†|jj|ƒq|jd|ƒqWdS)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)rZ	standardsÚfnZaltsZgot_itrrrr9s 




z*sdist_add_defaults._add_defaults_standardscCs8ddg}x*|D]"}ttjjt|ƒƒ}|jj|ƒqWdS)Nz
test/test*.pyz	setup.cfg)rrrÚisfilerr Úextend)rÚoptionalÚpatternÚfilesrrrrNs
z)sdist_add_defaults._add_defaults_optionalcCsd|jdƒ}|jjƒr$|jj|jƒƒx:|jD]0\}}}}x"|D]}|jjtj	j
||ƒƒq>Wq,WdS)NÚbuild_py)Úget_finalized_commandrÚhas_pure_modulesr r&Úget_source_filesÚ
data_filesr!rrr#)rr*ÚpkgÚsrc_dirÚ	build_dirÚ	filenamesrrrrr	Ts


z'sdist_add_defaults._add_defaults_pythoncCs‚|jjƒr~xr|jjD]f}t|tƒrDt|ƒ}tjj|ƒrz|j	j
|ƒq|\}}x,|D]$}t|ƒ}tjj|ƒrR|j	j
|ƒqRWqWdS)N)rÚhas_data_filesr.rÚstrrrrr%r r!)rÚitemÚdirnamer2Úfrrrr
ds


z+sdist_add_defaults._add_defaults_data_filescCs(|jjƒr$|jdƒ}|jj|jƒƒdS)NÚ	build_ext)rÚhas_ext_modulesr+r r&r-)rr8rrrrus

z$sdist_add_defaults._add_defaults_extcCs(|jjƒr$|jdƒ}|jj|jƒƒdS)NÚ
build_clib)rÚhas_c_librariesr+r r&r-)rr:rrrrzs

z'sdist_add_defaults._add_defaults_c_libscCs(|jjƒr$|jdƒ}|jj|jƒƒdS)NÚ
build_scripts)rÚhas_scriptsr+r r&r-)rr<rrrr
s

z(sdist_add_defaults._add_defaults_scriptsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rÚstaticmethodrrrr	r
rrr
rrrrr	srrc@seZdZdS)rN)r>r?r@rrrrr‡s)
rrÚdistutils.utilrÚdistutils.commandrZsetuptools.extern.six.movesrrÚhasattrrrrrÚ<module>s|