ó
    Ð]j4%  ã                  ó&  • S r SSKJr  SSKrSSKrSSKrSSKrSSKJ	r	J
r
  SSKJr  SSKJrJr  SSKJr  SSKJrJrJrJr  SS	KJr  SS
KJr  SSS jjrSS jrSSS jjrSS jr " S S5      r     S             SS jjrSS jr SS jr!g)a  Coverage data for coverage.py.

This file had the 4.x JSON data support, which is now gone.  This file still
has storage-agnostic helpers, and is kept to avoid changing too many imports.
CoverageData is now defined in sqldata.py, and imported here to keep the
imports working.

é    )ÚannotationsN)ÚCallableÚIterable)ÚLiteral)ÚCoverageExceptionÚNoDataError)ÚPathAliases)ÚHasherÚfile_be_goneÚhuman_sortedÚplural)ÚCoverageData)Úfilename_matchc                óÔ   • 0 nU(       a  S nO[         R                  R                  nU R                  5        H,  nU R	                  U5      nUc   e[        U5      X#" U5      '   M.     U$ )a4  Return a dict summarizing the line coverage data.

Keys are based on the file names, and values are the number of executed
lines.  If `fullpath` is true, then the keys are the full pathnames of
the files, otherwise they are the basenames of the files.

Returns a dict mapping file names to counts of lines.

c                ó   • U $ ©N© )Úfs    ÚJ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/coverage/data.pyÚ<lambda>Úline_counts.<locals>.<lambda>+   s   € ¡ó    )ÚosÚpathÚbasenameÚmeasured_filesÚlinesÚlen)ÚdataÚfullpathÚsummÚfilename_fnÚfilenamer   s         r   Úline_countsr$      sg   € ð €Dæá!‰ä—g‘g×&Ñ&ˆØ×'Ñ'Ö)ˆØ—
‘
˜8Ó$ˆØÑ Ð Ð Ü&)¨%£jˆˆ[˜Ó"Ó#ñ *ð €Kr   c                ó  • U R                  5       (       a3  UR                  [        U R                  U5      =(       d    / 5      5        OUR                  [	        X5      5        UR                  U R                  U5      5        g)zºContribute `filename`'s data to the `hasher`.

`hasher` is a `coverage.misc.Hasher` instance to be updated with
the file's data.  It should only get the results data, not the run
data.

N)Úhas_arcsÚupdateÚsortedÚarcsÚsorted_linesÚfile_tracer)r   r#   Úhashers      r   Úadd_data_to_hashr-   5   sV   € ð ‡}�}‡�Ø�‰”f˜TŸY™Y xÓ0×6°BÓ7Õ8à�‰”l 4Ó2Ô3Ø
‡M�M�$×"Ñ" 8Ó,Õ-r   c                ó   • [         R                  R                  [         R                  R                  U 5      5      u  p#U=(       d    U/n/ nU GH  n[         R                  R	                  U5      (       a0  UR                  [         R                  R                  U5      5        MX  [         R                  R                  U5      (       a{  [        R                  " [         R                  R                  [         R                  R                  U5      U5      5      S-   nUR                  [        R                  " U5      5        M÷  [        SU S35      e   U Vs/ s H  owR                  S5      (       a  M  UPM     nn[        U5      $ s  snf )z³Make a list of data files to be combined.

`data_file` is a path to a data file.  `data_paths` is a list of files or
directories of files.

Returns a list of absolute file paths.
z.*z)Couldn't combine from non-existent path 'Ú'z-journal)r   r   ÚsplitÚabspathÚisfileÚappendÚisdirÚglobÚescapeÚjoinÚextendr   Úendswithr(   )Ú	data_fileÚ
data_pathsÚdata_dirÚlocalÚfiles_to_combineÚpÚpatternÚfnms           r   Úcombinable_filesrB   D   s  € ô —g‘g—m‘m¤B§G¡G§O¡O°IÓ$>Ó?�O€Hà×) ˜z€JØÐÜˆÜ�7‰7�>‰>˜!×ÑØ×#Ñ#¤B§G¡G§O¡O°AÓ$6Ö7Ü�W‰W�]‰]˜1×ÑÜ—k’k¤"§'¡'§,¡,¬r¯w©w¯©¸qÓ/AÀ5Ó"IÓJÈTÑQˆGØ×#Ñ#¤D§I¢I¨gÓ$6Ö7äÐ IÈ!ÈÈAÐNÓOÐOñ ñ (8ÓXÒ'7 ¿|¹|ÈJ×?WŸÑ'7ÐÐXô
 Ð"Ó#Ð#ùò Ys   ÅFÅ8Fc                ó6  • [        U 5      nU(       a  US   (       a  US   $ [        U S5       n[        R                  " SSS9nUR	                  UR                  5       5        SSS5        UR                  5       $ ! , (       d  f       WR                  5       $ = f)z%Get the hash of the data in the file.ÚhashÚrbÚsha3_256F)ÚusedforsecurityN)r   ÚopenÚhashlibÚnewr'   ÚreadÚ	hexdigest)Ú
dbfilenameÚmÚfobjr,   s       r   Úhash_for_data_filerP   c   s}   € ä�zÓ"€AÞˆQˆv�YØ�‰yÐä�*˜dÔ# tÜ—[’[ ¸UÑCˆFØ�M‰M˜$Ÿ)™)›+Ô&÷ $ð ×ÑÓ!Ð!÷ $Ô#ð ×ÑÓ!Ð!ús   ®5A;Á;
Bc                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚDataFileClassifieréo   z.Track what files to combine and which to skip.c                ó"   • [        5       U l        g r   )ÚsetÚfile_hashes)Úselfs    r   Ú__init__ÚDataFileClassifier.__init__r   s   € Ü%(£UˆÕr   c                ó’   •  [        U5      nX R                  ;   a  gU R                  R                  U5        g! [         a     gf = f)z/Determine whether to combine or skip this file.ÚcombineÚskip)rP   Ú	ExceptionrV   Úadd)rW   r   Úshas      r   ÚclassifyÚDataFileClassifier.classifyu   sO   € ð	Ü$ QÓ'ˆCð
 ×"Ñ"Ó"Øà×Ñ× Ñ  Ô%Øøô ó 	ñ ð	ús   ‚9 ¹
AÁA)rV   N)ÚreturnÚNone)r   Ústrrb   zLiteral['combine', 'skip'])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rX   r`   Ú__static_attributes__r   r   r   rR   rR   o   s   † Ù8ô+÷r   rR   c                óÈ  • [        U R                  5       U5      nU(       a  U(       d  [        S5      eUc  SnO [        R                  " UR
                  5      n[        5       nSn	S=n
=p¼U GHæ  nXÐR                  5       :X  aA  U R                  R                  S5      (       a  U R                  R                  SU< 35        MX   [        R                  R                  U5      nUR                  U5      nU(       + nUS:X  a¹  U R                  R                  S5      (       a  U R                  R                  SU< 35         [!        XÐR                  S	9nUR#                  5         U R%                  UUS
9  U
S-  n
Sn	U R                  R                  S5      (       a  U R                  R                  SU 35        OCUS-  nU R                  R                  S5      (       a  U R                  R                  SU 35        U(       d  GMœ  U R                  R                  S5      (       a  U R                  R                  SU< 35        [-        U5        GMé     U(       a  U	(       d  [        S5      eU(       aM  X«-   U-   S:”  aA  S[/        U
S5       3nU(       a  USU 3-  nU(       a  US[/        US5       S3-  nU" U5        ggg! [         a    Un GNðf = f! [&         a~  nUS-  nU R(                  (       a  U R)                  [+        U5      5        U R                  R                  S5      (       a!  U R                  R                  SU SU 35        Sn SnAGN]SnAff = f)a»  Combine a number of data files together.

`data` is a CoverageData.

Treat `data.filename` as a file prefix, and combine the data from all
of the data files starting with that prefix plus a dot.

If `aliases` is provided, it's a `PathAliases` object that is used to
re-map paths to match the local machine's.

If `data_paths` is provided, it is a list of directories or files to
combine.  Directories are searched for files that start with
`data.filename` plus dot as a prefix, and those files are combined.

If `data_paths` is not provided, then the directory portion of
`data.filename` is used as the directory to search for data files.

Unless `keep` is True every data file found and combined is then deleted
from disk. If a file cannot be read, a warning will be issued, and the
file will not be deleted.

If `strict` is true, and no files are found to combine, an error is
raised.

`message` is a function to use for printing messages to the user.

zNo data to combineNFr   ÚdataiozSkipping combining ourself: r[   zCombining data file )Údebug)Úmap_pathé   TzCombined data file zCouldn't combine data file ú: zSkipping duplicate data zDeleting data file zNo usable data filesz	Combined Úfilez
, skipped z, z errored)rB   Úbase_filenamer   Ú	functoolsÚcacheÚmaprR   Údata_filenameÚ_debugÚshouldÚwriter   r   ÚrelpathÚ
ValueErrorr`   r   rK   r'   r   Ú_warnrd   r   r   )r   Úaliasesr;   ÚstrictÚkeepÚmessager>   rn   Ú
classifierÚcombined_anyÚcombinedÚskippedÚerroredr   Úrel_file_nameÚfile_actionÚdelete_this_oneÚnew_dataÚexcÚmsgs                       r   Úcombine_parallel_datarŒ   „   sû  € ôF (¨×(:Ñ(:Ó(<¸jÓIÐæÖ&ÜÐ.Ó/Ð/à�Ø‰ä—?’? 7§;¡;Ó/ˆä#Ó%€JØ€Là#$Ð$€HÐ$ˆwÜˆØ×"Ñ"Ó$Ó$ð �{‰{×!Ñ! (×+Ñ+Ø—‘×!Ñ!Ð$@ÀÁÐ"FÔGÙð	ÜŸG™GŸO™O¨AÓ.ˆMð !×)Ñ)¨!Ó,ˆà"œ(ˆØ˜)Ó#Ø�{‰{×!Ñ! (×+Ñ+Ø—‘×!Ñ!Ð$8¸¹Ð">Ô?ðMÜ'¨·±Ñ=�Ø—‘”ð —‘˜H¨x�Ñ8Ø˜A‘�Ø#�Ø—;‘;×%Ñ% i×0Ñ0Ø—K‘K×%Ñ%Ð(;¸M¸?Ð&KÔLøà�q‰LˆGØ�{‰{×!Ñ! )×,Ñ,Ø—‘×!Ñ!Ð$<¸]¸OÐ"LÔMç‰?Ø�{‰{×!Ñ! (×+Ñ+Ø—‘×!Ñ!Ð$7¸±uÐ"=Ô>Ü˜�Oña öd –lÜÐ0Ó1Ð1æ�HÑ&¨Ñ0°1Ó4Øœ& ¨6Ó2Ð3Ð4ˆÞØ�Z ˜yÐ)Ñ)ˆCÞØ�Rœ˜w¨Ó/Ð0°Ð9Ñ9ˆCÙ��ð 5€wøôW ó 	ð ‹Mð		ûô %ó (Ø˜1‘�Ø—:—:ð —J‘Jœs 3›xÔ(Ø—;‘;×%Ñ% i×0Ñ0Ø—K‘K×%Ñ%Ð(CÀMÀ?ÐRTÐUXÐTYÐ&ZÔ[Ø"'–ûð(ús+   ÃKÅ#KËKËKË
M!Ë#A3MÍM!c                ó,  • [        U 5      nUR                  5       n [        SU  35        [        R                  R                  U 5      (       d  [        S5        gUR                  5         [        SUR                  5       < 35        [        USS9n[        UR                  5       5      n[        U5      n[        [        US5       S35        U HB  nU S	[        X%   S
5       3nUR                  U5      nU(       a	  USU S3-  n[        U5        MD     g)z(Implementation of 'coverage debug data'.zpath: z%No data collected: file doesn't existNz
has_arcs: T)r    rq   Ú:rp   Úlinez [Ú])r   rv   Úprintr   r   ÚexistsrK   r&   r$   r   Úkeysr   r   r+   )r#   r   ÚsummaryÚ	filenamesÚnfilesr   r�   Úplugins           r   Údebug_data_filer˜   ó   só   € ä˜Ó!€DØ×!Ñ!Ó#€HÜ	ˆF�8�*Ð
ÔÜ�7‰7�>‰>˜(×#Ñ#ÜÐ5Ô6ØØ‡I�I„KÜ	ˆJ�t—}‘}“Ñ)Ð
*Ô+Ü˜$¨Ñ.€GÜ˜WŸ\™\›^Ó,€IÜ�‹^€FÜ	ŒV�F˜FÓ#Ð$ AÐ
&Ô'ÛˆØ��B”v˜g™j¨&Ó1Ð2Ð3ˆØ×!Ñ! !Ó$ˆÞØ�b˜˜ �NÑ"ˆDÜˆdŽò r   c                óL   • U R                  U5      n[        U=(       d    / 5      $ )z+Get the sorted lines for a file, for tests.)r   r(   )r   r#   r   s      r   r*   r*   	  s   € à�J‰J�xÓ €EÜ�%—+˜2ÓÐr   )F)r   r   r    Úboolrb   zdict[str, int])r   r   r#   rd   r,   r
   rb   rc   r   )r:   rd   r;   úIterable[str] | Nonerb   z	list[str])rM   rd   rb   rd   )NNFFN)r   r   r}   zPathAliases | Noner;   r›   r~   rš   r   rš   r€   zCallable[[str], None] | Nonerb   rc   )r#   rd   rb   rc   )r   r   r#   rd   rb   z	list[int])"ri   Ú
__future__r   rs   r5   rI   Úos.pathr   Úcollections.abcr   r   Útypingr   Úcoverage.exceptionsr   r   Úcoverage.filesr	   Úcoverage.miscr
   r   r   r   Úcoverage.sqldatar   r   r$   r-   rB   rP   rR   rŒ   r˜   r*   r   r   r   Ú<module>r¤      s¼   ðñõ #ã Û Û Û ß .Ý ç >Ý &ß DÓ DÝ 9Ý +öô0.ö$ô>	"÷ñ ð. #'Ø'+ØØØ,0ðlØ
ðlàðlð %ðlð ð	lð
 ðlð *ðlð 
õlô^õ,r   