§
    øÛgë"  ã                   óÔ   — d Z ddlZddlZddlZddlmZmZ  G d„ de	¦  «        Z
 G d„ d¦  «        Zd„ Zd	„ Z ej        d
¬¦  «        d„ ¦   «         Zej        d„ ¦   «         Zd„ Zd„ ZdS )zŽ
merged implementation of the cache provider

the name cache was not choosen to ensure pluggy automatically
ignores the external pytest-cache
é    N)ÚsepÚaltsepc                   ó,   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚCachec                 óˆ  — || _         |j                             d¦  «        | _        |j        j                             d¦  «        | _        |                     d¦  «        rb|                      d¦  «         | j                             ¦   «         r| j         	                    ¦   «          | j         
                    ¦   «          d S d S )Nz.cacheÚcacheÚ
cacheclearzclearing cachedir)ÚconfigÚrootdirÚjoinÚ	_cachedirÚtraceÚrootÚgetÚgetvalueÚcheckÚremoveÚmkdir)Úselfr
   s     úK/granary/edev/quantum/lib/python3.11/site-packages/_pytest/cacheprovider.pyÚ__init__zCache.__init__   s¯   € ØˆŒØœ×,Ò,¨XÑ6Ô6ˆŒØ”\Ô&×*Ò*¨7Ñ3Ô3ˆŒ
Ø�?Š?˜<Ñ(Ô(ð 	#Ø�JŠJÐ*Ñ+Ô+Ð+ØŒ~×#Ò#Ñ%Ô%ð (Ø”×%Ò%Ñ'Ô'Ð'ØŒN× Ò Ñ"Ô"Ð"Ð"Ð"ð		#ð 	#ó    c                 óˆ   — t           |v st          �t          |v rt          d¦  «        ‚| j                             d|¦  «        S )aÀ   return a directory path object with the given name.  If the
        directory does not yet exist, it will be created.  You can use it
        to manage files likes e. g. store/retrieve database
        dumps across test sessions.

        :param name: must be a string not containing a ``/`` separator.
             Make sure the name contains your plugin or application
             identifiers to prevent clashes with other cache users.
        Nz.name is not allowed to contain path separatorsÚd)Ú_sepÚ_altsepÚ
ValueErrorr   Ú
ensure_dir)r   Únames     r   ÚmakedirzCache.makedir   sA   € õ �4ˆ<ˆ<�7Ð.µ7¸d°?°?ÝÐMÑNÔNÐNØŒ~×(Ò(¨¨dÑ3Ô3Ð3r   c                 óN   —  | j         j        dg|                     d¦  «        ¢R Ž S )NÚvú/)r   r   Úsplit)r   Úkeys     r   Ú_getvaluepathzCache._getvaluepath'   s)   € Ø"ˆtŒ~Ô" 3Ð8¨¯ª°3©¬Ð8Ð8Ð8Ð8r   c                 ó.  — |                       |¦  «        }|                     ¦   «         rk	 |                     d¦  «        5 }t          j        |¦  «        cddd¦  «         S # 1 swxY w Y   n(# t
          $ r |                      d|›�¦  «         Y nw xY w|S )aŽ   return cached value for the given key.  If no value
        was yet cached or the value cannot be read, the specified
        default is returned.

        :param key: must be a ``/`` separated value. Usually the first
             name is the name of your plugin or your application.
        :param default: must be provided in case of a cache-miss or
             invalid cache values.

        ÚrNzcache-invalid at )r&   r   ÚopenÚjsonÚloadr   r   )r   r%   ÚdefaultÚpathÚfs        r   r   z	Cache.get*   sâ   € ð ×!Ò! #Ñ&Ô&ˆØ�:Š:‰<Œ<ð 	<ð<Ø—Y’Y˜s‘^”^ð ( qÝœ9 Q™<œ<ð(ð (ð (ð (ñ (ô (ð (ð (ð (ð (ð (ð (øøøð (ð (ð (ð (ð (øåð <ð <ð <Ø—
’
�
°D°DÐ:Ñ;Ô;Ð;Ð;Ð;ð<øøøàˆs5   «A- Á A!ÁA- Á!A%Á%A- Á(A%Á)A- Á-"BÂBc                 óR  — |                       |¦  «        }	 |                     ¦   «                              ¦   «          nK# t          j        j        t          j        j        f$ r# | j                             dd|›�¬¦  «         Y dS w xY w	 | 	                    d¦  «        }|5  |  
                    d|›d|›�¦  «         t          j        ||dd	¬
¦  «         ddd¦  «         dS # 1 swxY w Y   dS # t          j        j        $ r# | j                             dd|›�¬¦  «         Y dS w xY w)aP   save value for the given key.

        :param key: must be a ``/`` separated value. Usually the first
             name is the name of your plugin or your application.
        :param value: must be of any combination of basic
               python types, including nested types
               like e. g. lists of dictionaries.
        ÚI9zcould not create cache path )ÚcodeÚmessageNÚwzcache-write z: é   T)ÚindentÚ	sort_keyszcache could not write path )r&   Údirpathr   ÚpyÚerrorÚEEXISTÚEACCESr
   Úwarnr)   r   r*   ÚdumpÚENOTDIR)r   r%   Úvaluer-   r.   s        r   Úsetz	Cache.set>   s³  € ð ×!Ò! #Ñ&Ô&ˆð	Ø�LŠL‰NŒN×%Ò%Ñ'Ô'Ð'Ð'øÝ””¥¤¤Ð1ð 	ð 	ð 	ØŒK×ÒØ�TÀtÀtÐ#Mð ñ ô ð ð ˆFˆFð		øøøð
	>Ø—	’	˜#‘”ˆAð
 ð >ð >Ø—
’
�
°3°3°3¸¸Ð?Ñ@Ô@Ð@Ý”	˜% ¨1¸Ð=Ñ=Ô=Ð=ð>ð >ð >ñ >ô >ð >ð >ð >ð >ð >ð >ð >øøøð >ð >ð >ð >ð >ð >øõ	 ŒxÔð 	Nð 	Nð 	NØŒK×ÒØ�TÀdÀdÐ#Lð ñ Nô Nð Nð Nð Nð Nð	Nøøøs4   —&> ¾ABÂBÂ
C/ Â!4C"Ã"C&Ã)C&Ã/3D&Ä%D&N)Ú__name__Ú
__module__Ú__qualname__r   r    r&   r   r@   © r   r   r   r      s_   € € € € € ð#ð #ð #ð4ð 4ð 4ð9ð 9ð 9ðð ð ð(>ð >ð >ð >ð >r   r   c                   ó6   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	dS )	ÚLFPluginz< Plugin which implements the --lf (run last-failing) option c                 óº   ‡— ‰| _         d}t          ˆfd„|D ¦   «         ¦  «        | _        | j        r"‰j                             di ¦  «        | _        d S i | _        d S )N)ÚlfÚfailedfirstc              3   óB   •K  — | ]}‰                      |¦  «        V — Œd S ©N)r   )Ú.0r%   r
   s     €r   ú	<genexpr>z$LFPlugin.__init__.<locals>.<genexpr>_   s/   øè è € ÐFÐF°3˜&Ÿ/š/¨#Ñ.Ô.ÐFÐFÐFÐFÐFÐFr   úcache/lastfailed)r
   ÚanyÚactiver   r   Ú
lastfailed)r   r
   Úactive_keyss    ` r   r   zLFPlugin.__init__\   sf   ø€ ØˆŒØ)ˆÝÐFÐFÐFÐF¸+ÐFÑFÔFÑFÔFˆŒØŒ;ð 	!Ø$œl×.Ò.Ð/AÀ2ÑFÔFˆDŒOˆOˆOà ˆDŒOˆOˆOr   c                 óœ   — | j         rD| j        sd}n5dt          | j        ¦  «        | j                             d¦  «        rdndfz  }d|z  S d S )Nzrun all (no recorded failures)zrerun last %d failures%srI   z firstÚ zrun-last-failure: %s)rP   rQ   Úlenr
   r   )r   Úmodes     r   Úpytest_report_headerzLFPlugin.pytest_report_headere   so   € ØŒ;ð 	1Ø”?ð MØ7��à1Ý˜œÑ(Ô(Ø $¤× 4Ò 4°]Ñ CÔ CÐK�H�HÈð5Mñ M�ð *¨DÑ0Ð0ð	1ð 	1r   c                 ó´   — |j         rd|j        vrd| j        |j        <   d S |j         s-|j        dk    r$| j                             |j        d ¦  «         d S d S d S )NÚxfailTÚcall)ÚfailedÚkeywordsrQ   ÚnodeidÚwhenÚpop)r   Úreports     r   Úpytest_runtest_logreportz!LFPlugin.pytest_runtest_logreporto   ss   € ØŒ=ð 	9˜W¨F¬OÐ;Ð;Ø-1ˆDŒO˜FœMÑ*Ð*Ð*Ø”ð 	9ØŒ{˜fÒ$Ð$Ø”×#Ò# F¤M°4Ñ8Ô8Ð8Ð8Ð8ð	9ð 	9Ø$Ð$r   c                 óî   — |j         dv }|rZ|j        | j        v rJ| j                             |j        ¦  «         | j                             d„ |j        D ¦   «         ¦  «         d S d S d| j        |j        <   d S )N)ÚpassedÚskippedc              3   ó(   K  — | ]}|j         d fV — ŒdS )TN)r]   )rL   Úitems     r   rM   z0LFPlugin.pytest_collectreport.<locals>.<genexpr>{   s=   è è € ð '/ð '/àð ”[ $Ð'ð'/ð '/ð '/ð '/ð '/ð '/r   T)Úoutcomer]   rQ   r_   ÚupdateÚresult)r   r`   rc   s      r   Úpytest_collectreportzLFPlugin.pytest_collectreportv   sž   € Ø”Ð#8Ð8ˆØð 	2ØŒ} ¤Ð/Ð/Ø”×#Ò# F¤MÑ2Ô2Ð2Ø”×&Ò&ð '/ð '/à &¤ð'/ñ '/ô '/ñ /ô /ð /ð /ð /ð 0Ð/ð .2ˆDŒO˜FœMÑ*Ð*Ð*r   c                 óJ  — | j         r™| j        r”g }g }|D ];}|j        | j        v r|                     |¦  «         Œ&|                     |¦  «         Œ<|s|rd S | j                             d¦  «        r||z   |d d …<   d S ||d d …<   |j                             |¬¦  «         d S d S d S )NrI   )Úitems)rP   rQ   r]   Úappendr
   r   ÚhookÚpytest_deselected)r   Úsessionr
   rl   Úpreviously_failedÚpreviously_passedrf   s          r   Úpytest_collection_modifyitemsz&LFPlugin.pytest_collection_modifyitems�   sý   € ØŒ;ð 	G˜4œ?ð 	GØ "ÐØ "ÐØð 3ð 3�Ø”; $¤/Ð1Ð1Ø%×,Ò,¨TÑ2Ô2Ð2Ð2à%×,Ò,¨TÑ2Ô2Ð2Ð2Ø$ð GÐ):ð Gð �Ø”×%Ò% mÑ4Ô4ð GØ,Ð/@Ñ@��a�a�a‘��à,��a�a�a‘Ø”×-Ò-Ð4EÐ-ÑFÔFÐFÐFÐFð!	Gð 	Gð 	Gð 	Gr   c                 ó   — | j         }|                     d¦  «        st          |d¦  «        rd S |j                             dd ¦  «        d u}|j        r|s| j        r"|j                             d| j        ¦  «         d S d S )NÚ	cacheshowÚ
slaveinputrN   )r
   r   Úhasattrr   r   ÚtestscollectedrQ   r@   )r   rp   r
   Úprev_faileds       r   Úpytest_sessionfinishzLFPlugin.pytest_sessionfinish”   s›   € Ø”ˆØ�?Š?˜;Ñ'Ô'ð 	­7°6¸<Ñ+HÔ+Hð 	ØˆFØ”l×&Ò&Ð'9¸4Ñ@Ô@ÈÐLˆØÔ"ð 	B {ð 	B°t´ð 	BØŒL×ÒÐ/°´ÑAÔAÐAÐAÐAð	Bð 	Br   N)
rA   rB   rC   Ú__doc__r   rW   ra   rj   rs   rz   rD   r   r   rF   rF   Z   s|   € € € € € ØFÐFð!ð !ð !ð1ð 1ð 1ð9ð 9ð 9ð	2ð 	2ð 	2ðGð Gð Gð&Bð Bð Bð Bð Br   rF   c                 óü   — |                       d¦  «        }|                     ddddd¬¦  «         |                     dd	dd
d¬¦  «         |                     dddd¬¦  «         |                     dddd¬¦  «         d S )NÚgeneralz--lfz--last-failedÚ
store_truerH   zHrerun only the tests that failed at the last run (or all if none failed))ÚactionÚdestÚhelpz--ffz--failed-firstrI   zxrun all tests but run the last failures first.  This may re-order tests and thus lead to repeated fixture setup/teardownz--cache-showru   z6show cache contents, don't perform collection or testsz--cache-clearr	   z/remove all cache contents at start of test run.)ÚgetgroupÚ	addoption)ÚparserÚgroups     r   Úpytest_addoptionr†   �   sÈ   € Ø�OŠO˜IÑ&Ô&€EØ	‡O‚OØ�¨¸4ð7ð ñ 8ô 8ð 8ð 
‡O‚OØÐ ¨¸Mð/ð ñ 0ô 0ð 0ð
 
‡O‚OØ˜|°+ØEð ñ Gô Gð Gð 
‡O‚OØ °<Ø>ð ñ @ô @ð @ð @ð @r   c                 óL   — | j         j        rddlm}  || t          ¦  «        S d S )Nr   )Úwrap_session)Úoptionru   Ú_pytest.mainrˆ   )r
   rˆ   s     r   Úpytest_cmdline_mainr‹   °   s=   € Ø„}Ôð /Ø-Ð-Ð-Ð-Ð-Ð-Øˆ|˜F¥IÑ.Ô.Ð.ð/ð /r   T)Útryfirstc                 ó~   — t          | ¦  «        | _        | j                             t	          | ¦  «        d¦  «         d S )NÚlfplugin)r   r   ÚpluginmanagerÚregisterrF   )r
   s    r   Úpytest_configurer‘   ·   s6   € å˜‘=”=€F„LØ
Ô×!Ò!¥(¨6Ñ"2Ô"2°JÑ?Ô?Ð?Ð?Ð?r   c                 ó   — | j         j        S )ag  
    Return a cache object that can persist state between testing sessions.

    cache.get(key, default)
    cache.set(key, value)

    Keys must be a ``/`` separated value, where the first part is usually the
    name of your plugin or application to avoid clashes with other cache users.

    Values can be any object handled by the json stdlib module.
    )r
   r   )Úrequests    r   r   r   ½   s   € ð Œ>ÔÐr   c                 óž   — | j         j        r@t          j                             ¦   «                              | j        j        ¦  «        }d|z  S d S )Nzcachedir: %s)r‰   Úverboser8   r-   ÚlocalÚbestrelpathr   r   )r
   Úrelpaths     r   rW   rW   Í   sF   € Ø„}Ôð (Ý”'—-’-‘/”/×-Ò-¨f¬lÔ.DÑEÔEˆØ Ñ'Ð'ð(ð (r   c                 óJ  — ddl m } t          j                             ¦   «         }|                     dt          | j        j        ¦  «        z   ¦  «         | j        j                             ¦   «         s|                     d¦  «         dS t          ¦   «         }| j        j        }| 
                    d¦  «        }|                     dd¦  «         |                     d„ ¦  «        D ]ì}|                     |¦  «                             |j        d	¦  «        }| j                             ||¦  «        }	|	|u r|                     d
|z  ¦  «         Œh|                     d|z  ¦  «         t          j                             ¦   «         }
 ||	|
¬¦  «         |
                     ¦   «                              ¦   «         D ]}|                     d|z   ¦  «         ŒŒí| 
                    d¦  «        }|                     ¦   «         r©|                     ¦   «         r•|                     dd¦  «         | 
                    d¦  «                             ¦   «         D ]W}|                     ¦   «         rA|                     |¦  «        }|                     d||                     ¦   «         fz  ¦  «         ŒXdS )Nr   )Úpprintz
cachedir: zcache is emptyr"   ú-zcache valuesc                 ó*   — |                       ¦   «         S rK   )Úisfile)Úxs    r   ú<lambda>zcacheshow.<locals>.<lambda>Þ   s   € ¨¯ª©
¬
€ r   r#   z/%s contains unreadable content, will be ignoredz%s contains:)Ústreamz  r   zcache directoriesz%s is a file of length %d)rš   r8   ÚioÚTerminalWriterÚlineÚstrr   r   r   Úobjectr   r   ÚvisitÚreltoÚreplacer   ÚTextIOr   Ú
splitlinesÚisdirÚlistdirr�   Úsize)r
   rp   rš   ÚtwÚdummyÚbasedirÚvdirÚvalpathr%   Úvalr    r£   ÚddirÚps                 r   ru   ru   Ó   s…  € ØÐÐÐÐÐÝ	Œ×	Ò	Ñ	Ô	€BØ‡G‚GˆL�3˜vœ|Ô5Ñ6Ô6Ñ6Ñ7Ô7Ð7ØŒ<Ô!×'Ò'Ñ)Ô)ð Ø
�ŠÐ Ñ!Ô!Ð!ØˆqÝ‰HŒH€EØŒlÔ$€GØ�<Š<˜ÑÔ€DØ‡F‚Fˆ3�ÑÔÐØ—:’:Ð2Ð2Ñ3Ô3ð %ð %ˆØ�mŠm˜DÑ!Ô!×)Ò)¨'¬+°sÑ;Ô;ˆØŒl×Ò˜s EÑ*Ô*ˆØ�%ˆ<ˆ<Ø�GŠGð $Ø&)ñ*ñ +ô +ð +ð +ð �GŠG�N SÑ(Ñ)Ô)Ð)Ý”U—\’\‘^”^ˆFØˆF�3˜vÐ&Ñ&Ô&Ð&ØŸšÑ)Ô)×4Ò4Ñ6Ô6ð %ð %�Ø—’˜˜t™Ñ$Ô$Ð$Ð$ð%ð �<Š<˜ÑÔ€DØ‡z‚z�|„|ð (˜Ÿš™œð (Ø
�ŠˆsÐ'Ñ(Ô(Ð(Ø—’˜cÑ"Ô"×(Ò(Ñ*Ô*ð 	(ð 	(ˆAð �xŠx‰zŒzð (Ø—g’g˜gÑ&Ô&�Ø—’Ð3Ø˜QŸVšV™XœXð7'ñ 'ñ (ô (ð (øàˆ1r   )r{   r8   Úpytestr*   Úos.pathr   r   r   r   r¥   r   rF   r†   r‹   Úhookimplr‘   Úfixturer   rW   ru   rD   r   r   ú<module>rº      sD  ððð ð 
€	€	€	Ø €€€Ø €€€Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2ðI>ð I>ð I>ð I>ð I>ˆFñ I>ô I>ð I>ðX@Bð @Bð @Bð @Bð @Bñ @Bô @Bð @BðF@ð @ð @ð&/ð /ð /ð €„˜$ÐÑÔð@ð @ñ  Ôð@ð
 „ð ð  ñ „ð ð(ð (ð (ð"ð "ð "ð "ð "r   