ó
    “’¤jß-  ã                   óL  • S r SSKrSSKrSSKJr  SSKrSSKrSSKJr  SSK	r	\	R                  " SSS9  \" \5      R                  S-  rSS	 jrS
 rS r\	R"                  R%                  SSS/5      S 5       r\	R"                  R%                  SSS/5      S 5       rS rS rS rg)z2Tests for tinypages build using sphinx extensions.é    N)ÚPath)Úsubprocess_run_for_testingÚsphinxz4.1.3)Ú
minversionzdata/tinypagesc                 ó¶  • Uc  / OUn[         R                  SSSSS[        U5      [        U 5      [        U5      /	UQn[        USS0 [        R
                  ES[        R                  S.ES	9nUR                  nUR                  nUR                  S
:X  d   SU SU S35       eU(       a  [        R                  " SU 35        UR                  5       (       d   eg )Nz-msphinxz-Wz-bÚhtmlz-dTÚ )Ú
MPLBACKENDÚGCOV_ERROR_FILE)Úcapture_outputÚtextÚenvr   z!sphinx build failed with stdout:
z	
stderr:
Ú
z-sphinx build emitted the following warnings:
)ÚsysÚ
executableÚstrr   ÚosÚenvironÚdevnullÚstdoutÚstderrÚ
returncodeÚpytestÚfailÚis_dir)Ú
source_dirÚdoctree_dirÚhtml_dirÚ
extra_argsÚcmdÚprocÚoutÚerrs           Ú­C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\matplotlib/tests/test_sphinxext.pyÚbuild_sphinx_htmlr%      sÙ   € à!Ñ)‘¨z€JÜ�>‰>˜: t¨T°6Ø”�[Ó!¤3 z£?´C¸³MðPØDNðP€Cô
 &Ø˜D tØKŒr�z‰zÐK¨ÄÇ
Á
ÒKñ€Dð �+‰+€CØ
�+‰+€Cà�?‰?˜aÓð EØ
,¨S¨E°¸S¸EÀÐDóEÐæ
Ü�ŠÐDÀSÀEÐJÔKà�?‰?×ÑÐÑó    c           
      ó	  ^
^^• [         R                  " [        U S[         R                  " SSS5      S9  U S-  S-  nUS-  mU S-  m
[	        U T
U5        U4S jmU
4S	 jnU4S
 j[        SS5       5       u  p4n[        R                  " UT" S5      5      (       d   e[        R                  " UT" S5      5      (       d   e[        R                  " UT" S5      5      (       d   e[        R                  " UT" S5      5      (       d   e[        R                  " UT" S5      5      (       d   e[        R                  " UT" S5      5      (       d   eUS-  R                  SS9nSU;   d   e[        R                  " UTS-  5      (       d   e[        R                  " UTS-  5      (       d   eSU;   d   eSU;   d   eSU;   d   eSU;   d   eSU;   d   eUR                  S5      S:X  d   e[        R                  " UT" S 5      5      (       d   e[        R                  " UTS!-  5      (       d   e[        R                  " UTS"-  5      (       d   e[        R                  " UTS#-  5      (       d   e[        R                  " UTS$-  5      (       d   e[        R                  " UTS%-  5      (       d   eU S&-  R                  5       nUR                  S'S(5      nU S&-  R                  U5        S) Vs/ s H#  nU" U5      R                  5       R                  PM%     n	n[	        U T
U5        [        R                  " UT" S 5      5      (       d   eU" S5      R                  5       R                  U	S*   :X  d   eU" S5      R                  5       R                  U	S   :X  d   eU" S+5      R                  5       R                  U	S   :X  d   e[        R                  " UT" S5      5      (       d   e[        R                  " UT" S5      5      (       d   e[        R                  " UT" S+5      5      (       d   eU" S5      R                  5       R                  U	S+   :”  d   e[        R                  " UT" S5      5      (       d   eg s  snf ),NTÚ_buildÚdoctreesÚplot_directive©Údirs_exist_okÚignorer   Ú_imagesc                 ó   >• TSU  S3-  $ ©Núsome_plots-ú.png© )ÚnumÚimg_dirs    €r$   Ú	plot_fileÚ!test_tinypages.<locals>.plot_file5   s   ø€ Ø˜; s e¨4Ð0Ñ0Ð0r&   c                 ó0   >• TR                   S-  SU  S3-  $ )Nr*   r1   r2   )Úparent)r4   r   s    €r$   Úplot_directive_fileÚ+test_tinypages.<locals>.plot_directive_file8   s#   ø€ à×!Ñ!Ð$4Ñ4¸ÀSÀEÈÐ7NÑNÐNr&   c              3   ó4   >#   • U  H  nT" U5      v •  M     g 7f©Nr3   )Ú.0Úir6   s     €r$   Ú	<genexpr>Ú!test_tinypages.<locals>.<genexpr><   s   øé € Ð!Dº°1¡)¨A§, ,ºùs   ƒé   é   é   é   é   Ú12_00Ú12_01é   úsome_plots.htmlúutf-8©Úencodingz# Only a commentz
range4.pngzrange6_range6.pngz This is the caption for plot 15.z7Plot 17 uses the caption option,
with multi-line input.z3Plot 17 uses the alt option, with multi-line input.z This is the caption for plot 18.z&plot-directive my-class my-other-classz#This caption applies to both plots.é   é   zrange6_range10.pngzcustom-basename-6.pngzcustom-basename-4.pngzcustom-basename-4-6_00.pngzcustom-basename-4-6_01.pngzincluded_plot_21.rsts   plt.plot(range(6))s   plt.plot(range(4)))rB   rN   é   rD   r   rP   )ÚshutilÚcopytreeÚ	tinypagesÚignore_patternsr%   ÚrangeÚfilecmpÚcmpÚ	read_textÚcountÚ
read_bytesÚreplaceÚwrite_bytesÚstatÚst_mtime)Útmp_pathr   r:   Úrange_10Úrange_6Úrange_4Úhtml_contentsÚcontentsr?   Úmodification_timesr   r5   r6   s             @@@r$   Útest_tinypagesrf   *   sG  ú€ Ü
‡O‚O”I˜x°tÜ!×1Ò1°(¸JØ3CóEòFð ˜(Ñ" VÑ+€HØ˜Ñ"€GØ˜ZÑ'€Kô �h ¨XÔ6õ1õOô "E¼¸aÀ¼Ó!DÑ€H�wä�;Š;�w¡	¨!£×-Ñ-Ð-Ð-ä�;Š;�w¡	¨!£×-Ñ-Ð-Ð-ä�;Š;�x¡¨2£×/Ñ/Ð/Ð/ä�;Š;�x¡¨7Ó!3×4Ñ4Ð4Ð4Ü�;Š;�w¡	¨'Ó 2×3Ñ3Ð3Ð3ä�;Š;�w¡	¨"£×.Ñ.Ð.Ð.àÐ 1Ñ1×<Ñ<ÀgÐ<ÐN€Mà Ó.Ð.Ð.ä�;Š;�w ¨,Ñ 6×7Ñ7Ð7Ð7Ü�;Š;�w Ð*=Ñ =×>Ñ>Ð>Ð>à-°Ó>Ð>Ð>ð FÈÓVÐVÐVà@ÀMÓQÐQÐQà-°Ó>Ð>Ð>à3°}ÓDÐDÐDà×ÑÐDÓEÈÓJÐJÐJô �;Š;�w¡	¨"£×.Ñ.Ð.Ð.ä�;Š;�x Ð+?Ñ!?×@Ñ@Ð@Ð@ä�;Š;�w Ð*AÑ A×BÑBÐBÐBÜ�;Š;�w Ð*AÑ A×BÑBÐBÐBÜ�;Š;�w Ð*FÑ F×GÑGÐGÐGÜ�;Š;�w Ð*FÑ F×GÑGÐGÐGð Ð1Ñ1×=Ñ=Ó?€HØ×ÑÐ 5Ð7LÓM€HØÐ&Ñ&×3Ñ3°HÔ=ñ $0ó1Ú#/˜añ .¨aÓ0×5Ñ5Ó7×@Ô@Ù#/ð ð 1ä�h ¨XÔ6Ü�;Š;�w¡	¨"£×.Ñ.Ð.Ð.ñ ˜qÓ!×&Ñ&Ó(×1Ñ1Ð5GÈÑ5JÓJÐJÐJÙ˜qÓ!×&Ñ&Ó(×1Ñ1Ð5GÈÑ5JÓJÐJÐJÙ˜qÓ!×&Ñ&Ó(×1Ñ1Ð5GÈÑ5JÓJÐJÐJÜ�;Š;�x¡¨1£×.Ñ.Ð.Ð.Ü�;Š;�w¡	¨!£×-Ñ-Ð-Ð-Ü�;Š;�w¡	¨!£×-Ñ-Ð-Ð-ñ ˜qÓ!×&Ñ&Ó(×1Ñ1Ð4FÀqÑ4IÓIÐIÐIÜ�;Š;�w¡	¨!£×-Ñ-Ð-Ñ-ùò!1s   Ë2*Rc                 ó°  • [         R                  " [        S-  U S-  5        [         R                  " [        S-  U S-  5        U S-  nU S-  R	                  S5        U S-  S-  n[        XU5        [        [        UR                  S5      5      5      S	:X  d   eU S-  S
-  n[        XUSS/S9  [        [        UR                  S5      5      5      S:X  d   eg )Núconf.pyÚ_staticr)   ú	index.rstz#
.. plot::

    plt.plot(range(2))
r(   Úhtml1ú**/index-1.pyrB   Úhtml2ú-Dzplot_html_show_source_link=0©r   r   ©	rQ   ÚcopyfilerS   rR   Ú
write_textr%   ÚlenÚlistÚglob)r_   r   Ú	html_dir1Ú	html_dir2s       r$   Útest_plot_html_show_source_linkrx      sØ   € Ü
‡O‚O”I 	Ñ)¨8°iÑ+?Ô@Ü
‡O‚O”I 	Ñ)¨8°iÑ+?Ô@Ø˜ZÑ'€KØ�Ñ×'Ñ'ð )ô ð ˜8Ñ# gÑ-€IÜ�h¨YÔ7ÜŒt�I—N‘N ?Ó3Ó4Ó5¸Ó:Ð:Ð:ð ˜8Ñ# gÑ-€IÜ�h¨YØ"&Ð(FÐ!GòIäŒt�I—N‘N ?Ó3Ó4Ó5¸Ó:Ð:Ñ:r&   Úplot_html_show_source_linkrB   c                 ó<  • [         R                  " [        S-  U S-  5        [         R                  " [        S-  U S-  5        U S-  nU S-  R	                  S5        U S-  S-  n[        XUSS	U 3/S
9  [        [        UR                  S5      5      5      S:X  d   eg )Nrh   ri   r)   rj   z?
.. plot::
    :show-source-link: true

    plt.plot(range(2))
r(   r   rn   úplot_html_show_source_link=ro   rl   rB   rp   ©r_   ry   r   r   s       r$   Útest_show_source_link_truer}   ”   ó«   € ô ‡O‚O”I 	Ñ)¨8°iÑ+?Ô@Ü
‡O‚O”I 	Ñ)¨8°iÑ+?Ô@Ø˜ZÑ'€KØ�Ñ×'Ñ'ð )ô ð ˜(Ñ" VÑ+€HÜ�h¨XØÐ+Ð,FÐ+GÐHðCJò KäŒt�H—M‘M /Ó2Ó3Ó4¸Ó9Ð9Ñ9r&   c                 ó<  • [         R                  " [        S-  U S-  5        [         R                  " [        S-  U S-  5        U S-  nU S-  R	                  S5        U S-  S-  n[        XUSS	U 3/S
9  [        [        UR                  S5      5      5      S:X  d   eg )Nrh   ri   r)   rj   z@
.. plot::
    :show-source-link: false

    plt.plot(range(2))
r(   r   rn   r{   ro   rl   r   rp   r|   s       r$   Útest_show_source_link_falser€   §   r~   r&   c                 ój  • [         R                  " [        S-  U S-  5        [         R                  " [        S-  U S-  5        U S-  nU S-  R	                  S5        U S-  S-  n[        XU5        [        [        UR                  S5      5      5      S	:X  d   eUS
-  R                  5       nSU;   d   eg )Nrh   ri   r)   rj   zE
.. plot::
    :filename-prefix: custom-name

    plt.plot(range(2))
r(   r   z**/custom-name.pyrB   ú
index.htmlzcustom-name.py)
rQ   rq   rS   rR   rr   r%   rs   rt   ru   rX   ©r_   r   r   Úhtml_contents       r$   Ú/test_plot_html_show_source_link_custom_basenamer…   º   s¶   € ä
‡O‚O”I 	Ñ)¨8°iÑ+?Ô@Ü
‡O‚O”I 	Ñ)¨8°iÑ+?Ô@Ø˜ZÑ'€KØ�Ñ×'Ñ'ð )ô ð ˜(Ñ" VÑ+€HÜ�h¨XÔ6ô Œt�H—M‘MÐ"5Ó6Ó7Ó8¸AÓ=Ð=Ð=ð ˜|Ñ+×6Ñ6Ó8€LØ˜|Ó+Ð+Ñ+r&   c                 óP  • [         R                  " [        S-  U S-  5        [         R                  " [        S-  U S-  5        U S-  nU S-  R	                  S5        U S-  S-  n[        XU5        US-  R                  S	S
9nSU;   d   eSU;   d  SUR                  5       ;   d   eg g )Nrh   ri   r)   rj   z‘
.. plot::
    :include-source:
    :code-caption: Example plotting code

    import matplotlib.pyplot as plt
    plt.plot([1, 2, 3], [1, 4, 9])
r(   r   r‚   rK   rL   zExample plotting codez<p class="caption"Úcaption)rQ   rq   rS   rR   rr   r%   rX   Úlowerrƒ   s       r$   Útest_plot_html_code_captionr‰   Ð   s½   € ä
‡O‚O”I 	Ñ)¨8°iÑ+?Ô@Ü
‡O‚O”I 	Ñ)¨8°iÑ+?Ô@Ø˜ZÑ'€KØ�Ñ×'Ñ'ð )ô ð ˜(Ñ" VÑ+€HÜ�h¨XÔ6ð ˜|Ñ+×6Ñ6ÀÐ6ÐH€LØ" lÓ2Ð2Ð2ð   <Ó/°9À×@RÑ@RÓ@TÓ3TÐTÐTÐ3TÐ/r&   c           
      ón  ^• [         R                  " [        U S[         R                  " SSS5      S9  U S-  S-  nUS-  mU S-  n[	        XUSS	/S
9  SU4S jjnS H<  nU" U5      R                  5       (       d   eU" USS9R                  5       (       a  M<   e   TS-  R                  5       (       d   eTS-  R                  5       (       d   eTS-  R                  5       (       d   eTS-  R                  5       (       d   eTS-  R                  5       (       d   eTS-  R                  5       (       d   eTS-  R                  5       (       d   eTS-  R                  5       (       d   eSUS-  R                  SS9;   d   eSnXQS-  R                  SS9;   d   eSnXQS-  R                  SS9;   d   eg ) NTr(   r)   r*   r+   r   r.   rn   zplot_srcset=2xro   c                 ó   >• TSU  U S3-  $ r0   r3   )r4   Úsuffr5   s     €r$   r6   Ú&test_srcset_version.<locals>.plot_fileó   s   ø€ Ø˜; s e¨D¨6°Ð6Ñ6Ð6r&   )	rB   rN   rP   rD   rE   rF   rI   é   rO   z.2x)rŒ   znestedpage-index-1.pngznestedpage-index-1.2x.pngznestedpage-index-2.pngznestedpage-index-2.2x.pngznestedpage2-index-1.pngznestedpage2-index-1.2x.pngznestedpage2-index-2.pngznestedpage2-index-2.2x.pngzDsrcset="_images/some_plots-1.png, _images/some_plots-1.2x.png 2.00x"rJ   rK   rL   zVsrcset="../_images/nestedpage-index-1.png, ../_images/nestedpage-index-1.2x.png 2.00x"znestedpage/index.htmlzXsrcset="../_images/nestedpage2-index-2.png, ../_images/nestedpage2-index-2.2x.png 2.00x"znestedpage2/index.html)r	   )rQ   rR   rS   rT   r%   ÚexistsrX   )r_   r   r   r6   ÚindÚstr5   s         @r$   Útest_srcset_versionr’   è   s  ø€ Ü
‡O‚O”I˜x°tÜ!×1Ò1°(¸JØ3CóEòFð ˜(Ñ" VÑ+€HØ˜Ñ"€GØ˜ZÑ'€Kä�h¨XØ"&Ð(8Ð!9ò;÷7ó /ˆÙ˜‹~×$Ñ$×&Ñ&Ð&Ð&Ù˜ 5Ñ)×0Ñ0×2Ó2Ð2Ð2ñ /ð Ð.Ñ.×6Ñ6×8Ñ8Ð8Ð8ØÐ1Ñ1×9Ñ9×;Ñ;Ð;Ð;ØÐ.Ñ.×6Ñ6×8Ñ8Ð8Ð8ØÐ1Ñ1×9Ñ9×;Ñ;Ð;Ð;ØÐ/Ñ/×7Ñ7×9Ñ9Ð9Ð9ØÐ2Ñ2×:Ñ:×<Ñ<Ð<Ð<ØÐ/Ñ/×7Ñ7×9Ñ9Ð9Ð9ØÐ2Ñ2×:Ñ:×<Ñ<Ð<Ð<ð SØÐ,Ñ,×7Ñ7ÀÐ7ÐIóJð Kð Jð8€BàÐ4Ñ4×?Ñ?ÈÐ?ÐQÓQÐQÐQð9€BàÐ5Ñ5×@Ñ@È'Ð@ÐRÓRÐRÑRr&   r=   )Ú__doc__rV   r   Úpathlibr   rQ   r   Úmatplotlib.testingr   r   ÚimportorskipÚ__file__r9   rS   r%   rf   rx   ÚmarkÚparametrizer}   r€   r…   r‰   r’   r3   r&   r$   Ú<module>rš      s¼   ðÙ 8ã Û 	Ý Û Û 
å 9Û ð × Ò �H¨Ò 1ñ �‹N×!Ñ!Ð$4Ñ4€	ôò.R.òj;ð* ‡�×ÑÐ5¸¸1°vÓ>ñ:ó ?ð:ð$ ‡�×ÑÐ5¸¸1°vÓ>ñ:ó ?ð:ò$,ò,Uó0'Sr&   