ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/coverage/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/coverage/__pycache__/inorout.cpython-311.pyc

�

�܋f\]��^�UdZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZmZddlmZmZmZmZmZmZmZmZmZddlmZddlmZmZddlm Z m!Z!dd	l"m#Z#m$Z$m%Z%dd
l"m&Z&m'Z'm(Z(ddl)m*Z*ddl+m,Z,m-Z-dd
l.m/Z/m0Z0m1Z1m2Z2erddl3m4Z4ddl5m6Z6eeeee	eegZ7de8d<ej9rL	ddl:Z:e7�;e:��n#e<$rYnwxYw	ddl=Z=e7�;e=��n#e<$rYnwxYwd-d.d�Z>d/d�Z?d0d �Z@d0d!�ZAd1d$�ZBd2d(�ZCd2d)�ZDd2d*�ZEGd+�d,��ZFdS)3z=Determining whether files are being measured/reported or not.�)�annotationsN)�	FrameType�
ModuleType)	�cast�Any�Iterable�List�Optional�Set�Tuple�Type�
TYPE_CHECKING)�env)�FileDisposition�disposition_init)�CoverageException�PluginError)�TreeMatcher�GlobMatcher�
ModuleMatcher)�
prep_patterns�find_python_files�canonical_filename)�sys_modules_saved)�source_for_file�source_for_morf)�TFileDisposition�TMorf�TWarnFn�	TDebugCtl)�CoverageConfig)�PluginszList[ModuleType]�modules_we_happen_to_haveF�morfr�	directory�bool�return�strc��tt|����}|�d��s|r%tj�|��d}|S)z�Return the canonical path of the module or file `morf`.

    If the module is a package, then return its directory. If it is a
    module, then return its file, unless `directory` is True, in which
    case return its enclosing directory.

    z__init__.pyr)rr�endswith�os�path�split)r$r%�	morf_paths   �c/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/inorout.py�canonical_pathr0;sT��#�?�4�#8�#8�9�9�I����-�(�(�0�I�0��G�M�M�)�,�,�Q�/�	����filename�frame�Optional[FrameType]c�j�|�|jni}|�dd��}t|t��r|dkr|S|�dd��}dD]C}t	||��rt||��}n�$t|t��r
|dkr|cS�Dt
j|��}|�|S|S)a�Get the name of the module for a filename and frame.

    For configurability's sake, we allow __main__ modules to be matched by
    their importable name.

    If loaded via runpy (aka -m), we can usually recover the "original"
    full dotted module name, otherwise, we resort to interpreting the
    file name to get the module's name.  In the case that the module name
    can't be determined, None is returned.

    N�__name__�__main__�
__loader__)�fullname�name)�	f_globals�get�
isinstancer(�hasattr�getattr�inspect�
getmodulename)r2r3�module_globals�dunder_name�loader�attrnamer9�
inspectednames        r/�name_for_modulerGIs���).�(9�U�_�_�r�N�%�)�)�*�d�;�;�K��+�s�#�#���z�(A�(A���
�
�
��d�
3�
3�F�(�����6�8�$�$�	��v�x�0�0�H�H���h��$�$�	��Z�)?�)?��O�O�O���)�(�3�3�M�� ����r1�modrc�H�t|d��ot|dd��duS)z5Is the module object `mod` a PEP420 namespace module?�__path__�__file__N)r>r?)rHs r/�module_is_namespacerLos(���3�
�#�#�N���Z��(F�(F�$�(N�Nr1c�j�t|dd��}|�dStj�|��S)z8Does the module object `mod` have an existing __file__ ?rKNF)r?r+r,�exists)rH�mod__file__s  r/�module_has_filerPts2���#�z�4�0�0�K����u�
�7�>�>�+�&�&�&r1�
modulename�Tuple[Optional[str], List[str]]c��d}g}	tj�|��}|�|j}t	|jpd��}n#t$rYnwxYw||fS)z�Find the file and search path for `modulename`.

    Returns:
        filename: The filename of the module, or None.
        path: A list (possibly empty) of directories to find submodules in.

    N�)�	importlib�util�	find_spec�origin�list�submodule_search_locations�	Exception)rQr2r,�specs    r/�file_and_path_for_moduler]|s{���H�
�D�?��~�'�'�
�3�3�����{�H���7�=�2�>�>�D����
�
�
���
�����T�>�s�A�
A�A�paths�Set[str]�Nonec��tD]6}t|d��r$|�t|d������7dS)z;Add paths where the stdlib can be found to the set `paths`.rKT�r%N)r#r>�addr0)r^�ms  r/�add_stdlib_pathsre�sO��'�9�9���1�j�!�!�	9��I�I�n�Q�$�7�7�7�8�8�8��9�9r1c��ttj����}|D]a}|dkrdn|}tj|�d��vr4tj|��}dD]}|�||����bdS)z:Add locations for third-party packages to the set `paths`.�pypy�
pypy_posix�_)�platlib�purelib�scriptsN)�set�	sysconfig�get_scheme_namesr+r:r-�	get_pathsrc)r^�scheme_names�scheme�
better_scheme�config_paths�	path_names      r/�add_third_party_pathsrv�s����y�1�3�3�4�4�L��3�3��(.�&�(8�(8���f�
�
�7�m�)�)�#�.�.�.�.�$�.�v�6�6�L�>�
3�
3�	��	�	�,�y�1�2�2�2�2��
3�3r1c���ttd���}|�|��tjr5|�t
j�|d����dSdS)zAAdd paths where coverage.py code can be found to the set `paths`.Trb�testsN)r0rKrcr�TESTINGr+r,�join)r^�
cover_paths  r/�add_coverage_pathsr|�sb����D�9�9�9�J�	�I�I�j����
�{�5�
�	�	�"�'�,�,�z�7�3�3�4�4�4�4�4�5�5r1c�l�eZdZdZd#d�Zd$d%d�Zd&d�Zd'd�Zd'd�Zd'd�Z	d(d�Z
d)d�Zd*d�Zd+d �Z
d,d"�Zd
S)-�InOrOutz0Machinery for determining what files to measure.�configr!�warnr�debug�Optional[TDebugCtl]�include_namespace_packagesr&r'r`c	�v
��|�_|�_|�_g�_g�_�j�|j��|jpgD]c}tj�|��r(�j�	t|�����I�j�	|���d�jdd��_t|j
���_t|j���_t#���_|jst)�j��t#���_t-�j��t#���_t1�j��d$�fd�}|dd�d�t4jD����z��d�_d�_d�_dx�_�_�js�jr�g}�jr7tA�jd	���_|�	d
�j�����jr7tC�jd���_|�	d�j����|d
d�|��z��n4�jr-tA�jd���_|d�j�����jr-tE�jd���_|d�j�����jr-tE�jd���_|d�j����tA�jd���_#|d�j#����tA�jd���_$|d�j$����t#���_%tM��5�jD]�}	tO|��\}	}
|d|�d|	����n(#tP$r}|d|�d|����Yd}~�Gd}~wwxYw|	r`�j$�)|	��rE|d|�d|	�����j%�*tWtY|	��������|
D]G}�j$�)|��r+|d|�d |�����j%�*|���H��	ddd��n#1swxYwY�jD]D}�j$�)|��r(|d!|�����j%�*|���EtA�j%d"���_-|d#�j-�����t\�_/dS)%N�msgr(r'r`c�N���jr�j�|��dSdS�N)r��write)r��selfs �r/�_debugz InOrOut.__init__.<locals>._debug�s3����z�
&��
� � ��%�%�%�%�%�
&�
&r1z	sys.path:�c3� K�|]	}d|��V��
dS)z
    NrT)�.0�ps  r/�	<genexpr>z#InOrOut.__init__.<locals>.<genexpr>�s(����$D�$D�a�\�a�\�\�$D�$D�$D�$D�$D�$Dr1�sourceztrees �source_pkgszmodules zSource matching against z and �pylibzPython stdlib matching: �includezInclude matching: �omitzOmit matching: �coveragezCoverage code matching: �thirdzThird-party lib matching: zImported source package z as zCouldn't import source package z: z"Source in third-party: source_pkg z at zSource in third-party: z path directory at z(Source in third-party: source directory �source_in_thirdz Source in third-party matching: )r�r(r'r`)0r�r�r�r�r��extendr+r,�isdir�appendr�source_pkgs_unmatchedr�run_includer��run_omitr�rm�pylib_paths�cover_pylibre�cover_pathsr|�third_pathsrvrz�sys�source_match�source_pkgs_match�pylib_match�
include_match�
omit_matchrrr�cover_match�third_match�source_in_third_pathsrr]r�matchrcr0r�source_in_third_matchr�
disp_class)
r�rr�r�r��srcr��against�pkg�modfiler,�exc�pathdirs
`            r/�__init__zInOrOut.__init__�s<�����	���
�*D��'�!#���&(�������� 2�3�3�3��=�&�B�	-�	-�C��w�}�}�S�!�!�
-���"�"�#5�c�#:�#:�;�;�;�;�� �'�'��,�,�,�,�%)�%5�a�a�a�%8��"�$�V�%7�8�8���!�&�/�2�2��	�&)�U�U����!�	/��T�-�.�.�.�&)�U�U����4�+�,�,�,�&)�U�U����d�.�/�/�/�	&�	&�	&�	&�	&�	&�	��{�R�W�W�$D�$D�3�8�$D�$D�$D�D�D�D�E�E�E�!���!%������/3�3���T�_��;�	H�$�*�	H��G��{�
?�$/���X�$F�$F��!����=��(9�=�=�>�>�>���
F�)6�t�7G��)W�)W��&����D�$�*@�D�D�E�E�E��F�-����W�0E�0E�E�F�F�F�F���
H�#.�t�/?��#I�#I�� ���F�$�2B�F�F�G�G�G��<�	@�!,�T�\�9�!E�!E�D���F�>��(:�>�>�?�?�?��9�	:�)�$�)�V�<�<�D�O��F�8�T�_�8�8�9�9�9�&�t�'7��D�D�����>�$�*:�>�>�?�?�?�&�t�'7��A�A�����@�D�,<�@�@�A�A�A�
&)�U�U��"�
�
 �
 �	D�	D��'�
D�
D���$<�S�$A�$A�M�G�T��F�L�c�L�L��L�L�M�M�M�M��(�����F�K�S�K�K�c�K�K�L�L�L��H�H�H�H����������D��'�-�-�g�6�6�a���W��W�W�G�W�W�����2�6�6�~�o�V]�F^�F^�7_�7_�`�`�`��#'�D�D���+�1�1�'�:�:�D�"�F� _�#� _� _�T[� _� _����!�6�:�:�7�C�C�C��D�
D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D����	D�	D�	D�	D�,�;�	4�	4�C���%�%�c�*�*�
4���I�#�I�I�J�J�J��*�.�.�s�3�3�3��%0��1K�M^�%_�%_��"���N�$�2L�N�N�O�O�O���2A����s=�
R'�!#O�R'�
O*�O%� R'�%O*�*B0R'�'R+�.R+Nr2r(r3r4rc���|}t|j|��}dd�}|�d��r||d��S|��|jo|j�d
��}|rjt|��}|rY|�d��sDtj�|��}|tj�|��kr|}|s||d��S|�d��r||d
��S|�d��r||d��St|��}||_	d	}	|j
jD]�}	|	js�
	|	�
|��}
|
�Y|	|
_d|_|
|_
|
���rd|_n&t|
�����|_n[�|#t&$r?|	j}t+j��}|�d|�d|����d|	_Y��wxYwd|_||_|jsK|jst1d|	�d|j�d����|�|j|��}
|
r|||
��|S)aDecide whether to trace execution in `filename`, with a reason.

        This function is called from the trace function.  As each new file name
        is encountered, this function determines whether it is traced or not.

        Returns a FileDisposition object.

        �dispr�reasonr(r'c�"�d|_||_|S)z+Simple helper to make it easy to return NO.F)�tracer�)r�r�s  r/�nopez"InOrOut.should_trace.<locals>.nope6s���D�J� �D�K��Kr1�<zoriginal file name is not realNrKzempty string isn't a file namezmemory:zmemory isn't traceablezfile name is not realTzDisabling plug-in z due to an exception:
FzPlugin z! didn't set source_filename for '�')r�rr�r(r'r)rr��
startswithr;r<rr+r,�basenamer�plugins�file_tracers�_coverage_enabled�file_tracer�_coverage_pluginr��has_dynamic_source_filename�has_dynamic_filename�source_filenamer[�_coverage_plugin_name�	traceback�
format_excr�r�original_filename�check_include_omit_etc)r�r2r3r�r�r��dunder_file�orig�	canonical�pluginr��plugin_name�tbr�s              r/�should_tracezInOrOut.should_trace*s��%������:�:��	�	�	�	��'�'��,�,�	@��4��>�?�?�?��� �/�M�e�o�.A�.A�*�.M�.M�K��
5�*�;�7�7��$�5�->�-I�-I�#�-N�-N�5��7�+�+�,=�>�>�D��r�w�/�/��9�9�9�9�$5���	@��4��>�?�?�?����y�)�)�	8��4��6�7�7�7����s�#�#�	7�
�4��5�6�6�6�&�x�0�0�	�"+������l�/�	-�	-�F��+�
��
�$�0�0��;�;���*�39�K�0�!%�D�J�'2�D�$�"�>�>�@�@��48��1�1�/A�'�7�7�9�9�0�0��,��E�+���
�
�
�$�:���)�+�+���	�	�Y�{�Y�Y�UW�Y�Y�Z�Z�Z�+0��(���
�����D�J�#,�D� ��(�	#��'�
�!�b�f�b�b��I_�b�b�b�����0�0��1E�u�M�M�F��
#���T�6�"�"�"��s�A.F<�<AH�H�
Optional[str]c�>�t||��}|js|jr�d}d}|jrF|j�|��r&d}||jvr|j�|��nd|�d�}|s#|jr|j�|��rd}|s|dzS|j�|��r|j�|��sdSn|jr|j�|��sdSn[|j	�|��rd	S|j
r|j
�|��rd
S|j�|��rdS|jr|j�|��rdS	|�d
��n#t$rYdSwxYwdS)z�Check a file name against the include, omit, etc, rules.

        Returns a string or None.  String means, don't trace, and is the reason
        why.  None means no reason found to not trace.

        r�FTzmodule � zfalls outside the --source specz#inside --source, but is third-partyz!falls outside the --include treeszis part of coverage.pyzis in the stdlibzis a third-party modulezis inside an --omit patternzutf-8znon-encodable filenameN)rGr�r�r�r��remover�r�r�r�r�r��encode�UnicodeEncodeError)r�r2r3rQ�extra�oks      r/r�zInOrOut.check_include_omit_etc�s��%�X�u�5�5�
���!	1�� 6�!	1��E��B��%�
6��)�/�/�
�;�;�6��B�!�T�%?�?�?��2�9�9�*�E�E�E��5�j�5�5�5�E��
�$�+�
��$�*�*�8�4�4���B��
A��@�@�@���%�%�h�/�/�
=��8R�8X�8X�Ya�8b�8b�
=�<�<��
�
�	1��%�+�+�H�5�5�
;�:�:�
;�
��%�%�h�/�/�
0�/�/���
*�D�$4�$:�$:�8�$D�$D�
*�)�)���%�%�h�/�/�
1�0�0��?�	1�t��4�4�X�>�>�	1�0�0�	,��O�O�G�$�$�$�$��!�	,�	,�	,�+�+�+�	,�����ts�6F�
F�Fc�f�|jr'|js|jr|�dd���dSdSdS)z)Warn if there are settings that conflict.z,--include is ignored because --source is setzinclude-ignored��slugN)r�r�r�r�)r�s r/�warn_conflicting_settingsz!InOrOut.warn_conflicting_settings�sY���<�	b��{�
b�d�.�
b��	�	�H�O`�	�a�a�a�a�a�	b�	b�
b�
br1c��|js|js|j�r't��}t	t
j�����D]�}t|dd��}|��||vr�tt|dd����dkr�>|�
|��}|jr�[|jr2d|��}|�
|d���|�|����|jrR|j�d	��r8|j�d
�|j|j������dSdS)zCWarn if files have already been imported that we will be measuring.rKNrJrT�z/Already imported a file that will be measured: zalready-importedr�r�z+Didn't trace already imported file {!r}: {})r�r�r�rmrYr��modules�valuesr?�lenr�r�r�r�rcr��shouldr��formatr�r�)r��warnedrHr2r�r�s      r/�warn_already_imported_filesz#InOrOut.warn_already_imported_files�sj���<�	�4�;�	�$�*:�	��U�U�F��C�K�.�.�0�0�1�1�
�
��"�3�
�D�9�9���#���v�%�%���w�s�J��3�3�4�4�q�8�8���(�(��2�2���,����:�	�V�H�V�V�C��I�I�c�(:�I�;�;�;��J�J�x�(�(�(�(��Z��D�J�$5�$5�g�$>�$>���J�$�$�E�L�L� �2�D�K�������1	�	�
�
r1c�D�|jD]}|�|���dS)zCWarn about source packages that were of interest, but never traced.N)r��_warn_about_unmeasured_code)r�r�s  r/�warn_unimported_sourcezInOrOut.warn_unimported_source�s5���-�	2�	2�C��,�,�S�1�1�1�1�	2�	2r1r�c�6�tj�|��}|�|�d|�d�d���dSt	|��rdSt|��s|�d|�d�d���dSd|�d�}|�|d	���dS)
z}Warn about a package or module that we never traced.

        `pkg` is a string, the name of the package or module.

        NzModule z was never imported.zmodule-not-importedr�z has no Python source.zmodule-not-pythonz* was previously imported, but not measuredzmodule-not-measured)r�r�r<r�rLrP)r�r�rHr�s    r/r�z#InOrOut._warn_about_unmeasured_code�s����k�o�o�c�"�"���;��I�I�9��9�9�9�@U�I�V�V�V��F��s�#�#�	�
�F��s�#�#�	��I�I�;��;�;�;�BU�I�V�V�V��F�
H��G�G�G���	�	�#�1�	�2�2�2�2�2r1�#Iterable[Tuple[str, Optional[str]]]c#�K�|jD]�}|tjvsttj|��s�0t	tttj|j����}|�t|����Ed{V����|j
D]}|�|��Ed{V���dS)z�Find files in the areas of interest that might be untraced.

        Yields pairs: file path, and responsible plug-in name.
        N)r�r�r�rPrrr(rK�_find_executable_filesr0r�)r�r��pkg_filer�s    r/�find_possibly_unexecuted_filesz&InOrOut.find_possibly_unexecuted_files
s�����
�#�	M�	M�C��3�;�&�&�#�C�K��$4�5�5�'��&�t�C���S�1A�1J�'K�'K�L�L�H��2�2�>�(�3K�3K�L�L�L�L�L�L�L�L�L�L��;�	8�	8�C��2�2�3�7�7�7�7�7�7�7�7�7�7�	8�	8r1�src_dir�Iterable[Tuple[str, str]]c#�nK�|jjD]%}|�|��D]
}||jfV���&dS)z&Get executable files from the plugins.N)r�r��find_executable_filesr�)r�r�r��x_files    r/�_find_plugin_fileszInOrOut._find_plugin_filess]�����l�/�	;�	;�F� �6�6�w�?�?�
;�
;���f�:�:�:�:�:�:�
;�	;�	;r1c#�K�d�t||j��D��}|�|��}tj||��D]<\}}t|��}|jr|j�|��r�6||fV��=dS)a(Find executable files in `src_dir`.

        Search for files in `src_dir` that can be executed because they
        are probably importable. Don't include ones that have been omitted
        by the configuration.

        Yield the file path, and the plugin name that handles the file.

        c3�K�|]}|dfV��	dSr�rT)r��py_files  r/r�z1InOrOut._find_executable_files.<locals>.<genexpr>,s7����
�
� '�W�d�O�
�
�
�
�
�
r1N)rr�r��	itertools�chainrr�r�)r�r��py_files�plugin_files�	file_pathr�s      r/r�zInOrOut._find_executable_files"s�����
�
��g�t�'F�G�G�
�
�
���.�.�w�7�7��&/�o�h��&M�&M�	)�	)�"�I�{�*�9�5�5�I���
�4�?�#8�#8��#C�#C�
���[�(�(�(�(�(�
	)�	)r1�Iterable[Tuple[str, Any]]c���d|jfd|jfd|jfd|jfg}gd�}|D]B}t	||��}|r|���}nd}|�||f���C|S)z^Our information for Coverage.sys_info.

        Returns a list of (key, value) pairs.
        �coverage_paths�stdlib_paths�third_party_paths�source_in_third_party_paths)r�r�r�r�r�r�r�r�z-none-)r�r�r�r�r?�infor�)r�r�
matcher_names�matcher_name�matcher�matcher_infos      r/�sys_infozInOrOut.sys_info:s����t�/�0�
�T�-�.�
 �$�"2�3�
*�D�,F�G�	
��
�
�
�
�*�	6�	6�L��d�L�1�1�G��
(�&�|�|�~�~���'���K�K��|�4�5�5�5�5��r1)
rr!r�rr�r�r�r&r'r`r�)r2r(r3r4r'r)r2r(r3r4r'r�)r'r`)r�r(r'r`)r'r�)r�r(r'r�)r�r(r'r�)r'r�)r6�
__module__�__qualname__�__doc__r�r�r�r�r�r�r�r�r�r�r
rTr1r/r~r~�s������:�:�qB�qB�qB�qB�f_�_�_�_�_�B;�;�;�;�zb�b�b�b�����@2�2�2�2�
3�3�3�3�4
8�
8�
8�
8�;�;�;�;�)�)�)�)�0�����r1r~)F)r$rr%r&r'r()r2r(r3r4r'r()rHrr'r&)rQr(r'rR)r^r_r'r`)Gr
�
__future__r�importlib.utilrUr@r�r+�platform�rer�rnr��typesrr�typingrrrr	r
rrr
rr�r�coverage.dispositionrr�coverage.exceptionsrr�coverage.filesrrrrrr�
coverage.miscr�coverage.pythonrr�coverage.typesrrrr �coverage.configr!�coverage.plugin_supportr"r#�__annotations__�PYPY�
_structseqr��ImportError�_pypy_irc_topicr0rGrLrPr]rervr|r~rTr1r/�<module>r!s���D�C�C�"�"�"�"�"�"�������������	�	�	�	�����	�	�	�	�
�
�
�
���������'�'�'�'�'�'�'�'�����������������������������B�B�B�B�B�B�B�B�>�>�>�>�>�>�>�>�B�B�B�B�B�B�B�B�B�B�O�O�O�O�O�O�O�O�O�O�+�+�+�+�+�+�<�<�<�<�<�<�<�<�F�F�F�F�F�F�F�F�F�F�F�F��0�.�.�.�.�.�.�/�/�/�/�/�/��Y��H�b�)�Y�/�������8�
�
�����!�(�(��4�4�4�4���
�
�
���
����
�����!�(�(��9�9�9�9���
�
�
���
���������#�#�#�#�LO�O�O�O�
'�'�'�'�����*	9�	9�	9�	9�3�3�3�3�5�5�5�5�`�`�`�`�`�`�`�`�`�`s$�4C�C�C�C4�4C<�;C<

Zerion Mini Shell 1.0