HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/setuptools/tests/__pycache__/test_manifest.cpython-310.pyc
o

��h�H�@sHUdZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
mZmZddlmZddlmZddlmZddlmZd	e	jvZd
d�Zdd
dgd�Zde�d�Zejdd��Zdd�Ze e!egd���Z"ddgddgfddggd�fdddgdgfdgd �d!gfd"d#ggfd$d%gd&gfd'gd(�d)gfd*d+d,gd-gfd.gd/�gfd0gd1�d2d3gfd4d5d6ggd7�fd8gd9�d:gfd;d<ggd=�fg
Z#d>e$d?<	ej%�&d@dA�e#D��Z'ej(e'dB�dCdD��Z)ej%�&dEdA�e#D��Z*ej(e*dB�dFdG��Z+dHdI�Z,dJdK�Z-GdLdM�dM�Z.GdNdO�dOe.�Z/GdPdQ�dQe.�Z0dS)Rzsdist tests�)�annotationsN)�FileList�egg_info�translate_pattern)�Distribution)�DALS)�log)�DistutilsTemplateError�__pypy__cCs|�dtj�S)z"Converts '/' in a string to os.sep�/)�replace�os�sep)�s�r�I/usr/local/lib/python3.10/dist-packages/setuptools/tests/test_manifest.py�make_local_pathsr�appz0.0)�name�version�packagesz&from setuptools import setup

setup(**z)
c	csR�tjtj}}t��t��t_t_z
dVW||t_t_dS||t_t_w�N)�sys�stdout�stderr�io�StringIO)�
old_stdout�
old_stderrrrr�quiet,s�"rcCst|d���dS)N�wb)�open�close)�filenamerrr�touch6sr$)�
README.rst�MANIFEST.in�setup.pyzapp.egg-info/PKG-INFOzapp.egg-info/SOURCES.txtz!app.egg-info/dependency_links.txtzapp.egg-info/top_level.txtzapp/__init__.py�foo�bar�foobar�foo/bar)zfoo/bar/bazz	./foo/barr(z*.txtzfoo.txtzbar.txtzfoo/foo.txtz	dir/*.txt)zdir/foo.txtzdir/bar.txtzdir/.txtznotdir/foo.txtz*/*.pyzbin/start.pyzdocs/page-?.txtzdocs/page-9.txtzdocs/page-10.txtz
foo/**/bar)zfoo/bing/barzfoo/bing/bang/barr+zfoo/abarzfoo/**zfoo/bar/bing.pyzfoo/xz/foo/xz**)�xzabc/xyzz@nythingzpre[one]post)�preopost�prenpost�preepost�prepost�
preonepostzhello[!one]world�helloxworld�helloyworld)�hellooworld�
helloworld�
hellooneworldz
[]one].txt)zo.txtz].txtze.txtzone].txtz
foo[!]one]bar�fooybar)zfoo]bar�fooobar�fooebarz&list[tuple[str, list[str], list[str]]]�translate_specsccs&�|]\}}}tt�|�|�VqdSr��zip�	itertools�repeat��.0�pattern�matches�
mismatchesrrr�	<genexpr>��
��
�rD)�paramscC�tt|j�Sr��mapr�param��requestrrr�
pattern_match��rMccs&�|]\}}}tt�|�|�VqdSrr;r?rrrrD�rEcCrGrrHrKrrr�pattern_mismatch�rNrOcCs|\}}t|��|�s
J�dSr�r�match)rMrA�targetrrr�test_translated_pattern_match��rScCs|\}}t|��|�r
J�dSrrP)rOrArRrrr� test_translated_pattern_mismatch�rTrUc@seZdZdd�Zdd�ZdS)�TempDirTestCasecCs$t��|_t��|_t�|j�dSr)�tempfile�mkdtemp�temp_dirr
�getcwd�old_cwd�chdir��self�methodrrr�setup_method�s

zTempDirTestCase.setup_methodcCst�|j�t�|j�dSr)r
r\r[�shutil�rmtreerYr]rrr�teardown_method�szTempDirTestCase.teardown_methodN)�__name__�
__module__�__qualname__r`rcrrrrrV�srVcs|eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Z�ZS)�TestManifestTestcs�t��|�ttj�|jd�ddd�}|�t�|�	�	dD]}t
tj�|j|��qtj�|jd�}t�|�dD]}t
tj�||��q;tj�|d�}t�|�d	D]}t
tj�||��qUdS)
Nr'�w�utf-8��encoding)r%�.hidden.rst�testing.rst�LICENSEr)z__init__.py�a.txt�b.txtzc.rst�static)zapp.jsz
app.js.mapzapp.csszapp.css.map)�superr`r!r
�path�joinrY�write�SETUP_PYr"r$�mkdir)r^r_�f�fname�test_pkgrq��	__class__rrr`�s 


�zTestManifestTest.setup_methodcCsRtj�|jd�}t|ddd��}|�t|��Wd�dS1s"wYdS)zWrite a MANIFEST.in.r&rhrirjN)r
rsrtrYr!rur)r^�contents�manifestrxrrr�
make_manifest�s"�zTestManifestTest.make_manifestcCs2tt�}d|_t|�}|��|��t|jj�S)z7Run egg_info and get all the files to include, as a setr')	r�SETUP_ATTRS�script_namer�ensure_finalized�run�set�filelist�files)r^�dist�cmdrrr�	get_files�szTestManifestTest.get_filescCsttdg�|��ks
J�dS)z=Check a missing MANIFEST.in includes only the standard files.r&N)�
default_filesr�r��r^rrr�test_no_manifest�sz!TestManifestTest.test_no_manifestcCs|�d�t|��ks
J�dS)z<Check an empty MANIFEST.in includes only the standard files.�N)rr�r�r�rrr�test_empty_files�s
z!TestManifestTest.test_empty_filescCs.|�d�ttddg�B}||��ksJ�dS)z,Include extra rst files in the project root.z
include *.rstrmrlN)rr�r�r�)r^r�rrr�test_include�s
zTestManifestTest.test_includecCs4t}|�d�tt|d�g�B}||��ksJ�dS)z0Include everything in app/ except the text fileszE
            include app/*
            exclude app/*.txt
            �	app/c.rstN�rrr�r�r��r^�mlr�rrr�test_exclude�s�zTestManifestTest.test_excludec	CsRt}|�d�tt|d�|d�|d�|d�|d�|d�g�B}||��ks'J�dS)	zInclude with multiple patterns.zinclude app/*.txt app/static/*�	app/a.txt�	app/b.txt�app/static/app.js�app/static/app.js.map�app/static/app.css�app/static/app.css.mapNr�r�rrr�test_include_multiple�s
�z&TestManifestTest.test_include_multiplecC�Ft}|�d�tt|d�|d�|d�|d�g�B}||��ks!J�dS)�(Include the whole app/static/ directory.zgraft app/staticr�r�r�r�Nr�r�rrr�
test_graft
�
�zTestManifestTest.test_graftcCr�)r�zgraft */staticr�r�r�r�Nr�r�rrr�test_graft_glob_syntaxr�z'TestManifestTest.test_graft_glob_syntaxcCs:t}|�d�tt|d�|d�g�B}||��ksJ�dS)z'Exclude all *.map files in the project.zK
            graft app/static
            global-exclude *.map
            r�r�Nr�r�rrr�test_graft_global_exclude%s�z*TestManifestTest.test_graft_global_excludecCsDt}|�d�ttdd|d�|d�|d�g�B}||��ks J�dS)z;Include all *.rst, *.js, and *.css files in the whole tree.z9
            global-include *.rst *.js *.css
            rlrmr�r�r�Nr�r�rrr�test_global_include1s��z$TestManifestTest.test_global_includecCs@t}|�d�tt|d�|d�|d�g�B}||��ksJ�dS)z@Include all files in app/, except for the whole app/static/ dir.z@
            graft app
            prune app/static
            r�r�r�Nr�r�rrr�test_graft_pruneBs�z!TestManifestTest.test_graft_prune)rdrerfr`rr�r�r�r�r�r�r�r�r�r�r��
__classcell__rrr{rrg�s'rgc@s�eZdZdZeje�d�dkd�dd��Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'S)(�TestFileListTestz�
    A copy of the relevant bits of distutils/tests/test_filelist.py,
    to ensure setuptools' version of FileList keeps parity with distutils.
    �SETUPTOOLS_USE_DISTUTILS�stdlib)�autousecs �fdd�}|�tjd|�dS)z Account for stdlib compatibilityc	s.t��}t�d|dd|||�}�j�|�dS)N�	distutilsr�r)r�exc_info�logging�	LogRecord�records�append)�_logger�level�msg�args�exc�rec��caplogrr�_logYsz2TestFileListTest._compat_record_logs.<locals>._logr�N)�setattrr�Log)r^�monkeypatchr�r�rr�r�_compat_record_logsUsz$TestFileListTest._compat_record_logscs�fdd�|jD�S)Ncsg|]	}|j�vr|�qSr)�levelno)r@�r��levelsrr�
<listcomp>asz0TestFileListTest.get_records.<locals>.<listcomp>)r�)r^r�r�rr�r�get_records`szTestFileListTest.get_recordscCs"|�|tj�gksJ�|��dSr)r�r�WARN�clear�r^r�rrr�assertNoWarningscsz!TestFileListTest.assertNoWarningscCs>tr|jst�d�dSt|�|tj��dksJ�|��dS)Nz'caplog checks may not work well in PyPyr)	�IS_PYPYr��pytest�xfail�lenr�rr�r�r�rrr�assertWarningsgs
zTestFileListTest.assertWarningscCsD|D]}tj�|j|�}tj�|�\}}tj|dd�t|�qdS)NT)�exist_ok)r
rsrtrY�split�makedirsr$)r^r��file�dirname�	_basenamerrr�
make_filesns
�zTestFileListTest.make_filescCs�t�}t}|�ddddd|d�|d�|d�|d	�|d
�|d�|d�|d
�|d�|d�g�td�}|�d�D]
}|s;q6|�|�q6ddd|d�|d�|d
�|d�|d�|d�g	}|��|j|kscJ�dS)Nzfoo.tmp�ok�xozfour.txtzbuildout.cfgz.hg/last-message.txtzglobal/one.txtzglobal/two.txtzglobal/files.xzglobal/here.tmpzf/o/f.ooz
dir/graft-onezdir/dir2/graft2zdir3/okzdir3/sub/ok.txta6        include ok
        include xo
        exclude xo
        include foo.tmp
        include buildout.cfg
        global-include *.x
        global-include *.txt
        global-exclude *.tmp
        recursive-include f *.oo
        recursive-exclude global *.x
        graft dir
        prune dir3
        �
)rrr�rr��process_template_line�sortr�)r^�	file_listr��MANIFEST_IN�line�wantedrrr�test_process_template_lineusL���z+TestFileListTest.test_process_template_linecCsht�}|�d�r
J�t�}ddg|_|�d�sJ�t�}ddg|_|�d�|��|jdgks2J�dS)N�*.py�a.pyzb.pyro)r�exclude_patternr�r��r^r�rrr�test_exclude_pattern�s


z%TestFileListTest.test_exclude_patterncCs|t�}|�g�|�d�rJ�t�}|�ddg�|�d�s J�t�}|�ddg�|�d�|��|jddgks<J�dS)Nr�r�rp�*)rr��include_patternr�r�r�rrr�test_include_pattern�s

z%TestFileListTest.test_include_patternc	CsHt�}dD]}t�t��
|�|�Wd�n1swYqdS)N)	�include�excludezglobal-includezglobal-excludezrecursive-includezrecursive-exclude�graft�prune�blarg)rr��raisesr	r�)r^r��actionrrr�"test_process_template_line_invalid�s���z3TestFileListTest.test_process_template_line_invalidcCs�|�tj�t}t�}|�dd|d�g�|�d�|��|jdgks&J�|�	|�|�d�|��|jdgks<J�|�
|�dS)Nr�rp�d/c.pyzinclude *.pyzinclude *.rb��	set_levelr��DEBUGrrr�r�r�r�r�r��r^r�r�r�rrrr��s


zTestFileListTest.test_includecCs�|�tj�t}t�}dd|d�g|_|�d�|��|jd|d�gks'J�|�|�|�d�|��|jd|d�gks@J�|�	|�dS)Nr�rpr�zexclude *.pyzexclude *.rb�
r�r�r�rrr�r�r�r�r�r�rrrr��s


zTestFileListTest.test_excludecCs�|�tj�t}t�}|�dd|d�g�|�d�|��|jd|d�gks)J�|�	|�|�d�|��|jd|d�gksBJ�|�
|�dS)Nr�rpr�zglobal-include *.pyzglobal-include *.rbr�r�rrrr�
s


z$TestFileListTest.test_global_includecCs�|�tj�t}t�}dd|d�g|_|�d�|��|jdgks$J�|�|�|�d�|��|jdgks:J�|�	|�dS)Nr�rpr�zglobal-exclude *.pyzglobal-exclude *.rbr�r�rrr�test_global_excludes


z$TestFileListTest.test_global_excludecCs�|�tj�t}t�}|�d|d�|d�|d�g�|�d�|��|j|d�|d�gks0J�|�	|�|�d�|��|j|d�|d�gksKJ�|�
|�dS)Nr��d/b.py�d/c.txt�d/d/e.pyzrecursive-include d *.pyzrecursive-include e *.pyr�r�rrr�test_recursive_include,�


z'TestFileListTest.test_recursive_includecCs�|�tj�t}t�}d|d�|d�|d�g|_|�d�|��|jd|d�gks,J�|�|�|�d�|��|jd|d�gksEJ�|�	|�dS)Nr�r�r�r�zrecursive-exclude d *.pyzrecursive-exclude e *.pyr�r�rrr�test_recursive_exclude=�


z'TestFileListTest.test_recursive_excludecCs�|�tj�t}t�}|�d|d�|d�|d�g�|�d�|��|j|d�|d�gks0J�|�	|�|�d�|��|j|d�|d�gksKJ�|�
|�dS)Nr�r�r��f/f.pyzgraft dzgraft er�r�rrrr�Nr�zTestFileListTest.test_graftcCs�|�tj�t}t�}d|d�|d�|d�g|_|�d�|��|jd|d�gks,J�|�|�|�d�|��|jd|d�gksEJ�|�	|�dS)Nr�r�r�r�zprune dzprune er�r�rrr�
test_prune_r�zTestFileListTest.test_pruneN)rdrerf�__doc__r��fixturer
�getenvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�Os(

?r�)1r��
__future__r�
contextlibrr=r�r
rarrWr��setuptools.command.egg_inforrr�setuptools.distr�setuptools.tests.textwraprr�r�distutils.errorsr	�builtin_module_namesr�rr�rv�contextmanagerrr$�	frozensetrIr�r:�__annotations__�chain�
from_iterable�match_paramsr�rM�mismatch_paramsrOrSrUrVrgr�rrrr�<module>s�
��
	��
��������.�

�

%