
    vKg                        S 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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rSSKrSSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKrSSKJs  Jr  SSKJrJrJ r   SSK!J"r"  SS	KJ#r#  SS
K$Jr  SSK%J&r&  SSK'J(r(  SSK)J*r*J+r+  SSK,J-r-  SSK.J/r/  SSK0r1\Rd                  " SS9S 5       r3 " S S5      r4\/" S5      r5 " S S5      r6\Rn                  Rq                  S5       " S S5      5       r9\Rd                  S 5       r:\Rn                  Rw                  S5      \Rn                  Rw                  S5       " S S 5      5       5       r<\Rd                  S! 5       r=\Rn                  Rw                  S"5       " S# S$5      5       r>\Rd                  S% 5       r? " S& S'5      r@ " S( S)5      rAS* rBS+ rCS, rDS- rES.S/\BSSS04S1 jrF\Rn                  R                  \
R                  R                  S25      =(       a    \R                  " \
R                  5      S3S49 " S5 S65      5       rL " S7 S85      rM " S9 S:5      rN " S; S<\5      rOS= rP\Rn                  R                  \
R                  S>:H  S?S49S@ 5       rRg)AzEasy install Tests    N)Path)
NamedTuple)mockpath)Distributionnormalize_pathworking_set)sandbox)PthDistributions)r   	run_setup)fail_on_ascii)
MockServerpath_to_url   )contexts)DALST)autousec                 (    U R                  SS5        g)z
Important: Disable the default index for pip to avoid
querying packages in the index and potentially resolving
and installing packages there.
PIP_NO_INDEXtrueN)setenv)monkeypatchs    b/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/setuptools/tests/test_easy_install.pypip_disable_indexr   )   s     ~v.    c                        \ rS rSrS rS rSrg)FakeDist3   c                     US:w  a  0 $ SS0$ )Nconsole_scriptsnameep )selfgroups     r   get_entry_mapFakeDist.get_entry_map4   s    %%I~r   c                     g)Nspecr%   r&   s    r   as_requirementFakeDist.as_requirement9   s    r   r%   N)__name__
__module____qualname____firstlineno__r(   r-   __static_attributes__r%   r   r   r   r   3   s    
r   r   z3
    from setuptools import setup

    setup()
    c                   :   \ rS rSrS rS rS rS rS r\	R                  S 5       r\S 5       r\	R                  S	 5       r\S
 5       r\	R                  S 5       r\	R"                  R%                  \R(                  R+                  S5      (       + SS9S 5       rSrg)TestEasyInstallTestF   c                    [         R                  R                  5       R                  5       R	                  5       n[        5       n[        [         R                  R                  U5      5      n[        R                  " US5      u  pEUR                  U5      (       d   eSU;   d   eSU;   d   eSU;   d   e[        R                  " SU[        R                  S9(       d   eg )N   z'spec'z'console_scripts'z'name'z^# EASY-INSTALL-ENTRY-SCRIPT)flags)eiCommandSpecbestfrom_environment	as_headerr   nextScriptWriterget_args	itertoolsislice
startswithresearch	MULTILINE)r&   headerdistargs_namescripts         r   test_get_script_args(TestEasyInstallTest.test_get_script_argsG   s    $$&779CCEzBOO,,T23!((q1  ((((6!!!"f,,,6!!!yy7r||TTTr   c                    [        5       n[        R                  " U5      nS Ul        SUl        SS/Ul        [        R                  R                  [        R                  " 5       S5      Ul        S/Ul        UR                  5         UR                  R                  0 :X  d   e[        R                  " U5      nS Ul        SS/Ul        [        R                  R                  [        R                  " 5       S5      Ul        S/Ul        UR                  5         [!        UR                  R                  R#                  5       5      nUSS/:X  d   eg )Nc                      gNTr%   r%   r   r   <lambda>8TestEasyInstallTest.test_no_find_links.<locals>.<lambda>W       4r   Tlink1link2okc                      grQ   r%   r%   r   r   rR   rS   a   rT   r   )r   r:   easy_installcheck_pth_processingno_find_links
find_linksosr   jointempfilemkdtempinstall_dirrJ   ensure_finalizedpackage_indexscanned_urlssortedkeys)r&   rI   cmdrf   s       r   test_no_find_links&TestEasyInstallTest.test_no_find_linksR   s    ~ood##/  !7+'',,x'7'7'94@6  --333 ood##/ !7+'',,x'7'7'94@6c''4499;<))))r   c                 (   [        5       n[        R                  " U5      n[        R                  " 5       Ul        [        R                  " [        R                  R                  5         UR                  5         SSS5        g! , (       d  f       g= f)zC
Test that `cant_write_to_target` is rendered as a DistutilsError.
N)r   r:   rY   r]   getcwdra   pytestraises	distutilserrorsDistutilsErrorcant_write_to_target)r&   rI   rg   s      r   test_write_exception(TestEasyInstallTest.test_write_exceptioni   sV     ~ood#))+]]9++::;$$& <;;s   )B
Bc                    ^ [        S5      mU4S jnUR                  [        SUSS9  T[        R                  " 5       ;   d   eg)zP
get_site_dirs should always return site dirs reported by
site.getsitepackages.
z/setuptools/test/site-packagesc                  
   > T /$ Nr%   r   s   r   mock_gsp8TestEasyInstallTest.test_all_site_dirs.<locals>.mock_gspz   s
    6Mr   getsitepackagesFraisingN)r	   setattrsiter:   get_site_dirs)r&   r   rw   r   s      @r   test_all_site_dirs&TestEasyInstallTest.test_all_site_dirss   sF    
 >?	 	D"3XuMr''))))r   c                 f    UR                  [        SSS9  [        R                  " 5       (       d   eg )Nry   Frz   )delattrr}   r:   r~   )r&   r   s     r   0test_all_site_dirs_works_without_getsitepackagesDTestEasyInstallTest.test_all_site_dirs_works_without_getsitepackages   s-    D"3UC!!!!r   c                     S[        S5      4SS/nSnX-  n[        R                  " [        U5      S5      nU H  u  pgUR	                  Xg5        M     UR                  5         [        U5      $ )Nsetup.pya5  
                    import setuptools
                    setuptools.setup(
                        name="setuptools-test-unicode",
                        version="1.0",
                        packages=["mypkg"],
                        include_package_data=True,
                    )
                    zmypkg/__init__.py )u   mypkg/☃.txtr   zsetuptools-test-unicode-1.0.zipw)r   zipfileZipFilestrwritestrcloser&   tmpdirfiles
sdist_namesdist	sdist_zipfilenamecontents           r   sdist_unicode!TestEasyInstallTest.sdist_unicode   s~     
'
0 7
# OOCJ4	!&Hx1 "'5zr   c                    [        SS/05      nUS-  R                  5       n[        R                  " U[	        U5      S/S9nUR                  [        R                  S[	        U5      5        UR                  5         UR                  U5        g)zY
The install command should execute correctly even if
the package has unicode filenames.
script_argsrY   targetxra   rJ   
PYTHONPATHN	r   
ensure_dirr:   rY   r   setitemr]   environrb   )r&   r   r   r   rI   r   rg   s          r   test_unicode_filename_in_sdist2TestEasyInstallTest.test_unicode_filename_in_sdist   s|     ]^,<=>8#//1ooF

 	BJJc&kB'r   c                    S[        S5      4SS[        S5      4/nSnX-  n[        R                  " [        U5      S5      nU H%  u  pgUR	                  XgR                  S5      5        M'     UR                  5         [        U5      $ )	Nr   ar  
                    import setuptools
                    setuptools.setup(
                        name="setuptools-test-unicode",
                        version="1.0",
                        packages=["mypkg"],
                        include_package_data=True,
                        scripts=['mypkg/unicode_in_script'],
                    )
                    r   zmypkg/unicode_in_scriptu   
                    #!/bin/sh
                    # á

                    non_python_fn() {
                    }
                z&setuptools-test-unicode-script-1.0.zipr   utf-8)r   r   r   r   r   encoder   r   s           r   sdist_unicode_in_script+TestEasyInstallTest.sdist_unicode_in_script   s     	 &)#
< >
# OOCJ4	!&Hx)@A "'5zr   c                    [        SS/05      nUS-  R                  5       n[        R                  " U[	        U5      S/S9nUR                  [        R                  S[	        U5      5        UR                  5         UR                  U5        g)zZ
The install command should execute correctly even if
the package has unicode in scripts.
r   rY   r   r   r   r   Nr   )r&   r   r   r   rI   r   rg   s          r   test_unicode_content_in_sdist1TestEasyInstallTest.test_unicode_content_in_sdist   sv     ]^,<=>8#//1oodF3%HBJJc&kB01r   c                 n    S[        S5      4S[        S5      4/nSn[        X-  5      n[        XB5        U$ )Nr   a  
                    import setuptools
                    setuptools.setup(
                        name="setuptools-test-script",
                        version="1.0",
                        scripts=["mypkg_script"],
                    )
                    mypkg_scriptzg
                     #/usr/bin/python
                     print('mypkg_script')
                     zsetuptools-test-script-1.0.zip)r   r   
make_sdist)r&   r   r   r   r   s        r   sdist_script TestEasyInstallTest.sdist_script   sX     	 
0 6
F'(5 r   linuxzTest can only be run on Linuxreasonc                 P   [        SS/05      nUS-  R                  5       n[        R                  " U[	        U5      S/S9nUR                  [        R                  S[	        U5      5        UR                  5         UR                  U5        US-  R                  5       (       d   eg)	z
Check scripts are installed.
r   rY   r   r   r   r   r   N)
r   r   r:   rY   r   r   r]   r   rb   exists)r&   r   r   r   rI   r   rg   s          r   test_script_install'TestEasyInstallTest.test_script_install  s     ]^,<=>8#//1ooF

 	BJJc&kB&'//1111r   r%   N)r/   r0   r1   r2   rM   rh   rr   r   r   rl   fixturer   r   r   r   r   r   markskipifsysplatformrD   r   r3   r%   r   r   r5   r5   F   s    	U*.'*" ^^! !F ( (  ^^' 'R 2 2 ^^ < [[LL##G,,5T  22r   r5   zignore:Unbuilt eggc                   &    \ rS rSrS rS rS rSrg)TestPTHFileWriteri%  c                     [        S[        R                  " 5       /5      nUR                  (       a   eUR	                  [        [        R                  " 5       5      5        UR                  (       d   eg)zRa pth file manager should set dirty
if a distribution is in site but also the cwd
does-not_existN)r   r]   rk   dirtyaddPRDistribution)r&   pths     r   !test_add_from_cwd_site_sets_dirty3TestPTHFileWriter.test_add_from_cwd_site_sets_dirty'  sH     /"))+?99}ryy{+,yyyr   c                     Sn[         R                  " U5      n[        SU/5      nUR                  (       a   eUR	                  [        U5      5        UR                  (       a   eg )Nz%/test/location/does-not-have-to-existr   )pkg_resourcesr	   r   r   r   r   )r&   locationr   s      r   test_add_from_site_is_ignored/TestPTHFileWriter.test_add_from_site_is_ignored0  sY    : //9
 99}x()99}9r   c                    UR                  S5      nUR                  5         [        UR                  S5      5      n[        U5      n[        U5      nUR                  UR                  s=:X  a  / :X  d   S5       e   S5       eUR                  S5      nUR                  5         [        U5      nUR                  R                  U5        UR                  5         UR                  (       d   S5       eXuR                  ;  d   S5       eUR                  5         XuR                  ;   d   S5       eUR                  S   U:X  d   S	5       e[        U5      R                  UR                  :X  d   S
5       eg)z
If the pth file is modified under the hood, then PthDistribution
will refresh its content before saving, merging contents when
necessary.

pth_subdirz	file1.pthz6unless there would be some default added at some point
src_subdirzEthe new_src_path added must still be present/valid in pth1 after savez:right before we save the entry should still not be presentzJthe new_src_path entry should have been added by pth2 with its save() callzVand it should match exactly on the last entry actually given we append to it in save()zXand we should have the exact same list at the end with a fresh PthDistributions instanceN)r^   mkdirr   r   pathsappendsave)r&   r   r   pth_pathpth1pth2new_src_pathnew_src_path_strs           r   *test_many_pth_distributions_merge_together<TestPTHFileWriter.test_many_pth_distributions_merge_together>  sc    [[.
z{34))zzTZZ-2- 	
D	
- 	
D	
-
 {{<0|,

*+		zz 	
S	
z  zz1 	
H	
1 			::- 	
X	
- zz"~- 	
.	
-
  )//4::= 	
5	
=r   r%   N)r/   r0   r1   r2   r   r   r   r3   r%   r   r   r   r   %  s    )
r   r   c              #      #    U S-  R                  SSS9 nUR                  [        5        S S S 5        U R                  5          U v   S S S 5        g ! , (       d  f       N,= f! , (       d  f       g = f7f)Nr   r   r   encoding)openwriteSETUP_PYas_cwd)r   fs     r   setup_contextr   j  sS     
:
	#	#C'	#	:a	 
;	 
 
;	:	s3   A4AA4A#		A4
A A4#
A1-A4user_overrider   c                      \ rS rSr\R
                  " S\R                  " 5       5      r\R
                  " S\R                  5      \R
                  " SS5      \S 5       5       5       r
\R
                  " SS5      \S 5       5       r\S	 5       rS
 r\R                   S 5       r\R                   S 5       rS r\R*                  S 5       rS rSrg)TestUserInstallTestir  z;setuptools.command.easy_install.easy_install.check_site_dirz(setuptools.command.easy_install.__file__site.ENABLE_USER_SITETc                 $    U R                  5         g rv   assert_not_user_siter,   s    r   /test_user_install_not_implied_user_site_enabledCTestUserInstallTest.test_user_install_not_implied_user_site_enabled~  s     	!!#r   Fc                 $    U R                  5         g rv   r   r,   s    r   0test_user_install_not_implied_user_site_disabledDTestUserInstallTest.test_user_install_not_implied_user_site_disabled  s     	!!#r   c                      [        5       n SU l        [        R                  " U 5      nS/Ul        UR                  5         UR                  (       a   S5       eg )Nr   pyzuser should not be implied)r   script_namer:   rY   rJ   rb   user)rI   rg   s     r   r   (TestUserInstallTest.assert_not_user_site  sJ     ~%ood#688999|8r   c                     [         R                  " S5        [        R                  " S5      n[        R                  " [        R
                  [        R                  S9  UR                  S5        g )Nmultiprocessingtest_easy_install)levelstreamzthis should not break)	rl   importorskiplogging	getLoggerbasicConfigINFOr   stderrinfo)r&   logs     r   test_multiproc_atexit)TestUserInstallTest.test_multiproc_atexit  sG    -. 34',,szzB()r   c                     US-  nUR                  S5       nUR                  S5        S S S 5        [        U5      $ ! , (       d  f       N= f)Nzfoo-1.0.egg-infor   z
Name: foo
)r   r   r   )r&   r   egg_filer   s       r   foo_packageTestUserInstallTest.foo_package  s?    ..]]31GGM"  6{  s	   <
A
c              #     #    [        U5      n[        R                  " S[        R                  U/-   5         [
        R                  R                  R                  [        R                  5      n[        R                  R                  [
        R                  US9   Uv   S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f7f)Nzsys.pathr   )
r   r   patchr   r   r]   pathsepr^   dictr   )r&   r   r   python_paths       r   install_target"TestUserInstallTest.install_target  s}     VZZ
CHHx$78''//..sxx8KD E 98DD 98s5   5CA$CB1 C(	C1
B?	;C
CCc                    [        5       nSUl        [        R                  " U5      nX$l        S/Ul        UR                  5         UR                  R                  U/5        UR                  S5      n[        R                  R                  [        R                  R                  UR                  5      5      n[        R                  R                  [        R                  R                  U5      5      nXg:X  d   eg)zL
The local index must be used when easy_install locates installed
packages.
r   fooN)r   r   r:   rY   ra   rJ   rb   local_indexscanr]   r   normcaserealpathr   )r&   r  r  rI   rg   resactualexpecteds           r   test_local_index$TestUserInstallTest.test_local_index  s    
 ~%ood#(7k]+u%!!"''"2"23<<"@A77##BGG$4$4[$AB!!!r   c              /      #    U R                   " U0 UD6   SSKJs  Jn  [        R
                  Ul        Sv   SSS5        g! , (       d  f       g= f7f)z_
Wrap sandbox.setup_context to patch easy_install in that context to
appear as user-installed.
r   N)orig_contextsetuptools.command.easy_installcommandrY   r}   	USER_SITE__file__)r&   rJ   kwargsr:   s       r   user_install_setup_context.TestUserInstallTest.user_install_setup_context  s9      //88..BK	 0//s   A#A	A
AAc                 n    [         R                  U l        [        R                  " SU R
                  5      $ )Nz setuptools.sandbox.setup_context)r   r   r  r   r  r#  r,   s    r   patched_setup_context)TestUserInstallTest.patched_setup_context  s-    #11zz.++
 	
r   )r  N)r/   r0   r1   r2   r   r  Mockprev_sp_writer}   r   r   r   staticmethodr   r  rl   r   r  r  r  
contextlibcontextmanagerr#  r&  r3   r%   r   r   r   r   r  s     JJE		M 
ZZ:DNNK	ZZ'.$  / L$ 
ZZ'/$  0$ : :* ^^  ^^ "" 	 	
r   r   c               #   $  #    [         R                  SS5      n [        R                  " [        R
                  S9   [        SSSS9 nUR                  U 5        S S S 5        S v   S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f7f)Nzfrom setuptools import setupz from distutils.core import setup)cdr   r   r   r   )r   replacer   tempdirr]   chdirr   r   )distutils_setup_pyr   s     r   distutils_packager3    sj     !))&* 
		RXX	&*cG4GG&' 5 
'	&44 
'	&s4   9BA?A.A?%	B.
A<	8A??
B	Br3  c                       \ rS rSrS rSrg)TestDistutilsPackagei  c                     [        SS/5        g )Nr   	bdist_eggr   r,   s    r   )test_bdist_egg_available_on_distutils_pkg>TestDistutilsPackage.test_bdist_egg_available_on_distutils_pkg  s    *{m,r   r%   N)r/   r0   r1   r2   r8  r3   r%   r   r   r5  r5    s    -r   r5  c                      [        5       n U R                  S:X  a  [        R                  " S5        U R	                  5         U $ )Nr   zcould not find a valid port)r   server_portrl   skipstart)p_indexs    r   
mock_indexr?    s6     lGa 	12MMONr   c                        \ rS rSrS rS rSrg)TestInstallRequiresi  c                    US-  nUR                  SS9  US-  nUR                  SS9  U R                  U5        [        R                  SSSS[	        U5      S[	        U5      S	[	        U5      S
[	        U5      S[	        U5      S[	        U5      S[	        U5      /n0 [
        R                  ESUR                  0En[        R                  " U[	        U5      U[        R                  [        R                  SSS9nUR                  S:w  d   e SUR                   Vs1 sH  oR                  iM     sn;   d   e[        S UR                   R#                  5        5       5      (       d   egs  snf ! [$         aE    SUR                   ;   a3  [&        R(                  " [        R*                   SUR                    35        e f = f)zf
When ``python setup.py install`` is called directly, it will use easy_install
to fetch dependencies.
projectT)exist_okinstall-c __import__("setuptools").setup()z--install-basez--install-libz--install-headersz--install-scriptsz--install-dataz--install-purelibz--install-platlib__EASYINSTALL_INDEXr   )cwdenvstdoutr   textr   r   /does-not-exist/c              3   D   #    U H  nS U;   d  M  SU;   d  M  Uv   M     g7f)z"not find suitable distribution forzdoes-not-existNr%   ).0lines     r   	<genexpr>OTestInstallRequires.test_setup_install_includes_dependencies.<locals>.<genexpr>  s0      2D74?  %, 2s   	  	 zfailed to get random numbersz failure - N)r   create_projectr   
executabler   r]   r   url
subprocessrunPIPESTDOUT
returncoderequestsr   r?   rK  
splitlines	Exceptionrl   xfailr   )	r&   tmp_pathr?  project_rootinstall_rootrg   rJ  cprs	            r   (test_setup_install_includes_dependencies<TestInstallRequires.test_setup_install_includes_dependencies  s     )+D))+D)L)NN.%
( DC2JNNC^^L!??$$
 }}!!!	%*:M:M)N:MQ&&:M)NNNN II002     *O  	-:~[DE	s   E/ E*09E/ *E/ /AF>c                 f    SnUS-  R                  [        U5      SS9  US-  R                  5         g )Nz
        [metadata]
        name = project
        version = 42

        [options]
        install_requires = does-not-exist
        py_modules = mod
        	setup.cfgr   r   zmod.py)
write_textr   touch)r&   rootconfigs      r   rS  "TestInstallRequires.create_project&  s7     
	''Vw'G	!r   r%   N)r/   r0   r1   r2   rd  rS  r3   r%   r   r   rA  rA    s    6p"r   rA  c                      \ rS rSrS r\\R                  S 5       5       rSr	\
R                  R                  S\	5      S 5       r\
R                  R                  S\	5      S 5       r\
R                  R                  S\	5      S 5       rS	 rS
 rS rS r\
R                  R                  SS5      S 5       rS rS rSrg)TestSetupRequiresi4  c                    UR                  SS5        UR                  SS5        UR                  SS5        [        R                  " 5          [        R	                  5        n[        R
                  " 5        n[        R                  " US9   [        R                  SSS	S
UR                  SSUU/
n[        R                  " U5      R                  5         SSS5        SSS5        SSS5        SSS5        UR                   Vs/ sH  ofR                  PM     snS/:X  d   eg! , (       d  f       NS= f! , (       d  f       N\= f! , (       d  f       Ne= f! , (       d  f       Nn= fs  snf )z
When easy_install installs a source distribution which specifies
setup_requires, it should honor the fetch parameters (such as
index-url, and find-links).
PIP_RETRIES0PIP_TIMEOUTr   falser
  rF  rG  rY   z--index-urlz--exclude-scriptsz--install-dirNrM  )r   r   quietrn  create_sdistr0  environmentr   rT  rU  rV  Popenwaitr[  r   )r&   r?  r   	dist_filetemp_install_dirrg   rc  s          r   'test_setup_requires_honors_fetch_params9TestSetupRequires.test_setup_requires_honors_fetch_params5  s    	=#.=#.>73^^"//1Y%%'+;!--9IJNN >*)&NN/+,% #((-224 K ( 2 & !+ 3 34 31 349K8LLLL KJ (' 21 & 5s[   E!E7D3A	D"	D3E%EE&"
D0,D33
E=E
E	E
E#c               #      #    [         R                  " 5        n [        R                  R	                  U S5      n[        US[        S5      4S/5        Uv   SSS5        g! , (       d  f       g= f7f)zT
Return an sdist with a setup_requires dependency (of something that
doesn't exist)
z"setuptools-test-fetcher-1.0.tar.gzr   a  
                    import setuptools
                    setuptools.setup(
                        name="setuptools-test-fetcher",
                        version="1.0",
                        setup_requires = ['does-not-exist'],
                    )
                rg  r   N)r   r0  r]   r   r^   r   r   )dir	dist_paths     r   ru  TestSetupRequires.create_sdistS  sh      3S*NOI #	 && O+  s   A0>A	A0
A-)A0)r%   dependency_linkssetup_requires)r  r  use_setup_cfgc                 F   [        SSSS9n[        R                  " U5        [        R                  " 5          [        R
                  " 5        n[        X1S9n[        R                  R                  US5      n[        R                  " 5        u  pg[        US/5        SSS5        WR                  5       n[        U5      S	:  d   eUS
   R                  5       S:X  d   e SSS5        SSS5        g! , (       d  f       NZ= f! , (       d  f       N(= f! , (       d  f       g= f)a  
Regression test for distribution issue 323:
https://bitbucket.org/tarek/distribute/issues/323

Ensures that a distribution's setup_requires requirements can still be
installed and used locally even if a conflicting version of that
requirement is already on the path.
zdoes-not-matterfoobar0.0project_nameversionr  r   --nameNr   r   test_pkg)r   r
   r   r   save_pkg_resources_stater0  create_setup_requires_packager]   r   r^   rt  r   	readlineslenstrip)	r&   r  	fake_disttemp_dirr  test_setup_pyrK  _stderrliness	            r   .test_setup_requires_overrides_version_conflict@TestSetupRequires.test_setup_requires_overrides_version_conflictx  s     #He
	 		"..0!!#x8 !#Xz B^^%):& mhZ8 &
 ((*5zA~%~Ry(J666 $ 10 &% $# 10s<   D?DC0ADD0
C>:D
D	D
D c                    [         R                  " 5          [         R                  " 5        n[        R                  R                  US5      n[        USS5        [        R                  R                  US5      n[        R                  " U5        [        R                  " U5       nS Ul
        UR                  U5        SSS5        [        R                  R                  SU5        [        USSS9n[        R                   " U5        [#        S	5      n[%        USS
[        UUS9n[        R                  R                  US5      n	[         R&                  " 5        u  p [)        U	S/5        SSS5        SW
R1                  5       ;  d   eU
R3                  5       n[5        U5      S:  d   eUS   R7                  5       S:X  d   e SSS5        SSS5        g! , (       d  f       GN= f! [*        R,                   a    U R/                  S5         Nf = f! , (       d  f       N= f! , (       d  f       Ne= f! , (       d  f       g= f)z
Like ``test_setup_requires_overrides_version_conflict`` but where the
``setup_requires`` package is part of a namespace package that has
*already* been imported.
zfoo.bar-0.1.tar.gzzfoo.bar0.1zfoo.bar-0.1c                     U $ rv   r%   )memberr   s     r   rR   FTestSetupRequires.test_setup_requires_override_nspkg.<locals>.<lambda>  s    r   Nr   r  a                      import foo  # Even with foo imported first the
                                # setup_requires package should override
                    import setuptools
                    setuptools.setup(**%r)

                    if not (hasattr(foo, '__path__') and
                            len(foo.__path__) == 2):
                        print('FAIL')

                    if 'foo.bar-0.2' not in foo.__path__[0]:
                        print('FAIL')
                z0.2r  r   r  z9Installing setup.py requirements caused a VersionConflictFAILr   r   r  )r   r  r0  r]   r   r^   make_nspkg_sdistr   tarfiler   extraction_filter
extractallr   insertr   r
   r   r   r  rt  r   r   VersionConflictfailgetvaluer  r  r  )r&   r  r  foobar_1_archivefoobar_1_dirtfrI   templater  r  rK  r  r  s                r   "test_setup_requires_override_nspkg4TestSetupRequires.test_setup_requires_override_nspkg  s    ..0!!#x#%77<<:N#O  !19eD  "ww||HmD&\\"23r+FB(MM,/ 4 <0% y% %  9$"/ !#Xz B^^%):& "-(<	 & V__%6666((*5zA~%~Ry(J666s $ 10 43T )88 		W &%Y $# 10ss   H5A:H$&G BH$HG(,AH$H5
G% H$(%H	HH	H
H!H$$
H2	.H55
Ic           	      $   S n[         R                  " 5          [         R                  " 5        n[        U[	        SS9UUS-   S9n[
        R                  R                  US5      n[         R                  " 5        u  pg[        US/5        S S S 5        WR                  5       n[        U5      S:  d   eUS   R                  5       S	:X  d   e S S S 5        S S S 5        g ! , (       d  f       NZ= f! , (       d  f       N(= f! , (       d  f       g = f)
Nc                 n    S[        SR                  XS95      4US-   [        S5      4/n[        X5        g )Nr   z
                    import setuptools
                    setuptools.setup(
                        name={name!r},
                        version={version!r},
                        py_modules=[{name!r}],
                    )
                    )r#   r  z.pyz6
                    version = 42
                    )r   formatr   )r  distnamer  r   s       r   make_dependency_sdistVTestSetupRequires.test_setup_requires_with_attr_version.<locals>.make_dependency_sdist  sT      H>	 u$E. y(r   zattr: foobar.version)r  )setup_attrsmake_packager  r   	--versionr   r   42)r   r  r0  r  r  r]   r   r^   rt  r   r  r  r  )	r&   r  r  r  r  r  rK  r  r  s	            r   %test_setup_requires_with_attr_version7TestSetupRequires.test_setup_requires_with_attr_version  s    	)4 ..0!!#x8 $-C D!6"/,">	 !#Xz B^^%):&mk]; &((*5zA~%~Ry(D000 $ 10 &% $# 10s<   DAC0;CAC0D
C-)C00
C>	:D
Dc                    UR                  SS5        UR                  SS5        UR                  SS5        UR                  SUR                  5        [        R                  " 5          [        R                  " 5        n[        USS[        / S	9S
9n[        R                  R                  US5      n[        USSS9 nUR                  [        S5      5        S S S 5        [        R                  R                  US5      n[        R                  " [        R                   R"                  5         [%        US/5        S S S 5        S S S 5        S S S 5        ['        UR(                  5      S:X  d   eUR(                  S   R                  S:X  d   eg ! , (       d  f       N= f! , (       d  f       Nj= f! , (       d  f       Ns= f! , (       d  f       N|= f)Nrp  rq  rr  r   rs  PIP_INDEX_URLpython-xlib0.19r  r  rg  r   r   r   z}
                        [easy_install]
                        index_url = https://pypi.org/legacy/
                        r   r  r   r   z/python-xlib/)r   rU  r   r  r0  r  r  r]   r   r^   r   r   r   rl   rm   rn   ro   rp   r   r  r[  )r&   r?  r   r  r  test_setup_cfgfpr  s           r   "test_setup_requires_honors_pip_env4TestSetupRequires.test_setup_requires_honors_pip_env  sh   =#.=#.>73?JNN;..0!!#x8! $b 9	 "$h!D.#@BHH A !#Xz B]]9#3#3#B#BCmk]; D% $ 1* :&&'1,,,""1%**o=== A@ DC% $# 10sU   (G>?F1=FAF1.F <F1G
FF1 
F.*F11
F?	;G
Gc                 j   UR                  SS5        UR                  SS5        UR                  SUR                  5        [        R                  " 5          [        R                  " 5        n[
        R                  R                  US5      n[        USS5        [        USS	9n[        US
S[        SU-  S9S9n[
        R                  R                  US5      n[        US/5        S S S 5        S S S 5        [        UR                  5      S:X  d   eg ! , (       d  f       N2= f! , (       d  f       N;= f)Nrp  rq  rr  r  z
dep.tar.gz
dependencyr  	localhost)	authorityr  r  zdependency @ %sr  r  r   r  r   )r   rU  r   r  r0  r]   r   r^   make_trivial_sdistr   r  r  r   r  r[  )r&   r?  r   r  	dep_sdistdep_urlr  r  s           r   #test_setup_requires_with_pep508_url5TestSetupRequires.test_setup_requires_with_pep508_url#  s    =#.=#.?JNN;..0!!#xGGLL<@	"9lDA%i;G8! $4E4O P !#Xz B-+7 $ 1 :&&'1,,, $# 10s%   D$,A;D'D$
D!	D$$
D2c           	      <   S[        S5      [        S5      S.0n[        R                  " 5          [        R                  " 5        n[        R
                  " X#S9  [        [        R                  " USS5      5      n[        R                  " [        R                  R                  5         [        US/5        SSS5        SSS5        SSS5        [        UR                   5      S	:X  d   eg! , (       d  f       N:= f! , (       d  f       NC= f! , (       d  f       NL= f)
z2The `allow-hosts` option in not supported anymore.r  z~
                    from setuptools import setup
                    setup(setup_requires='python-xlib')
                    z\
                    [easy_install]
                    allow_hosts = *
                    r   rg  prefixr   r  Nr   )r   r   r  r0  r   buildr   pathlibr   rl   rm   rn   ro   rp   r   r  r[  )r&   r?  r   r  setup_pys        r   $test_setup_requires_with_allow_hosts6TestSetupRequires.test_setup_requires_with_allow_hosts7  s       "
  ..0!!#x

52w||Hj*MN]]9#3#3#B#BCh6 D $ 1 :&&'1,,, DC $# 10s<   DA$C<)C+7C<?D+
C95C<<
D
	D
Dc                    UR                  SS5        UR                  SS5        UR                  SS5        UR                  SS5        Sn[        [        X#-  5      5      nSn[        [        X#-  5      S	S
U5        Sn[        [        X&-  5      5      nS[        R
                  R                   S[        R
                  R                   S3n[        [        X&-  5      S	SU5        US-  n	U	R                  [        S5      R                  UUUUUUS9S5        [        [        U	5      5      n
[        R                  " 5          [        [        U5      SS[        S	U
/S9S9n[        R                   R#                  US5      n[%        US/5        SSS5        ['        [)        [        [*        R,                  " [        R                   R#                  WS5      5      5      5      nUS/:X  d   eg! , (       d  f       Nc= f)z#Check `python_requires` is honored.rp  rq  rr  r   1PIP_VERBOSEzdep-1.0.tar.gzz>=2.7dep1.0zdep-2.0.tar.gzz!=.z.*z2.0z
index.htmla  
            <!DOCTYPE html>
            <html><head><title>Links for dep</title></head>
            <body>
                <h1>Links for dep</h1>
                <a href="{dep_1_0_url}"data-requires-python="{dep_1_0_python_requires}">{dep_1_0_sdist}</a><br/>
                <a href="{dep_2_0_url}"data-requires-python="{dep_2_0_python_requires}">{dep_2_0_sdist}</a><br/>
            </body>
            </html>
            )dep_1_0_urldep_1_0_sdistdep_1_0_python_requiresdep_2_0_urldep_2_0_sdistdep_2_0_python_requiresr   r  r  )r  r  r  r   r  Nz.eggszdep 1.0)r   r   r   make_python_requires_sdistr   version_infomajorminorrh  r   r  r   r  r  r  r]   r   r^   r   listmapr   find_distributions)r&   r   r   r  r  r  r  r  r  index	index_urlr  r  eggss                 r   (test_setup_requires_with_python_requires:TestSetupRequires.test_setup_requires_with_python_requiresQ  s   =#.=#.>3/=#.(!#f&<"=>")"&'7N	
 )!#f&<"=>!!''(#*:*:*@*@)AD 	  	#&'7N	
 % f'+(?'+(?   -	
0  E
+	..04F T	H GGLL:>Mmk]3 1 ]55bggll8W6UVW
 	{""" 10s   AG**
G8!with_dependency_links_in_setup_py)FTc                 (   UR                  SS5        UR                  SS5        [        R                  " 5          [        R                  " 5        n[	        [
        R                  R                  US5      SS5        [
        R                  R                  US5      n[
        R                  R                  US5      n[
        R                  R                  US	5      n[
        R                  " U5        [        US
SS9 nU(       a"  [
        R                  R                  US5      /nO/ nUR                  [        S5      R                  US95        S S S 5        [        US
SS9 nUR                  [        S5      R                  [
        R                  R                  US5      US95        S S S 5        [        US/5        S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       N== f! , (       d  f       N9= f! , (       d  f       g = f)Nrp  rq  rr  zpython-xlib-42.tar.gzr  r  r  r   rg  r   r   r   linksz
                        from setuptools import installer, setup
                        setup(setup_requires='python-xlib==42',
                        dependency_links={dependency_links!r})
                        r  z
                        [easy_install]
                        index_url = {index_url}
                        find_links = {find_links}
                        r  )r  r\   r  )r   r   r  r0  r  r]   r   r^   r   r   r   r   r  r   )	r&   r   r  r  r  r  r  r  r  s	            r   0test_setup_requires_with_find_links_in_setup_cfgBTestSetupRequires.test_setup_requires_with_find_links_in_setup_cfg  s    	=#.=#...0!!#x"GGLL+BC]TX 77<<*= "Xz B!#h!D"-w?28,.GGLL7,K+L(+-(HH !&2B&C @ .#@BHH !&&(ggll8W&E'/ !  A -+7G $ 10 @? A@- $# 10sV   HB-G2=AGG2#AG!*G2?H
GG2!
G/+G22
H 	<H
Hc                 ,   [         R                  " 5          [         R                  " 5        n[        [        R
                  R                  US5      SS5        [        R
                  R                  US5      n[        R                  " U5        [
        R                  " [        S5      SS.US9  [        [        R
                  R                  US	5      S
/5        [        R                  " U5        [        R
                  R                  US5      n[        R
                  R                  US	5      n[        R                  " U5        [        USSS9 nUR                  [        S5      5        SSS5        UR                  S[!        U5      5        UR                  SS5        UR                  SS5        UR                  SS5        [        US/5        SSS5        SSS5        g! , (       d  f       N}= f! , (       d  f       N(= f! , (       d  f       g= f)z
Use case: installing a package with a build dependency on
an already installed `dep[extra]`, which in turn depends
on `extra_dep` (whose is not already installed).
extra_dep-1.0.tar.gz	extra_depr  r  a  
                          import setuptools
                          setuptools.setup(
                              name='dep', version='2.0',
                              extras_require={'extra': ['extra_dep']},
                          )
                         r   r  r  r   	dist_infor  r   r   r   
                        from setuptools import installer, setup
                        setup(setup_requires='dep[extra]')
                        NPIP_FIND_LINKSr   r  rp  rq  rr  r  )r   r  r0  r  r]   r   r^   r   r  r   r   r
   	add_entryr   r   r   r   r&   r   r  dep_pkgr  r  r  s          r   4test_setup_requires_with_transitive_extra_dependencyFTestSetupRequires.test_setup_requires_with_transitive_extra_dependency  s    ..0!!#x"GGLL+ABKQV '',,x7!

$(% &( #  "'',,w
;k]K%%g.77<<*= "Xz B"-w?2HH @ ""#3S]C"">37""=#6""=#6-+7Y $ 10> @?= $# 10s<   HD%G4G#,A&G4H#
G1-G44
H	>H
Hc           	      Z   [         R                  " 5          [         R                  " 5        n[        [        R
                  R                  US5      S[        S5      4SS/5        [        R
                  R                  US5      n[        R                  " U5        [
        R                  " [        S5      S[        S	5      S
.US9  [        [        R
                  R                  US5      S/5        [        R                  " U5        [        R
                  R                  US5      n[        R
                  R                  US5      n[        R                  " U5        [        USSS9 nUR                  [        S5      5        SSS5        UR                  S[!        U5      5        UR                  SS5        UR                  SS5        UR                  SS5        [        US/5        SSS5        SSS5        g! , (       d  f       N}= f! , (       d  f       N(= f! , (       d  f       g= f)zS
Use case: ensure build requirements' extras
are properly installed and activated.
r  r   a$  
                          import setuptools
                          setuptools.setup(
                              name='extra_dep',
                              version='1.0',
                              py_modules=['extra_dep'],
                          )
                          r~  )zextra_dep.pyr   epdepa(  
                          import setuptools
                          setuptools.setup(
                              name='dep', version='2.0',
                              py_modules=['epcmd'],
                              extras_require={'extra': ['extra_dep']},
                              entry_points='''
                                           [distutils.commands]
                                           epcmd = epcmd:epcmd [extra]
                                           ''',
                          )
                         r   a  
                                     from distutils.command.build_py import build_py

                                     import extra_dep

                                     class epcmd(build_py):
                                         pass
                                     )r   rg  zepcmd.pyr  r  r  r   r   r   r  Nr  r   r  rp  rq  rr  epcmd)r   r  r0  r   r]   r   r^   r   r   r  r   r
   r  r   r   r   r   r  s          r   .test_setup_requires_with_distutils_command_dep@TestSetupRequires.test_setup_requires_with_distutils_command_dep  s   
 ..0!!#xGGLL+AB ' !	 *,* '',,x9!

$(% &($()	%!6 #9> "'',,w
;k]K%%g.77<<*= "Xz B"-w?2HH @ ""#3S]C"">37""=#6""=#6-'3Y $ 10~ @?} $# 10s<   HD<H(G:A&H)H:
HH
H	H
H*r%   N)r/   r0   r1   r2   r{  r*  r+  r,  ru  r  rl   r   parametrizer  r  r  r  r  r  r  r  r  r  r3   r%   r   r   rn  rn  4  s    M<   8M [[_m<7 =7< [[_m<A7 =A7F [[_m<(1 =(1T>:-(-4:#x [[@-P)8 Q)8V38jR4r   rn  c                 H    [        U S[        SU< SU< S35      4S/5        g)zP
Create a simple sdist tarball at dist_path, containing just a simple
setup.py.
r   zT             import setuptools
             setuptools.setup(
                 name=z,
                 version=z
             )
         r~  N)r   r   )r  r  r  s      r   r  r  C  s7        *	 	
r   c                    UR                  S5      nUS   n[        S[        U5      S-   5       Vs/ sH  nSR                  USU 5      PM     nn[	        SU< SU< SU< SU< S	3	5      nS
nSU4[
        R                  R                  US5      U4/n	USS  HF  n
[
        R                  R                  " U
R                  S5      S/-   6 nU	R                  US45        MH     [        X	5        gs  snf )z
Make an sdist tarball with distname and version which also contains one
package with the same name as distname.  The top-level package is
designated a namespace package).
r  r   r   NzE        import setuptools
        setuptools.setup(
            name=z,
            version=z,
            packages=z",
            namespace_packages=[z]
        )
    z7__import__('pkg_resources').declare_namespace(__name__)r   z__init__.pyr   )	splitranger  r^   r   r]   r   r   r   )r  r  r  parts	nspackageidxpackagesr  initr   packager   s               r   r  r  ^  s     NN3EaI16q#e*q.1IJ1I#t%1IHJ Wh			3H ED(#bggll9m&Ld%STEAB<77<<'--"4"FHh^$   y - Ks   C/c           
      R    [        U S[        S5      R                  XUS94S/5        g )Nr   z                import setuptools
                setuptools.setup(
                  name={name!r},
                  version={version!r},
                  python_requires={python_requires!r},
                )
                )r#   r  python_requiresr~  )r   r   r  )r  r  r  r  s       r   r  r    sD     	 &!O   !	
r   c                    [        U5      S:  d   e[        R                  " U S5       nU H  u  p4[        R                  " UR                  S5      5      n[        R                  " US9n[        UR                  5       5      Ul        [        [        R                  " 5       5      Ul        UR                  XeS9  M     SSS5        g! , (       d  f       g= f)zy
Create a simple sdist tarball at dist_path, containing the files
listed in ``files`` as ``(filename, content)`` tuples.
r   zw:gzr   )r#   )fileobjN)r  r  r   ioBytesIOr   TarInfor  sizeinttimemtimeaddfile)r  r   rI   r   r   
file_bytes	file_infos          r   r   r     s     u:>>	i	(D!&HGNN7$;<JX6I !4!4!67IN!$))+.IOLLL7 "' 
)	(	(s   BC
Cr  r  r%   c                 D   SSU< SU< 3/[         R                  R                  U 5      /S.nU(       a  UR                  U5        [         R                  R	                  U S5      n[         R
                  " U5        U(       a  / n	/ n
U Hq  nUR                  U5      nUSR                  5       ;   a  U
nOU	n[        U[        [        45      (       a  SR	                  U5      nUR                  U< SU< 35        Ms     [        S5      R                  S	R	                  U	5      S	R	                  U
5      S
9nOSn[        [         R                  R	                  US5      SSS9 nUR                  U5        SSS5        Uc  [        S5      n[        [         R                  R	                  US5      SSS9 nUR                  XG-  5        SSS5        [         R                  R	                  X< SU< S35      nU" UX5        U$ ! , (       d  f       N= f! , (       d  f       NQ= f)a  Creates a source tree under path for a trivial test package that has a
single requirement in setup_requires--a tarball for that requirement is
also created and added to the dependency_links argument.

``distname`` and ``version`` refer to the name/version of the package that
the test package requires via ``setup_requires``.  The name of the test
package itself is just 'test_pkg'.
r  r  z==)r#   r  r  r  zname version;z: zg
            [metadata]
            {metadata}
            [options]
            {options}
            
)optionsmetadatar   rg  r   r   r   NzI            import setuptools
            setuptools.setup(**%r)
        r   -z.tar.gz)r]   r   abspathupdater^   r   popr  
isinstancetupler  r   r   r  r   r   )r   r  r  r  setup_py_templater  r  test_setup_attrsr  r   r!  r#   valuesectiontest_setup_cfg_contentsr   foobar_paths                    r   r  r    s   & '/9:WW__T23	 ,ww||D*-HHHX !D$((.E~++--"!%%//NNtU34 " #'#
 &IIg&YYx(  
 	  #%	bggll8[13	IQ	'( 
J   
 
bggll8Z0#	HA	!45 
I '',,tx%IJKh0O# 
J	I 
I	Hs   !H 2H 
H
Hjavaz0Test cannot run under java when executable is shr   c                   4    \ rS rSrSrSrS rS rS rS r	Sr
g	)
TestScriptHeaderi  u   /Users/José/bin/pythonz$C:\Program Files\Python36\python.exec                     S[         R                  " [        R                  R	                  [
        R                  5      5      -  n[         R                  R                  S5      nX!:X  d   eg )Nz#!%s
z#!/usr/local/bin/python	r:   nt_quote_argr]   r   normpathr   rT  r@   
get_headerr&   r  r  s      r   test_get_script_header'TestScriptHeader.test_get_script_header  sI    boobgg.>.>s~~.NOO++,EF!!!r   c                     S[         R                  " [        R                  R	                  [
        R                  5      5      -  n[         R                  R                  S5      nX!:X  d   eg )N#!%s -x
z#!/usr/bin/python -xr2  r6  s      r   test_get_script_header_args,TestScriptHeader.test_get_script_header_args  sI    1A1A#..1Q!RR++,BC!!!r   c                     [         R                  R                  SU R                  S9nSU R                  -  nX:X  d   eg )N#!/usr/bin/pythonrT  r:  )r:   r@   r5  non_ascii_exer&   r  r  s      r   $test_get_script_header_non_ascii_exe5TestScriptHeader.test_get_script_header_non_ascii_exe  sD    ++D,>,> , 
 !3!33!!!r   c                     [         R                  R                  SSU R                  -   S-   S9nSU R                  -  nX:X  d   eg )Nr>  "r?  z#!"%s"
)r:   r@   r5  exe_with_spacesrA  s      r   &test_get_script_header_exe_with_spaces7TestScriptHeader.test_get_script_header_exe_with_spaces  sN    ++C$2F2F,F,L , 
  4 44!!!r   r%   N)r/   r0   r1   r2   r@  rF  r7  r;  rB  rG  r3   r%   r   r   r0  r0    s"    
 .M=O"
"
""r   r0  c                       \ rS rSrS rS r\R                  " S\R                  5      \R                  R                  \R                  5      S 5       5       rS rS
S jrS	rg)TestCommandSpeci  c                 `    [         R                  " SS/5      nUR                  5       S:X  d   eg)z`
Show how a custom CommandSpec could be used to specify a #! executable
which takes parameters.
z/usr/bin/envpython3z#!/usr/bin/env python3
N)r:   r;   r>   r&   rg   s     r   test_custom_launch_command*TestCommandSpec.test_custom_launch_command  s,    
 nnni89}}"<<<<r   c                 |    [         R                  " S/5      n[         R                  R                  U5      nXL d   eg)z7
from_param should return an instance of a CommandSpec
pythonN)r:   r;   
from_param)r&   rg   cmd_news      r   .test_from_param_for_CommandSpec_is_passthrough>TestCommandSpec.test_from_param_for_CommandSpec_is_passthrough   s2     nnhZ(..++C0~~r   zsys.executablec                     [         R                  R                  SS 5        [        R                  R                  5       n[        U5      S:X  d   eUR                  5       R                  S5      (       d   eg )N__PYVENV_LAUNCHER__r   z#!")	r]   r   r%  r:   r;   r=   r  r>   rD   rM  s     r   /test_from_environment_with_spaces_in_executable?TestCommandSpec.test_from_environment_with_spaces_in_executable(  sV     	

,d3nn--/3x1}}}}))%0000r   c                     [         R                  R                  S5      n[        U5      S:X  d   eSUR	                  5       ;  d   eg)zn
In order to support `executable = /usr/bin/env my-python`, make sure
from_param invokes shlex on that input.
z/usr/bin/env my-pythonr8   rE  N)r:   r;   rR  r  r>   rM  s     r   "test_from_simple_string_uses_shlex2TestCommandSpec.test_from_simple_string_uses_shlex0  s=    
 nn''(@A3x1}}#--/)))r   Nc                    [         R                  " [        5       n[        R                  R                  [        5       5        SSS5        [        WR                  5      S:X  d   UR                  5       eg! , (       d  f       N9= f)zS
from_param should raise its own TypeError when the argument's type is unsupported
Nz1Argument has an unsupported type <class 'object'>)	rl   rm   	TypeErrorr:   r;   rR  objectr   r*  )r&   exc_infos     r   %test_from_param_raises_expected_error5TestCommandSpec.test_from_param_raises_expected_error9  s\     ]]9%NN%%fh/ & #VV	>>	V &%s   (A66
Br%   )returnN)r/   r0   r1   r2   rN  rT  r   r  r0  rF  r  r]   r   rX  r[  ra  r3   r%   r   r   rJ  rJ    sW    = 
ZZ "2"B"BC	ZZ__RZZ 1 ! D1*r   rJ  c                       \ rS rSrS rSrg)TestWindowsScriptWriteriD  c                    [         R                  R                  S5      nUR                  S5      (       d   eUR	                  S5      (       d   eUR                  S5      nUR                  S5      nUR                  S5      (       a   eg )Nr   z#!r  z\")r:   WindowsScriptWriterr5  rD   endswithlstriprstrip)r&   hdrs     r   test_header#TestWindowsScriptWriter.test_headerE  sv    $$//3~~d####||D!!!!jjjj>>%(((((r   r%   N)r/   r0   r1   r2   rl  r3   r%   r   r   re  re  D  s    )r   re  c                   H    \ rS rSr% \\S'   \\S'   \\S'   \\S'   \\S'   Srg)	VersionStubiO  r  r  microreleaselevelserialr%   N)r/   r0   r1   r2   r  __annotations__r   r3   r%   r   r   ro  ro  O  s    JJJKr   ro  c           	          [        5       nUR                  S5      nS/Ul        SUl        SUl        [        U 5      Ul        S Ul        UR                  S5      n[        U 5      Ul        S Ul        UR                  5        n[        R                  " 5          [        R                  " S5        Sn[        SS	S
SS5      nUR                  SS5        UR                  SU5        UR                  SU5        UR                  US[        R                  " 5       5        UR!                  5         S S S 5        S S S 5        [#        [$        S5      (       a  SOSn	UR&                  R)                  5       n
[*        R,                  " U	S-   U
5      (       a!  [*        R,                  " U	S-   U
5      (       d   eUR.                  S   S:X  d   eUR.                  S   S:X  d   eUR.                  S   S:X  d   eg ! , (       d  f       N= f! , (       d  f       N= f)NrY   rW   r   TrE  ignorez:3.10.1 (main, Dec 21 2021, 09:17:12) [GCC 10.2.1 20210110]   
   r   finalr   zsys.versionzsys.version_infocreate_home_pathpypy_version_infopypyrQ  z3\.?1z3\.?1\d
py_versionz3.10.1py_version_shortz3.10py_version_nodot310)r   get_command_objrJ   optimizer   r   install_userbaseinstall_usersitecontextwarningscatch_warningssimplefilterro  r|   r   r(  finalize_optionshasattrr   ra   lowerrE   rF   config_vars)r   
tmpdir_cwdr   rI   rg   install_cmdr  r  r  r#   ra   s              r   &test_use_correct_python_version_stringr  W  s    >D


~
.CvCHCLCHv;CC&&y1K#&v;K #'K 				%)@)@)Bh'N1b!Wa0-t4mW-($/c-tyy{; *C	 S"5666HD//'')K 
yy+..yy
*K8888
 ??<(H444??-.&888??-.%7779 *C)B		s%   G?BG.+G?.
G<	8G??
HdarwinzDhttps://github.com/pypa/setuptools/pull/4716#issuecomment-2447624418c                 `   UR                  SS5        UR                  S[        US-  5      5        UR                  S[        US-  5      5        UR                  S[        US-  5      5        UR                  SS5        UR                  S	S5        [        [        R
                  " 5       5      nUR                  S
S
S9  US-  nUR                  S
S
S9  UR                  S[        U5      5        SnUS-  R                  USS9  [        UR                  S5      5      / :X  d   e[        UR                  S5      5      / :X  d   e[        SSS/5        [        UR                  S5      5      / :X  d   eUR                  S5       Vs1 sH  ofR                  iM     nnUS1-
  nUS1:X  d   egs  snf )zC`setup.py develop` should honor `--user` even under build isolationr   FHOMEz.homeUSERPROFILEAPPDATAzsite.USER_BASENzsite.USER_SITET)parentsrD  z.sys_prefixz
sys.prefixzF__import__('setuptools').setup(name='aproj', version=42, packages=[])
r   r   r   *developz--userzeasy-install.pthzaproj.egg-link)r|   r   r   r   r}   getusersitepackagesr   rh  r  globr   r#   )r   r   r_  	user_site
sys_prefixsetup_scriptr   	installeds           r   &test_editable_user_and_build_isolationr    s    /7( vs8g#567}c(W*<&=>y#h&8"9:($/($/T--/0IOOD4O0M)JTD1c*o6 	R  
&&|g&F 
$%+++	s#$*** j9h/0 
$%+++!*!45!4A!4I5/00I)**** 6s   F+)S__doc__r+  r  rB   r   r]   r  rE   r}   rV  r   r  r_   r  r  r   r   typingr   unittestr   rl   jaracor   r   r  r  rY   r:   r   r   r	   r
   
setuptoolsr   r   setuptools.distsetuptools.sandboxr   setuptools.testsr   setuptools.tests.serverr   r   r   r   textwrapr   distutils.errorsrn   r   r   r   r   r5   r   filterwarningsr   r   usefixturesr   r3  r5  r?  rA  rn  r  r  r  r   r  r   r   rD   is_shrT  r0  rJ  re  ro  r  r^  r  r%   r   r   <module>r     s     	   	  	   
            , , U U  < ( ( * ;    / /  \2 \2~ 01A
 A
 2A
H   ))X
 X
 * *X
v   ,-- - .-
  D" D"NL4 L4^6 !F08& #IX LLF#@(@=  " "	":* *Z) )* +8\ LLHQ  9+	9+r   