
    ,hH                    $   U d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlmZmZmZ ddlmZ ddlmZ ddlmZ ddlmZ d	e	j0                  v Zd
 ZdddgdZdedZej:                  d        Zd Z e  e!eg d            Z"ddgddgfddgg dfdddgdgfdg ddgfdd gg fd!d"gd#gfd$g d%d&gfd'd(d)gd*gfd+g d,g fd-g d.d/d0gfd1d2d3gg d4fd5g d6d7gfd8d9gg d:fgZ#d;e$d<<   	 ejJ                  jM                  d= e#D              Z' ejP                  e'>      d?        Z)ejJ                  jM                  d@ e#D              Z* ejP                  e*>      dA        Z+dB Z,dC Z- G dD dE      Z. G dF dGe.      Z/ G dH dIe.      Z0y)Jzsdist tests    )annotationsN)FileListegg_infotranslate_pattern)Distribution)DALS)log)DistutilsTemplateError__pypy__c                B    | j                  dt        j                        S )z"Converts '/' in a string to os.sep/)replaceossep)ss    `/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/setuptools/tests/test_manifest.pymake_local_pathr      s    99S"&&!!    appz0.0)nameversionpackagesz&from setuptools import setup

setup(**z)
c               #  2  K   t         j                  t         j                  }} t        j                         t        j                         ct         _        t         _        	 d  | |ct         _        t         _        y # | |ct         _        t         _        w xY wwN)sysstdoutstderrioStringIO)
old_stdout
old_stderrs     r   quietr"   ,   s[      ZZ
J[[]BKKMCJ
8!+Z
CJZ
CJs   ABA; #B;BBc                8    t        | d      j                          y )Nwb)openclose)filenames    r   touchr(   6   s    4 r   )
README.rstMANIFEST.insetup.pyzapp.egg-info/PKG-INFOzapp.egg-info/SOURCES.txtz!app.egg-info/dependency_links.txtzapp.egg-info/top_level.txtzapp/__init__.pyfoobarfoobarfoo/bar)zfoo/bar/bazz	./foo/barr,   z*.txtzfoo.txtzbar.txtzfoo/foo.txtz	dir/*.txt)zdir/foo.txtzdir/bar.txtzdir/.txtznotdir/foo.txtz*/*.pyzbin/start.pyzdocs/page-?.txtzdocs/page-9.txtzdocs/page-10.txtz
foo/**/bar)zfoo/bing/barzfoo/bing/bang/barr/   zfoo/abarzfoo/**zfoo/bar/bing.pyzfoo/xz/foo/xz**)xzabc/xyzz@nythingzpre[one]post)preopostprenpostpreepostprepost
preonepostzhello[!one]worldhelloxworldhelloyworld)hellooworld
helloworldhellooneworldz
[]one].txt)zo.txtz].txtze.txtzone].txtzfoo[!]one]barfooybar)zfoo]barfooobarfooebarz&list[tuple[str, list[str], list[str]]]translate_specsc              #  b   K   | ]'  \  }}}t        t        j                  |      |       ) y wr   zip	itertoolsrepeat.0patternmatches
mismatchess       r   	<genexpr>rI      s0      -$* 	!7+-   -/)paramsc                6    t        t        | j                        S r   mapr   paramrequests    r   pattern_matchrR          ..r   c              #  b   K   | ]'  \  }}}t        t        j                  |      |       ) y wr   r@   rD   s       r   rI   rI      s0      0$* 	!:.0rJ   c                6    t        t        | j                        S r   rM   rP   s    r   pattern_mismatchrV      rS   r   c                F    | \  }}t        |      j                  |      sJ y r   r   match)rR   rF   targets      r   test_translated_pattern_matchr[      s$    #OGVW%++F333r   c                F    | \  }}t        |      j                  |      rJ y r   rX   )rV   rF   rZ   s      r    test_translated_pattern_mismatchr]      s$    &OGV )//777r   c                      e Zd Zd Zd Zy)TempDirTestCasec                    t        j                         | _        t        j                         | _        t        j                  | j                         y r   )tempfilemkdtemptemp_dirr   getcwdold_cwdchdirselfmethods     r   setup_methodzTempDirTestCase.setup_method   s/     ((*yy{
r   c                    t        j                  | j                         t        j                  | j
                         y r   )r   rf   re   shutilrmtreerc   rg   s     r   teardown_methodzTempDirTestCase.teardown_method   s"    
dmm$r   N)__name__
__module____qualname__rj   rn    r   r   r_   r_      s     
%r   r_   c                  f     e Zd Z fdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Z xZS )TestManifestTestc                   t         |   |       t        t        j                  j                  | j                  d      dd      }|j                  t               |j                          	 dD ]5  }t        t        j                  j                  | j                  |             7 t        j                  j                  | j                  d      }t        j                  |       dD ]+  }t        t        j                  j                  ||             - t        j                  j                  |d      }t        j                  |       d	D ]+  }t        t        j                  j                  ||             - y )
Nr+   wutf-8encoding)r)   .hidden.rsttesting.rstLICENSEr   )z__init__.pya.txtb.txtzc.rststatic)zapp.jsz
app.js.mapzapp.csszapp.css.map)superrj   r%   r   pathjoinrc   writeSETUP_PYr&   r(   mkdir)rh   ri   ffnametest_pkgr   	__class__s         r   rj   zTestManifestTest.setup_method   s   V$dmmZ8#P				$ M 	6E"'',,t}}e45	6 77<<u5
? 	1E"'',,x/0	1 h1
G 	/E"'',,vu-.	/r   c                    t         j                  j                  | j                  d      }t	        |dd      5 }|j                  t        |             ddd       y# 1 sw Y   yxY w)zWrite a MANIFEST.in.r*   rv   rw   rx   N)r   r   r   rc   r%   r   r   )rh   contentsmanifestr   s       r   make_manifestzTestManifestTest.make_manifest   sM    77<<}=(C'2 	$aGGDN#	$ 	$ 	$s   AA&c                    t        t              }d|_        t        |      }|j	                          |j                          t        |j                  j                        S )z7Run egg_info and get all the files to include, as a setr+   )	r   SETUP_ATTRSscript_namer   ensure_finalizedrunsetfilelistfiles)rh   distcmds      r   	get_fileszTestManifestTest.get_files   sG    K(%tn	3<<%%&&r   c                P    t         t        dg      z
  | j                         k(  sJ y)z=Check a missing MANIFEST.in includes only the standard files.r*   N)default_filesr   r   rh   s    r   test_no_manifestz!TestManifestTest.test_no_manifest   s#    ]O 449IIIIr   c                X    | j                  d       t        | j                         k(  sJ y)z<Check an empty MANIFEST.in includes only the standard files. N)r   r   r   r   s    r   test_empty_filesz!TestManifestTest.test_empty_files   s%    2 0000r   c                x    | j                  d       t        t        ddg      z  }|| j                         k(  sJ y)z,Include extra rst files in the project root.zinclude *.rstr{   rz   N)r   r   r   r   )rh   r   s     r   test_includezTestManifestTest.test_include   s9    ?+]M$B CC((((r   c                    t         }| j                  d       t        t         |d      g      z  }|| j	                         k(  sJ y)z0Include everything in app/ except the text fileszE
            include app/*
            exclude app/*.txt
            	app/c.rstNr   r   r   r   r   rh   mlr   s      r   test_excludezTestManifestTest.test_exclude   sG    	
 R_$5 66((((r   c                    t         }| j                  d       t        t         |d       |d       |d       |d       |d       |d      g      z  }|| j	                         k(  sJ y)	zInclude with multiple patterns.zinclude app/*.txt app/static/*	app/a.txt	app/b.txtapp/static/app.jsapp/static/app.js.mapapp/static/app.cssapp/static/app.css.mapNr   r   s      r   test_include_multiplez&TestManifestTest.test_include_multiple   su    ;<{O{O"#&'#$'(%
 !  ((((r   c           	         t         }| j                  d       t        t         |d       |d       |d       |d      g      z  }|| j	                         k(  sJ y)(Include the whole app/static/ directory.zgraft app/staticr   r   r   r   Nr   r   s      r   
test_graftzTestManifestTest.test_graft  sg    -."#&'#$'(	%
 !  ((((r   c           	         t         }| j                  d       t        t         |d       |d       |d       |d      g      z  }|| j	                         k(  sJ y)r   zgraft */staticr   r   r   r   Nr   r   s      r   test_graft_glob_syntaxz'TestManifestTest.test_graft_glob_syntax  sg    +,"#&'#$'(	%
 !  ((((r   c                    t         }| j                  d       t        t         |d       |d      g      z  }|| j	                         k(  sJ y)z'Exclude all *.map files in the project.zK
            graft app/static
            global-exclude *.map
            r   r   Nr   r   s      r   test_graft_global_excludez*TestManifestTest.test_graft_global_exclude%  sQ    	
 R(;%<bAU>V$W XX((((r   c           
         t         }| j                  d       t        t        dd |d       |d       |d      g      z  }|| j	                         k(  sJ y)z;Include all *.rst, *.js, and *.css files in the whole tree.z9
            global-include *.rst *.js *.css
            rz   r{   r   r   r   Nr   r   s      r   test_global_includez$TestManifestTest.test_global_include1  sh    	

 {O"##$%
 !  ((((r   c                    t         }| j                  d       t        t         |d       |d       |d      g      z  }|| j	                         k(  sJ y)z@Include all files in app/, except for the whole app/static/ dir.z@
            graft app
            prune app/static
            r   r   r   Nr   r   s      r   test_graft_prunez!TestManifestTest.test_graft_pruneB  sS    	
 R_bor+$W XX((((r   )ro   rp   rq   rj   r   r   r   r   r   r   r   r   r   r   r   r   __classcell__)r   s   @r   rt   rt      sF    %/N$	'J1
)
))
)
)
))"
)r   rt   c                      e Zd ZdZ ej
                   ej                  d      dk(        d        Zd Z	d Z
d Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)TestFileListTestz
    A copy of the relevant bits of distutils/tests/test_filelist.py,
    to ensure setuptools' version of FileList keeps parity with distutils.
    SETUPTOOLS_USE_DISTUTILSstdlib)autousec                R    fd}|j                  t        j                  d|       y)z Account for stdlib compatibilityc           	         t        j                         }t        j                  d|dd|||      }j                  j                  |       y )N	distutilsr   r   )r   exc_infologging	LogRecordrecordsappend)_loggerlevelmsgargsexcreccaplogs         r   _logz2TestFileListTest._compat_record_logs.<locals>._logY  s<    ,,.C##KAsD#NCNN!!#&r   r   N)setattrr	   Log)rh   monkeypatchr   r   s     ` r   _compat_record_logsz$TestFileListTest._compat_record_logsU  s     	'
 	CGGVT2r   c                ^    |j                   D cg c]  }|j                  |v s| c}S c c}w r   )r   levelno)rh   r   levelsrs       r   get_recordszTestFileListTest.get_records`  s%    !>>AaQYY&-@AAAs   **c                n    | j                  |t        j                        g k(  sJ |j                          y r   )r   r	   WARNclearrh   r   s     r   assertNoWarningsz!TestFileListTest.assertNoWarningsc  s'    1R77r   c                    t         r"|j                  st        j                  d       y t	        | j                  |t        j                              dkD  sJ |j                          y )Nz'caplog checks may not work well in PyPyr   )	IS_PYPYr   pytestxfaillenr   r	   r   r   r   s     r   assertWarningszTestFileListTest.assertWarningsg  sB    6>>LLBCt''9:Q>>LLNr   c                    |D ]p  }t         j                  j                  | j                  |      }t         j                  j	                  |      \  }}t        j
                  |d       t        |       r y )NT)exist_ok)r   r   r   rc   splitmakedirsr(   )rh   r   filedirname	_basenames        r   
make_fileszTestFileListTest.make_filesn  sU     	D77<<t4D!#t!4GYKK$/$K		r   c                   t               }t        }| j                  ddddd |d       |d       |d       |d	       |d
       |d       |d       |d       |d       |d      g       t        d      }|j	                  d      D ]  }|s|j                  |        ddd |d       |d       |d       |d       |d       |d      g	}|j                          |j                  |k(  sJ y )Nzfoo.tmpokxozfour.txtzbuildout.cfgz.hg/last-message.txtzglobal/one.txtzglobal/two.txtzglobal/files.xzglobal/here.tmpzf/o/f.oozdir/graft-onezdir/dir2/graft2zdir3/okzdir3/sub/ok.txta6          include ok
        include xo
        exclude xo
        include foo.tmp
        include buildout.cfg
        global-include *.x
        global-include *.txt
        global-exclude *.tmp
        recursive-include f *.oo
        recursive-exclude global *.x
        graft dir
        prune dir3
        
)r   r   r   r   r   process_template_linesortr   )rh   	file_listr   MANIFEST_INlinewanteds         r   test_process_template_linez+TestFileListTest.test_process_template_lineu  s+   J	 	 %&    !zN !yM !#
 	( 
"  %%d+ 	2D++D1	2 %& !zN  

 	&(((r   c                   t               }|j                  d      rJ t               }ddg|_        |j                  d      sJ t               }ddg|_        |j                  d       |j                          |j                  dgk(  sJ y )N*.pya.pyzb.pyr}   )r   exclude_patternr   r   rh   r   s     r   test_exclude_patternz%TestFileListTest.test_exclude_pattern  s    J	,,V44 J	!6*	((00 J	!7+	!!&)7)+++r   c                b   t               }| j                  g        |j                  d      rJ t               }| j                  ddg       |j                  d      sJ t               }| j                  ddg       |j                  d       |j                          |j                  ddgk(  sJ y )Nr   r   r~   *)r   r   include_patternr   r   r   s     r   test_include_patternz%TestFileListTest.test_include_pattern  s    J	,,V44 J	)*((00 J	)*!!#&67"3333r   c                    t               }dD ]5  }t        j                  t              5  |j	                  |       d d d        7 y # 1 sw Y   BxY w)N)	includeexcludezglobal-includezglobal-excludezrecursive-includezrecursive-excludegraftpruneblarg)r   r   raisesr
   r   )rh   r   actions      r   "test_process_template_line_invalidz3TestFileListTest.test_process_template_line_invalid  sQ    J	

 	8F 56 8//78 8	88 8s   AA	c                   |j                  t        j                         t        }t	               }| j                  dd |d      g       |j                  d       |j                          |j                  dgk(  sJ | j                  |       |j                  d       |j                          |j                  dgk(  sJ | j                  |       y )Nr   r~   d/c.pyzinclude *.pyzinclude *.rb	set_levelr   DEBUGr   r   r   r   r   r   r   r   rh   r   r   r   s       r   r   zTestFileListTest.test_include  s    'J	"X,78''76(**f%''76(**F#r   c                   |j                  t        j                         t        }t	               }dd |d      g|_        |j                  d       |j                          |j
                  d |d      gk(  sJ | j                  |       |j                  d       |j                          |j
                  d |d      gk(  sJ | j                  |       y )Nr   r~   r  zexclude *.pyzexclude *.rb
r  r   r  r   r   r   r   r   r   r   r  s       r   r   zTestFileListTest.test_exclude  s    'J	!7BxL9	''77BxL"999f%''77BxL"999F#r   c                   |j                  t        j                         t        }t	               }| j                  dd |d      g       |j                  d       |j                          |j                  d |d      gk(  sJ | j                  |       |j                  d       |j                          |j                  d |d      gk(  sJ | j                  |       y )Nr   r~   r  zglobal-include *.pyzglobal-include *.rbr  r  s       r   r   z$TestFileListTest.test_global_include
  s    'J	"X,78''(=>62h<"888f%''(=>62h<"888F#r   c                   |j                  t        j                         t        }t	               }dd |d      g|_        |j                  d       |j                          |j
                  dgk(  sJ | j                  |       |j                  d       |j                          |j
                  dgk(  sJ | j                  |       y )Nr   r~   r  zglobal-exclude *.pyzglobal-exclude *.rbr  r  s       r   test_global_excludez$TestFileListTest.test_global_exclude  s    'J	!7BxL9	''(=>7)++f%''(=>7)++F#r   c                   |j                  t        j                         t        }t	               }| j                  d |d       |d       |d      g       |j                  d       |j                          |j                   |d       |d      gk(  sJ | j                  |       |j                  d       |j                          |j                   |d       |d      gk(  sJ | j                  |       y )Nr   d/b.pyd/c.txtd/d/e.pyzrecursive-include d *.pyzrecursive-include e *.pyr  r  s       r   test_recursive_includez'TestFileListTest.test_recursive_include,  s    'J	Hr)}bnMN''(BC2h<J"@@@f%''(BC2h<J"@@@F#r   c                   |j                  t        j                         t        }t	               }d |d       |d       |d      g|_        |j                  d       |j                          |j
                  d |d      gk(  sJ | j                  |       |j                  d       |j                          |j
                  d |d      gk(  sJ | j                  |       y )Nr   r  r  r  zrecursive-exclude d *.pyzrecursive-exclude e *.pyr  r  s       r   test_recursive_excludez'TestFileListTest.test_recursive_exclude=  s    'J	!2h<I:O	''(BC62i="999f%''(BC62i="999F#r   c                   |j                  t        j                         t        }t	               }| j                  d |d       |d       |d      g       |j                  d       |j                          |j                   |d       |d      gk(  sJ | j                  |       |j                  d       |j                          |j                   |d       |d      gk(  sJ | j                  |       y )Nr   r  r  f/f.pyzgraft dzgraft er  r  s       r   r   zTestFileListTest.test_graftN  s    'J	Hr*~r(|LM''	22h<J"@@@f%''	22h<J"@@@F#r   c                   |j                  t        j                         t        }t	               }d |d       |d       |d      g|_        |j                  d       |j                          |j
                  d |d      gk(  sJ | j                  |       |j                  d       |j                          |j
                  d |d      gk(  sJ | j                  |       y )Nr   r  r  r  zprune dzprune er  r  s       r   
test_prunezTestFileListTest.test_prune_  s    'J	!2h<JHN	''	262h<"888f%''	262h<"888F#r   N)ro   rp   rq   __doc__r   fixturer   getenvr   r   r   r   r   r   r   r  r
  r   r   r   r  r  r  r   r   rr   r   r   r   r   O  s    
 V^^IBII&@AXMN3 O3B=)~,"4$8"$"$"$"$"$"$"$"$r   r   )1r!  
__future__r   
contextlibr   rB   r   r   rl   r   ra   r   setuptools.command.egg_infor   r   r   setuptools.distr   setuptools.tests.textwrapr   r   r	   distutils.errorsr
   builtin_module_namesr   r   r   r   contextmanagerr"   r(   	frozensetrN   r   r>   __annotations__chainfrom_iterablematch_paramsr"  rR   mismatch_paramsrV   r[   r]   r_   rt   r   rr   r   r   <module>r2     se    "  	   	  
   M M ( *  3
00
0" 	 
  8 8! 		
$ UGeX&'@Ay)$}o6<?O>PQ$*+.@-AB 	8	 		G$	
 	$
 	,	L! 		&6 	#	 		)Q-;7 -\
 ,, -(7-  |$/ %/ //// 0(70  '/ (/4
8
% %a) a)H_$ _$r   