ó
    [h  ã                   óÈ   • S r SSKJ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	r	SSK
rSSK
Jr  \R                  " \5      rS rS rS r   SS	 jrSS
.S jrS rS rS rS rg)z
Helper functions for testing.
é    )ÚPath)ÚTemporaryDirectoryN)Ú_apic                  óv   • S[         R                  S'   S[         R                  S'   S[         R                  S'   g )NzDejaVu Sanszfont.familyÚnoneztext.hintingé   ztext.hinting_factor©ÚmplÚrcParams© ó    Új/home/gothic/public_html/Fooocus/fooocus_env/lib64/python3.13/site-packages/matplotlib/testing/__init__.pyÚset_font_settings_for_testingr      s-   € Ø"/„C‡L�L�ÑØ#)„C‡L�L�Ñ Ø*+„C‡L�LÐ&Ò'r   c                  ó*   • S[         R                  S'   g )NÚ
matplotlibzsvg.hashsaltr	   r   r   r   Úset_reproducibility_for_testingr      s   € Ø#/„C‡L�L�Ò r   c                  ó  •  [         R                  " [         R                  S5        [        R                  " S5        [        R                  " 5          [        R                  " 5         S S S 5        [        5         [        5         g ! [         R                   aY     [         R                  " [         R                  S5         Nš! [         R                   a    [        R                  S5          NÆf = ff = f! , (       d  f       N“= f)Nzen_US.UTF-8zEnglish_United States.1252zPCould not set locale to English/United States. Some date-related tests may fail.ÚAgg)ÚlocaleÚ	setlocaleÚLC_ALLÚErrorÚ_logÚwarningr
   Úuser   Ú'suppress_matplotlib_deprecation_warningÚ
rcdefaultsr   r   r   r   r   Úsetupr      s­   € ð5Ü×ÒœŸ™¨Ô6ô ‡G‚GˆE„Nä	×	5Ò	5Õ	7Ü�ŠÔ÷ 
8ô
 "Ô#Ü#Õ%øô! �<‰<ó 5ð	5Ü×ÒœVŸ]™]Ð,HÖIøÜ�|‰|ó 	5Ü�L‰Lð4÷5ð	5úð5ú÷ 
8Õ	7ús5   ‚%B ÁC5ÂC2Â%CÃ)C.Ã*C2Ã-C.Ã.C2Ã5
Dc           
      óÖ   • U(       a  [         R                  =p4 [         R                  " XX%X4US9nU$ ! [         a+    [        R
                  S:X  a  SSKn	U	R                  S5        e f = f)a  
Create and run a subprocess.

Thin wrapper around `subprocess.run`, intended for testing.  Will
mark fork() failures on Cygwin as expected failures: not a
success, but not indicating a problem with the code either.

Parameters
----------
args : list of str
env : dict[str, str]
timeout : float
stdout, stderr
check : bool
text : bool
    Also called ``universal_newlines`` in subprocess.  I chose this
    name since the main effect is returning bytes (`False`) vs. str
    (`True`), though it also tries to normalize newlines across
    platforms.
capture_output : bool
    Set stdout and stderr to subprocess.PIPE

Returns
-------
proc : subprocess.Popen

See Also
--------
subprocess.run

Raises
------
pytest.xfail
    If platform is Cygwin and subprocess reports a fork() failure.
©ÚenvÚtimeoutÚcheckÚstdoutÚstderrÚtextÚcygwinr   NzFork failure)Ú
subprocessÚPIPEÚrunÚBlockingIOErrorÚsysÚplatformÚpytestÚxfail)
Úcommandr!   r"   r$   r%   r#   r&   Úcapture_outputÚprocr.   s
             r   Úsubprocess_run_for_testingr3   5   si   € öL Ü$Ÿ/™/Ð)ˆðÜ�~Š~ØØØØñ	
ˆð €Køô ó Ü�<‰<˜8Ó#ãØ�L‰L˜Ô(Øðús	   š3 ³5A()Ú	extra_envc                ó4  • U R                   nU R                  nU R                  R                  n[	        [
        R                  SSU< SU< SU S3/UQ0 [        R                  ESS0EU=(       d    0 EUS[        R                  [        R                  SS	9nU$ )
ag  
Run a function in a sub-process.

Parameters
----------
func : function
    The function to be run.  It must be in a module that is importable.
*args : str
    Any additional command line arguments to be passed in
    the first argument to ``subprocess.run``.
extra_env : dict[str, str]
    Any additional environment variables to be set for the subprocess.
ú-czEimport importlib.util;_spec = importlib.util.spec_from_file_location(z, z]);_module = importlib.util.module_from_spec(_spec);_spec.loader.exec_module(_module);_module.z()ÚSOURCE_DATE_EPOCHÚ0Tr    )Ú__name__Ú
__module__Ú__code__Úco_filenamer3   r,   Ú
executableÚosÚenvironr(   r)   )Úfuncr"   r4   ÚargsÚtargetÚmoduleÚfiler2   s           r   Úsubprocess_run_helperrE   m   s©   € ð �]‰]€FØ�_‰_€FØ�=‰=×$Ñ$€DÜ%ä�N‰NØð>Ø>D¹ZÀrÈ$Éð Rð �h˜bð	"ð		
ð ð		
ð JŒr�z‰zÐIÐ.°ÑI¸	¿ÀRÐIØ˜tÜ�‰Ü�‰Øñ€Dð" €Kr   c                 óV  • [        5        n[        US5      nUR                  SSS9   [        R                  " U S[        U5      /U[        R                  [        R                  S9   SSS5        g	! [        [        R                  4 a     SSS5        gf = f! , (       d  f       g= f)
zx
Check if a given TeX system + pgf is available

Parameters
----------
texsystem : str
    The executable name to check
ztest.texzÁ
            \documentclass{article}
            \usepackage{pgf}
            \begin{document}
            \typeout{pgfversion=\pgfversion}
            \makeatletter
            \@@end
        zutf-8)Úencodingz-halt-on-error)Úcwdr$   r%   NFT)	r   r   Ú
write_textr(   Ú
check_callÚstrÚDEVNULLÚOSErrorÚCalledProcessError)Ú	texsystemÚtmpdirÚtex_paths      r   Ú_check_for_pgfrR   ’   s¨   € ô 
Ô	 Ü˜ 
Ó+ˆØ×Ñð ð ð 	ñ 	ð	Ü×!Ò!ØÐ,¬c°(«mÐ<À&Ü!×)Ñ)´*×2DÑ2DòFð
 ÷! 
Ð	øô œ×6Ñ6Ð7ó 	Ø÷ 
Ð	ð	ú÷ 
Õ	ús.   ‹B©?A2Á(BÁ2BÂBÂBÂBÂ
B(c                 ój   •  [         R                  R                  U  S35        g! [         a     gf = f)Nz.styTF)r
   ÚdvireadÚfind_tex_fileÚFileNotFoundError)Úpackages    r   Ú_has_tex_packagerX   ®   s5   € ðÜ�‰×!Ñ! W I¨TÐ"2Ô3ØøÜó Ùðús   ‚"% ¥
2±2c                 ó¾  • SS K nUR                  S5      n[        R                  S:X  a  UR	                  S5        UR
                  S S S:X  a  U S:X  a  UR	                  S5        UR                  5        H  u  pEUR
                  S S	 U:¼  d  M  Un  O   S
n[        SSSU  3SU/SSS9nUR                  R                  5       R                  SW S35      (       d   eg )Nr   ÚIPythonÚwin32z>Cannot change backend running IPython in subprocess on Windowsé   )r   é   r   Úosxz:Bug using macosx backend in IPython 8.24.0 fixed in 8.24.1é   zpimport matplotlib as mpl, matplotlib.pyplot as plt;fig, ax=plt.subplots(); ax.plot([1, 3, 2]); mpl.get_backend()Úipythonz--no-simple-promptz--matplotlib=r6   T)r#   r1   Ú')r.   Úimportorskipr,   r-   ÚskipÚversion_infoÚitemsr3   r$   ÚstripÚendswith)	Ú"requested_backend_or_gui_frameworkÚall_expected_backendsr.   rZ   Úmin_versionÚbackendÚexpected_backendÚcoder2   s	            r   Úipython_in_subprocessrn   ¶   sõ   € ÛØ×!Ñ! )Ó,€Gä
‡|�|�wÓØ�‰ÐTÔUà×Ñ˜R˜aÐ  JÓ.Ø.°%Ó7Ø�‰ÐPÔQð !6× ;Ñ ;Ö =ÑˆØ×Ñ  Ð# {Õ2Ø&ÐÙñ !>ð
L€Dä%àØ ØÐ>Ð?Ð@Ø�$ð		
ð Øñ	€Dð �;‰;×ÑÓ×'Ñ'¨!Ð,<Ð+=¸QÐ(?×@Ñ@Ð@Ñ@r   c                  óX   • / SQn U  H   n[         R                  " U5      (       d  M     g   g)N)ÚCIÚCONTINUOUS_INTEGRATIONÚTRAVISÚCIRCLECIÚJENKINSÚ	GITLAB_CIÚGITHUB_ACTIONSÚTEAMCITY_VERSIONTF)r>   Úgetenv)Úci_environment_variablesÚenv_vars     r   Úis_ci_environmentr{   Ø   s-   € ò
 Ðó ,ˆÜ�9Š9�W×ÓÙñ ,ð r   )Né<   NNFTF)Ú__doc__Úpathlibr   Útempfiler   r   Úloggingr>   r(   r,   r   r
   r   Ú	getLoggerr9   r   r   r   r   r3   rE   rR   rX   rn   r{   r   r   r   Ú<module>r‚      sz   ðñõ Ý 'Û Û Û 	Û Û 
ã Ý à×Ò˜Ó"€ò,ò0ò&ð2 FJØ>BØ.3ô5ðp ;?õ "òJò8òAóDr   