+
     ]i  c                   s    R t ^ RIHt ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t^ RI
Ht ]P                  ! ]4      tR tR tR tRR ltR	R/R
 ltR tR tR tR tR# )z
Helper functions for testing.
)Path)TemporaryDirectoryN)_apic                  sx    R \         P                  R&   R\         P                  R&   ^\         P                  R&   R# )zDejaVu Sanszfont.familyZnoneztext.hintingztext.hinting_factorNmplZrcParams     B/usr/lib64/python3.14/site-packages/matplotlib/testing/__init__.pyset_font_settings_for_testingr      s-    "/CLL#)CLL *+CLL&'r   c                  s,    R \         P                  R&   R# )
matplotlibzsvg.hashsaltNr   r   r   r   set_reproducibility_for_testingr
      s    #/CLL r   c                  s&    \         P                  ! \         P                  R 4       \        P                  ! R4       \        P                  ! 4       ;_uu_ 4        \        P                  ! 4        RRR4       \        4        \        4        R#   \         P                   d[     \         P                  ! \         P                  R4        L  \         P                   d    \        P                  R4         Li ; ii ; i  + '       g   i     L; i)zen_US.UTF-8zEnglish_United States.1252zPCould not set locale to English/United States. Some date-related tests may fail.ZAggN)localeZ	setlocaleZLC_ALLZError_logZwarningr   Zuser   Z'suppress_matplotlib_deprecation_warningZ
rcdefaultsr   r
   r   r   r   setupr      s    56 GGEN		5	5	7	7 
8
 "##%! << 5	5V]],HI|| 	5LL45	55 
8	7s5   %B D C=$%C*C95C=8C99C= D	c           
     s    V'       d   \         P                  ;r4 \         P                  ! WW%W4VR7      pV#   \         d-    \        P
                  R8X  d   ^ RIp	T	P                  R4       h i ; i)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textZcygwinNzFork failure)
subprocessPIPEZrunZBlockingIOErrorsysplatformpytestZxfail)
Zcommandr   r   r   r   r   r   capture_outputprocr   s
   &&&&&&&&  r   subprocess_run_for_testingr   5   si    L $//)~~	
 K  <<8#LL(s	   7 7A.	extra_envc               s<   V P                   pV P                  pV P                  P                  p\	        \
        P                  RRV: RV: RV R2.VO/ \        P                  CRR/CT;'       g    / CVR\        P                  \        P                  RR	7      pV# )
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()ZSOURCE_DATE_EPOCHZ0Tr   )__name__Z
__module__Z__code__Zco_filenamer   r   Z
executableosZenvironr   r   )Zfuncr   r   ZargsZtargetZmoduleZfiler   s   &$$*    r   subprocess_run_helperr!   m   s     ]]F__F==$$D%NN>>DZr$ R hb	"		
 		
 JrzzI.I	RItD" Kr   c           	     s~   \        4       ;_uu_ 4       p\        VR4      pVP                  RRR7        \        P                  ! V R\        V4      .V\        P                  \        P                  R7        RRR4       R	#   \        \        P                  3 d     RRR4       R# i ; i  + '       g   i     R# ; i)
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)Zencodingz-halt-on-error)Zcwdr   r   NFT)	r   r    Z
write_textr   Z
check_callZstrZDEVNULLZOSErrorZCalledProcessError)Z	texsystemZtmpdirZtex_paths   &  r   _check_for_pgfr"      s     
		
+   	 		!!,c(m<&!))*2D2DF
 ! 
	 667 	 
		 
		s/    B+AB6B+B(B+'B((B++B<	c                 sp     \         P                  P                  V  R 24       R#   \         d     R# i ; i)z.styTF)r   ZdvireadZfind_tex_fileZFileNotFoundError)Zpackages   &r   _has_tex_packager#      s5    !!WIT"23 s   "& 55c                 sv   ^ RI pVP                  R4      p\        P                  R8X  d   VP	                  R4       VP
                  R,          R8X  d   V R8X  d   VP	                  R4       VP                  4        F!  w  rEVP
                  R,          V8  g   K  Tp M	  R	p\        R
RRV  2RV.RRR7      pR# )    NIPythonZwin32z>Cannot change backend running IPython in subprocess on Windows:Ni   NZosxz:Bug using macosx backend in IPython 8.24.0 fixed in 8.24.1:Ni   Nzpimport matplotlib as mpl, matplotlib.pyplot as plt;fig, ax=plt.subplots(); ax.plot([1, 3, 2]); mpl.get_backend()Zipythonz--no-simple-promptz--matplotlib=r   T)r   r   )i   i   r$   )r   Zimportorskipr   r   ZskipZversion_infoZitemsr   )	Z"requested_backend_or_gui_frameworkZall_expected_backendsr   r%   Zmin_versionZbackendZexpected_backendZcoder   s	   &&       r   ipython_in_subprocessr&      s    !!),G
||wTUR J..%7PQ !6 ; ; =#{2& !>
LD% >?@$		
 	Dr   c                  s^    . ROp V  F"  p\         P                  ! V4      '       g   K!   R# 	  R# )CITF)r'   ZCONTINUOUS_INTEGRATIONZTRAVISZCIRCLECIZJENKINSZ	GITLAB_CIZGITHUB_ACTIONSZTEAMCITY_VERSION)r    Zgetenv)Zci_environment_variablesZenv_vars     r   is_ci_environmentr(      s-    
  ,99W , r   )Ni<   NNFTF)Z__doc__Zpathlibr    Ztempfiler   r   Zloggingr    r   r   r	   r   r   Z	getLoggerr   r   r   r
   r   r   r!   r"   r#   r&   r(   r   r   r   <module>r)      so     '   	  
  ",0&25p"$ "J8ADr   