+
    h                     *   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIHt ^ RIt^ RIHu Ht ^ RIHtHtH t  ^ RI!H"t" ^ RI#H$t$ ^ R	IH%t% ^ R
I&Ht ^ RI'H(t( ^ RI)H*t* ^ RI+H,t,H-t- ^RI.H/t/ ^RI0H1t1 ^ RI2t3]Ph                  ! RR7      R 4       t5 ! R R4      t6]1! R4      t7 ! R R4      t8]Pr                  Pu                  R4       ! R R4      4       t;]Ph                  R 4       t<]Pr                  P{                  R4      ]Pr                  P{                  R4       ! R R4      4       4       t>]Ph                  R  4       t?]Pr                  P{                  R!4       ! R" R#4      4       t@]Ph                  R$ 4       tA ! R% R&4      tB ! R' R(4      tCR) tDR* tER+ tFR, tGR-R.]DRRR?3R/ ltH]Pr                  P                  ]
P                  P                  R04      ;'       d    ]P                  ! ]
P                  4      R1R27       ! R3 R44      4       tN ! R5 R64      tO ! R7 R84      tP ! R9 R:]4      tQR; tR]Pr                  P                  ]
P                  R<8H  R=R27      R> 4       tTR# )@zEasy install TestsN)Path)
NamedTuple)mockpath)Distributionnormalize_pathworking_set)sandbox)
safer_name)PthDistributions)r   	run_setup)fail_on_ascii)
MockServerpath_to_url)contexts)DALST)autousec                *    V P                  RR4       R# )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   &D/usr/lib/python3/dist-packages/setuptools/tests/test_easy_install.pypip_disable_indexr   *   s     ~v.    c                   ,   a  ] tR t^4t o R tR tRtV tR# )FakeDistc                    VR 8w  d   / # RR/# )console_scriptsnameep )selfgroups   &&r   get_entry_mapFakeDist.get_entry_map5   s    %%I~r   c                    R # )specr#   r$   s   &r   as_requirementFakeDist.as_requirement:   s    r   r#   N)__name__
__module____qualname____firstlineno__r&   r+   __static_attributes____classdictcell____classdict__s   @r   r   r   4   s     
 r   r   z3
    from setuptools import setup

    setup()
    c                   L  a  ] tR t^Gt o R tR tR tR tR t]	P                  R 4       t]R 4       t]	P                  R 4       t]R	 4       t]	P                  R
 4       t]	P"                  P%                  ]P(                  P+                  R4      '       * RR7      R 4       tRtV tR# )TestEasyInstallTestc                   \         P                  P                  4       P                  4       P	                  4       p\        4       p\        \         P                  P                  V4      4      p\        P                  ! V^4      w  rEVP                  V4      '       g   Q hRV9   g   Q hRV9   g   Q hRV9   g   Q h\        P                  ! RV\        P                  R7      '       g   Q hR# )   z'spec'z'console_scripts'z'name'z^# EASY-INSTALL-ENTRY-SCRIPT)flagsN)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_argsH   s    $$&779CCEzBOO,,T23!((q1  ((((6!!!"f,,,6!!!yy7r||TTTTr   c                   \        4       p\        P                  ! V4      pR  Vn        RVn        RR.Vn        \        P                  P                  \        P                  ! 4       R4      Vn        R.Vn        VP                  4        VP                  P                  / 8X  g   Q h\        P                  ! V4      pR Vn        RR.Vn        \        P                  P                  \        P                  ! 4       R4      Vn        R.Vn        VP                  4        \!        VP                  P                  P#                  4       4      pVRR.8X  g   Q hR# )c                      R # Tr#   r#   r   r   <lambda>8TestEasyInstallTest.test_no_find_links.<locals>.<lambda>X       4r   Tlink1link2okc                      R # rQ   r#   r#   r   r   rR   rS   b   rT   r   N)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_linksS   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                @   \        4       p\        P                  ! V4      p\        P                  ! 4       Vn        \        P                  ! \        P                  P                  4      ;_uu_ 4        VP                  4        RRR4       R#   + '       g   i     R# ; i)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_exceptionj   s\     ~ood#))+]]9++::;;$$& <;;;s   1BB	c                   a \        R4      oV3R lpVP                  \        RVRR7       S\        P                  ! 4       9   g   Q hR# )zP
get_site_dirs should always return site dirs reported by
site.getsitepackages.
z/setuptools/test/site-packagesc                  
   < S .# Nr#   r   s   r   mock_gsp8TestEasyInstallTest.test_all_site_dirs.<locals>.mock_gsp{   s
    6Mr   getsitepackagesFraisingN)r   setattrsiter:   get_site_dirs)r$   r   rw   r   s   && @r   test_all_site_dirs&TestEasyInstallTest.test_all_site_dirst   sF    
 >?	 	D"3XuMr''))))r   c                p    VP                  \        R RR7       \        P                  ! 4       '       g   Q hR# )ry   Frz   N)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                    R \        R4      3RR.pRpW,          p\        P                  ! \        V4      R4      pV F  w  rgVP	                  Wg4       K  	  VP                  4        \        V4      # )setup.pya5  
                    import setuptools
                    setuptools.setup(
                        name="setuptools-test-unicode",
                        version="1.0",
                        packages=["mypkg"],
                        include_package_data=True,
                    )
                    zsetuptools-test-unicode-1.0.zipwzmypkg/__init__.py )u   mypkg/☃.txtr   )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                ,   \        RR./4      pVR,          P                  4       p\        P                  ! V\	        V4      R.R7      pVP                  \        P                  R\	        V4      4       VP                  4        VP                  V4       R# )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                   R \        R4      3RR\        R4      3.pRpW,          p\        P                  ! \        V4      R4      pV F%  w  rgVP	                  WgP                  R4      4       K'  	  VP                  4        \        V4      # )r   ar  
                    import setuptools
                    setuptools.setup(
                        name="setuptools-test-unicode",
                        version="1.0",
                        packages=["mypkg"],
                        include_package_data=True,
                        scripts=['mypkg/unicode_in_script'],
                    )
                    zmypkg/unicode_in_scriptu   
                    #!/bin/sh
                    # á

                    non_python_fn() {
                    }
                z&setuptools-test-unicode-script-1.0.zipr   utf-8r   )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                ,   \        RR./4      pVR,          P                  4       p\        P                  ! V\	        V4      R.R7      pVP                  \        P                  R\	        V4      4       VP                  4        VP                  V4       R# )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                v    R \        R4      3R\        R4      3.pRp\        W,          4      p\        WB4       V# )r   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                j   \        RR./4      pVR,          P                  4       p\        P                  ! V\	        V4      R.R7      pVP                  \        P                  R\	        V4      4       VP                  4        VP                  V4       VR,          P                  4       '       g   Q hR# )	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-   r.   r/   r0   rM   rh   rr   r   r   rl   fixturer   r   r   r   r   r   markskipifsysplatformrD   r   r1   r2   r3   s   @r   r6   r6   G   s     	U*.'*" ^^! !F ( (  ^^' 'R 2 2 ^^ < [[LL##G,,5T  22r   r6   zignore:Unbuilt eggc                   2   a  ] tR tRt o R tR tR tRtV tR# )TestPTHFileWriteri&  c                    \        R\        P                  ! 4       .4      pVP                  '       d   Q hVP	                  \        \        P                  ! 4       4      4       VP                  '       g   Q hR# )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(  sL     /"))+?999}ryy{+,yyyyr   c                    R p\         P                  ! V4      p\        RV.4      pVP                  '       d   Q hVP	                  \        V4      4       VP                  '       d   Q hR# )z%/test/location/does-not-have-to-existr   N)pkg_resourcesr   r   r   r   r   )r$   locationr   s   &  r   test_add_from_site_is_ignored/TestPTHFileWriter.test_add_from_site_is_ignored1  s]    : //9
 999}x()999}9r   c                   VP                  R4      pVP                  4        \        VP                  R4      4      p\        V4      p\        V4      pVP                  VP                  u;8X  d   . 8X  g   Q R4       h Q R4       hVP                  R4      pVP                  4        \        V4      pVP                  P                  V4       VP                  4        VP                  '       g   Q R4       hWuP                  9  g   Q R4       hVP                  4        WuP                  9   g   Q R4       hVP                  R,          V8X  g   Q R4       h\        V4      P                  VP                  8X  g   Q R	4       hR
# )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?  se    [[.
z{34))zzTZZ-2- 	
D	
- 	
D	
-
 {{<0|,

*+		zzz 	
S	
z  zz1 	
H	
1 			::- 	
X	
- zz"~- 	
.	
-
  )//4::= 	
5	
=r   r#   N)	r-   r.   r/   r0   r   r   r   r1   r2   r3   s   @r   r   r   &  s     )
 )
r   r   c              #   &  "   V R ,          P                  RRR7      ;_uu_ 4       pVP                  \        4       RRR4       V P                  4       ;_uu_ 4        V x  RRR4       R#   + '       g   i     L7; i  + '       g   i     R# ; i5i)r   r   r   encodingN)openwriteSETUP_PYas_cwd)r   fs   & r   setup_contextr   k  sZ     
:
	#	#C'	#	:	:a	 
;	 
 
;	:	s3   #BA* BA= 
B*A:	5B=B		Buser_overrider   c                     a  ] tR tRt o ]P
                  ! R]P                  ! 4       4      t]P
                  ! R]P                  4      ]P
                  ! RR4      ]R 4       4       4       t
]P
                  ! RR4      ]R 4       4       t]R	 4       tR
 t]P                   R 4       t]P                   R 4       tR t]P*                  R 4       tR tRtV tR# )TestUserInstallTestis  z;setuptools.command.easy_install.easy_install.check_site_dirz(setuptools.command.easy_install.__file__site.ENABLE_USER_SITETc                &    V P                  4        R # 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                &    V P                  4        R # rv   r   r*   s   &r   0test_user_install_not_implied_user_site_disabledDTestUserInstallTest.test_user_install_not_implied_user_site_disabled  s     	!!#r   c                     \        4       p R V n        \        P                  ! V 4      pR.Vn        VP                  4        VP                  '       d   Q R4       hR# )r   pyzuser should not be impliedN)r   script_namer:   rY   rJ   rb   user)rI   rg   s     r   r   (TestUserInstallTest.assert_not_user_site  sL     ~%ood#6888999|8r   c                    \         P                  ! R 4       \        P                  ! R4      p\        P                  ! \        P
                  \        P                  R7       VP                  R4       R# )multiprocessingtest_easy_install)levelstreamzthis should not breakN)	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                    VR ,          pVP                  R4      ;_uu_ 4       pVP                  R4       RRR4       \        V4      #   + '       g   i     L; i)zfoo-1.0.egg-infor   z
Name: foo
N)r   r   r   )r$   r   egg_filer   s   &&  r   foo_packageTestUserInstallTest.foo_package  sB    ..]]31GGM"  6{  s   AA	c           	   #    "   \        V4      p\        P                  ! R \        P                  V.,           4      ;_uu_ 4        \
        P                  P                  P                  \        P                  4      p\        P                  P                  \
        P                  VR7      ;_uu_ 4        Vx  RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i5i)zsys.pathr   N)
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8''//..sxx8KDD E 98DD 988s7   AC0A/C2C		7C?
C0	CCC-	'	C0c                   \        4       pRVn        \        P                  ! V4      pW$n        R.Vn        VP                  4        VP                  P                  V.4       VP                  R4      p\        P                  P                  \        P                  P                  VP                  4      4      p\        P                  P                  \        P                  P                  V4      4      pWg8X  g   Q hR# )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              /     "   V P                   ! V/ VB ;_uu_ 4        ^ RIHu Hp \        P
                  Vn        Rx  RRR4       R#   + '       g   i     R# ; i5i)z_
Wrap sandbox.setup_context to patch easy_install in that context to
appear as user-installed.
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  s?      ///88..BK	 0///s   A#A
 
A
A		Ac                n    \         P                  V n        \        P                  ! R V P
                  4      # )z 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-   r.   r/   r0   r   r  Mockprev_sp_writer}   r   r   r   staticmethodr   r  rl   r   r  r  r  
contextlibcontextmanagerr#  r&  r1   r2   r3   s   @r   r   r   s  s      JJE		M 
ZZ:DNNK	ZZ'.$  / L$ 
ZZ'/$  0$ : :* ^^  ^^ "" 	 	
 
r   r   c            	   #   \  "   \         P                  R R4      p \        P                  ! \        P
                  R7      ;_uu_ 4        \        RRRR7      ;_uu_ 4       pVP                  V 4       RRR4       Rx  RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i5i)zfrom setuptools import setupz from distutils.core import setup)cdr   r   r   r   N)r   replacer   tempdirr]   chdirr   r   )distutils_setup_pyr   s     r   distutils_packager3    ss     !))&* 
		RXX	&	&*cG44GG&' 5 
'	&44 
'	&	&s6   AB,BB	/B;
B,BBB)	#	B,r3  c                   &   a  ] tR tRt o R tRtV tR# )TestDistutilsPackagei  c                     \        R R.4       R# )r   	bdist_eggNr   r*   s   &r   )test_bdist_egg_available_on_distutils_pkg>TestDistutilsPackage.test_bdist_egg_available_on_distutils_pkg  s    *{m,r   r#   N)r-   r.   r/   r0   r8  r1   r2   r3   s   @r   r5  r5    s     - -r   r5  c                      \        4       p V P                  ^ 8X  d   \        P                  ! R4       V P	                  4        V # )    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                   ,   a  ] tR tRt o R tR tRtV tR# )TestInstallRequiresi  c                   VR,          pVP                  RR7       VR,          pVP                  RR7       V P                  V4       \        P                  RRRR\	        V4      R\	        V4      R	\	        V4      R
\	        V4      R\	        V4      R\	        V4      R\	        V4      .p/ \
        P                  CRVP                  /Cp\        P                  ! V\	        V4      V\        P                  \        P                  RRR7      pVP                  ^ 8w  g   Q h RVP                   Uu0 uF  qP                  kK  	  up9   g   Q h\        R VP                   P#                  4        4       4      '       g   Q hR# u upi   \$         dG    RTP                   9   d4   \&        P(                  ! \        P*                   RTP                    24       h i ; i)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   /does-not-exist/c              3   J   "   T F  pR V9   g   K  RV9   g   K  Vx  K  	  R# 5i)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?   rL  
splitlines	Exceptionrl   xfailr   )	r$   tmp_pathr@  project_rootinstall_rootrg   rK  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   F .E?;F ?F AGc                ~    R pVR,          P                  \        V4      RR7       VR,          P                  4        R# )z
        [metadata]
        name = project
        version = 42

        [options]
        install_requires = does-not-exist
        py_modules = mod
        	setup.cfgr   r   zmod.pyN)
write_textr   touch)r$   rootconfigs   && r   rT  "TestInstallRequires.create_project'  s7     
	''Vw'G	!r   r#   N)r-   r.   r/   r0   re  rT  r1   r2   r3   s   @r   rB  rB    s     6p" "r   rB  c                     a  ] tR tRt o R t]]P                  R 4       4       tRt	]
P                  P                  R]	4      R 4       t]
P                  P                  R]	4      R 4       t]
P                  P                  R]	4      R 4       tR tR	 tR
 tR t]
P                  P                  RR4      R 4       tR tR tRtV tR# )TestSetupRequiresi5  c                0   VP                  RR4       VP                  RR4       VP                  RR4       \        P                  ! 4       ;_uu_ 4        \        P	                  4       ;_uu_ 4       p\        P
                  ! 4       ;_uu_ 4       p\        P                  ! VR7      ;_uu_ 4        \        P                  RRR	R
VP                  RRVV.
p\        P                  ! V4      P                  4        RRR4       RRR4       RRR4       RRR4       VP                   Uu. uF  qfP                  NK  	  upR.8X  g   Q hR#   + '       g   i     LW; i  + '       g   i     Lb; i  + '       g   i     Lm; i  + '       g   i     Lx; iu upi )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
  rG  rH  rY   z--index-urlz--exclude-scriptsz--install-dirNrN  )r   r   quietro  create_sdistr0  environmentr   rU  rV  rW  Popenwaitr\  r   )r$   r@  r   	dist_filetemp_install_dirrg   rd  s   &&&    r   'test_setup_requires_honors_fetch_params9TestSetupRequires.test_setup_requires_honors_fetch_params6  s'    	=#.=#.>73^^"//11Y%%''+;!--9IJJNN >*)&NN/+,% #((-224 K ( 2 & !+ 3 34 31 349K8LLLL KJ (' 21 & 5s[   F 1E-	 E/A	E8E E-	F &FEEE*%E-	-E=8F  F	c            	   #     "   \         P                  ! 4       ;_uu_ 4       p \        P                  P	                  V R4      p\        VR\        R4      3R.4       Vx  RRR4       R#   + '       g   i     R# ; i5i)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'],
                    )
                Nrh  r   )r   r0  r]   r   r^   r   r   )dir	dist_paths     r   rv  TestSetupRequires.create_sdistT  sn      3S*NOI #	 && O+  s   A<>A(
A<(A9	3	A<use_setup_cfgc                   \        RRRR7      p\        P                  ! V4       \        P                  ! 4       ;_uu_ 4        \        P
                  ! 4       ;_uu_ 4       p\        W1R7      p\        P                  P                  VR4      p\        P                  ! 4       ;_uu_ 4       w  rg\        VR.4       RRR4       XP                  4       p\        V4      ^ 8  g   Q hVR
,          P                  4       R	8X  g   Q h RRR4       RRR4       R#   + '       g   i     Lc; i  + '       g   i     L-; i  + '       g   i     R# ; i)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   --nameNtest_pkgr   )r   r	   r   r   save_pkg_resources_stater0  create_setup_requires_packager]   r   r^   ru  r   	readlineslenstrip)	r$   r  	fake_disttemp_dirr  test_setup_pyrL  _stderrliness	   &&       r   .test_setup_requires_overrides_version_conflict@TestSetupRequires.test_setup_requires_overrides_version_conflicty  s     #He
	 		"..00!!##x8 !#Xz B^^%%):& mhZ8 &
 ((*5zA~%~Ry(J666 $ 10 &% $# 100s>   D; A
D(	*D:AD(	D;D% D(	(D83D;;E	c                   \         P                  ! 4       ;_uu_ 4        \         P                  ! 4       ;_uu_ 4       p\        P                  P                  VR4      p\        VRR4       \        P                  P                  VR4      p\        P                  ! V4       \        P                  ! V4      ;_uu_ 4       pR Vn
        VP                  V4       RRR4       \        P                  P                  ^V4       \        VRRR7      p\        P                   ! V4       \#        R4      p\%        VRR	\        VVR
7      p\        P                  P                  VR4      p	\         P&                  ! 4       ;_uu_ 4       w  r \)        V	R.4       RRR4       RX
P3                  4       9  g   Q hV
P5                  4       p\7        V4      ^ 8  g   Q hVR,          P9                  4       R8X  g   Q h RRR4       RRR4       R#   + '       g   i     EL5; i  \*        P,                   d    \.        P0                  ! R4        Li ; i  + '       g   i     L; i  + '       g   i     Lr; i  + '       g   i     R# ; i)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                     V # rv   r#   )memberr   s   &&r   rR   FTestSetupRequires.test_setup_requires_override_nspkg.<locals>.<lambda>  s    r   Nr  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  r0  r]   r   r^   make_nspkg_sdistr   tarfiler   extraction_filter
extractallr   insertr   r	   r   r   r  ru  r   r   VersionConflictrl   failgetvaluer  r  r  )r$   r  r  foobar_1_archivefoobar_1_dirtfrI   templater  r  rL  r  r  s   &&           r   "test_setup_requires_override_nspkg4TestSetupRequires.test_setup_requires_override_nspkg  s    ..00!!##x#%77<<:N#O  !19eD  "ww||HmD&\\"233r+FB(MM,/ 4 <0% y% %  9$"/ !#Xz B^^%%):& "-(<	 & V__%6666((*5zA~%~Ry(J666s $ 10 433T )88 W &%Y $# 100ss   I/BI	>HB)I	I	HAI	2I/H	I	+II	II		II	I,'I//J 	c                   R  p\         P                  ! 4       ;_uu_ 4        \         P                  ! 4       ;_uu_ 4       p\        V\	        RR7      VVR,           R7      p\
        P                  P                  VR4      p\         P                  ! 4       ;_uu_ 4       w  rg\        VR.4       RRR4       XP                  4       p\        V4      ^ 8  g   Q hVR,          P                  4       R8X  g   Q h RRR4       RRR4       R#   + '       g   i     Lc; i  + '       g   i     L-; i  + '       g   i     R# ; i)	c           
      x    R \        RV: RV: RV: R24      3VR,           \        R4      3.p\        W4       R# )r   zj
                    import setuptools
                    setuptools.setup(
                        name=z",
                        version=z&,
                        py_modules=[z-],
                    )
                    z.pyz6
                    version = 42
                    N)r   r   )r  distnamer  r   s   &&& r   make_dependency_sdistVTestSetupRequires.test_setup_requires_with_attr_version.<locals>.make_dependency_sdist  sk      '\ *!!( ,%%-L 1	 u$E. y(r   zattr: foobar.version)r  )setup_attrsmake_packager  r   	--versionN42r   )r   r  r0  r  r  r]   r   r^   ru  r   r  r  r  )	r$   r  r  r  r  r  rL  r  r  s	   &&       r   %test_setup_requires_with_attr_version7TestSetupRequires.test_setup_requires_with_attr_version  s    	)4 ..00!!##x8 $-C D!6"/,">	 !#Xz B^^%%):&mk]; &((*5zA~%~Ry(D000 $ 10 &% $# 100s<   D.AD	D-AD	6D.DD	D+&D..D?	c                   VP                  R R4       VP                  RR4       VP                  RR4       VP                  RVP                  4       \        P                  ! 4       ;_uu_ 4        \        P                  ! 4       ;_uu_ 4       p\        VRR\        . R7      R	7      p\        P                  P                  VR
4      p\        VRRR7      ;_uu_ 4       pVP                  \        R4      4       RRR4       \        P                  P                  VR4      p\        P                  ! \        P                   P"                  4      ;_uu_ 4        \%        VR.4       RRR4       RRR4       RRR4       \'        VP(                  4      ^8X  g   Q hVP(                  ^ ,          P                  R8X  g   Q hR#   + '       g   i     L; i  + '       g   i     Lu; i  + '       g   i     L; i  + '       g   i     L; i)rq  rr  rs  r   rt  PIP_INDEX_URLpython-xlib0.19dependency_linksr  rh  r   r   r   z}
                        [easy_install]
                        index_url = https://pypi.org/legacy/
                        Nr   r  z/python-xlib/)r   rV  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  st   =#.=#.>73?JNN;..00!!##x8! $b 9	 "$h!D.#@@BHH A !#Xz B]]9#3#3#B#BCCmk]; D% $ 1* :&&'1,,,""1%**o=== A@ DC% $# 10sV   0G8AG%	F?9AG%	G%G%	-G8?G
G%	G"G%	%G50G88H	c                   VP                  R R4       VP                  RR4       VP                  RVP                  4       \        P                  ! 4       ;_uu_ 4        \        P                  ! 4       ;_uu_ 4       p\
        P                  P                  VR4      p\        VRR4       \        VRR7      p\        VR	R
\        RV 2R7      R7      p\
        P                  P                  VR4      p\        VR.4       RRR4       RRR4       \        VP                  4      ^ 8X  g   Q hR#   + '       g   i     L6; i  + '       g   i     LA; i)rq  rr  rs  r  z
dep.tar.gz
dependencyr  	localhost)	authorityr  r  zdependency @ setup_requiresr  r   r  N)r   rV  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0!!##xGGLL<@	"9lDA%i;G8! $mG94M N !#Xz B-+7 $ 1 :&&'1,,, $# 10s%   E<BD.	 E.D>9EE	c                   RR\        R4      R\        R4      //p\        P                  ! 4       ;_uu_ 4        \        P                  ! 4       ;_uu_ 4       p\        P
                  ! W#R7       \        \        P                  ! VRR4      4      p\        P                  ! \        P                  P                  4      ;_uu_ 4        \        VR.4       RRR4       RRR4       RRR4       \        VP                   4      ^ 8X  g   Q hR#   + '       g   i     L>; i  + '       g   i     LI; i  + '       g   i     LT; i)	z2The `allow-hosts` option in not supported anymore.r  r   z~
                    from setuptools import setup
                    setup(setup_requires='python-xlib')
                    rh  z\
                    [easy_install]
                    allow_hosts = *
                    prefixr  N)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_hosts8  s     D T
  ..00!!##x

52w||Hj*MN]]9#3#3#B#BCCh6 D $ 1 :&&'1,,, DC $# 10s<   D/A/D	D	D	D/	DD	D,'D//D?	c                H   VP                  RR4       VP                  RR4       VP                  RR4       VP                  RR4       Rp\        \        W#,          4      4      pRp\        \        W#,          4      R	R
V4       Rp\        \        W&,          4      4      pR\        P
                  P                   R\        P
                  P                   R2p\        \        W&,          4      R	RV4       VR,          p	V	P                  \        R4      P                  VVVVVVR7      R4       \        \        V	4      4      p
\        P                  ! 4       ;_uu_ 4        \        \        V4      RR\        R	V
.R7      R7      p\        P                   P#                  VR4      p\%        VR.4       RRR4       \'        \)        \        \*        P,                  ! \        P                   P#                  XR4      4      4      4      pVR.8X  g   Q hR#   + '       g   i     Lg; i)z#Check `python_requires` is honored.rq  rr  rs  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minorri  r   formatr   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_requiresR  s   =#.=#.>3/=#.(!#f&<"=>")"&'7N	
 )!#f&<"=>!!''(#*:*:*@*@)AD 	  	#&'7N	
 % f'+(?'+(?   -	
0  E
+	..004F T	H GGLL:>Mmk]3 1 ]55bggll8W6UVW
 	{""" 10s    AHH!	!with_dependency_links_in_setup_pyc                   VP                  R R4       VP                  RR4       \        P                  ! 4       ;_uu_ 4        \        P                  ! 4       ;_uu_ 4       p\	        \
        P                  P                  VR4      RR4       \
        P                  P                  VR4      p\
        P                  P                  VR4      p\
        P                  P                  VR4      p\
        P                  ! V4       \        VR	R
R7      ;_uu_ 4       pV'       d#   \
        P                  P                  VR4      .pM. pVP                  \        R4      P                  VR7      4       RRR4       \        VR	R
R7      ;_uu_ 4       pVP                  \        R4      P                  \
        P                  P                  VR4      VR7      4       RRR4       \        VR.4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     LB; i  + '       g   i     L@; i  + '       g   i     R# ; i)rq  rr  rs  zpython-xlib-42.tar.gzr  r  r  r   rh  r   r   r   linksz
                        from setuptools import installer, setup
                        setup(setup_requires='python-xlib==42',
                        dependency_links={dependency_links!r})
                        r  Nz
                        [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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00sW   H7 B8H$	AG>/H$	A
HH$	,H7>H	H$	H!H$	$H4/H77I	c                z   \         P                  ! 4       ;_uu_ 4        \         P                  ! 4       ;_uu_ 4       p\        \        P
                  P                  VR4      RR4       \        P
                  P                  VR4      p\        P                  ! V4       \
        P                  ! R\        R4      RR/VR	7       \        \        P
                  P                  VR4      R
.4       \        P                  ! V4       \        P
                  P                  VR4      p\        P
                  P                  VR4      p\        P                  ! V4       \        VRRR7      ;_uu_ 4       pVP                  \        R4      4       RRR4       VP                  R\!        V4      4       VP                  RR4       VP                  RR4       VP                  RR4       \        VR.4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L-; i  + '       g   i     R# ; i)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  r   a  
                          import setuptools
                          setuptools.setup(
                              name='dep', version='2.0',
                              extras_require={'extra': ['extra_dep']},
                          )
                         rh  r   r  	dist_infor  r   r   r   
                        from setuptools import installer, setup
                        setup(setup_requires='dep[extra]')
                        NPIP_FIND_LINKSr   r  rq  rr  rs  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0!!##x"GGLL+ABKQV '',,x7!

"D% $R #  "'',,w
;k]K%%g.77<<*= "Xz B"-w??2HH @ ""#3S]C"">37""=#6""=#6-+7Y $ 10> @?= $# 100s<   H)D4H	0HA&H	1H)HH	H&!H))H:	c                   \         P                  ! 4       ;_uu_ 4        \         P                  ! 4       ;_uu_ 4       p\        \        P
                  P                  VR4      R\        R4      3RR.4       \        P
                  P                  VR4      p\        P                  ! V4       \
        P                  ! R\        R4      RRR\        R	4      /VR
7       \        \        P
                  P                  VR4      R.4       \        P                  ! V4       \        P
                  P                  VR4      p\        P
                  P                  VR4      p\        P                  ! V4       \        VRRR7      ;_uu_ 4       pVP                  \        R4      4       RRR4       VP                  R\!        V4      4       VP                  RR4       VP                  RR4       VP                  RR4       \        VR.4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L-; i  + '       g   i     R# ; i)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'],
                          )
                          rh  r   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]
                                           ''',
                          )
                         zepcmd.pya  
                                     from distutils.command.build_py import build_py

                                     import extra_dep

                                     class epcmd(build_py):
                                         pass
                                     r  r  r  r   r   r   r  Nr  r   r  rq  rr  rs  epcmdr  )zextra_dep.pyr   )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0!!##xGGLL+AB ' !	 *,* '',,x9!

"D% $R"D)	%!6 #9> "'',,w
;k]K%%g.77<<*= "Xz B"-w??2HH @ ""#3S]C"">37""=#6""=#6-'3Y $ 10~ @?} $# 100s<   IEH.	H#A&H.		IH+&H.	.H>9II	r#   N)r#   r  r  )r  r  )FT)r-   r.   r/   r0   r|  r*  r+  r,  rv  r  rl   r   parametrizer  r  r  r  r  r  r  r  r  r  r1   r2   r3   s   @r   ro  ro  5  s     M<   8M [[_m<7 =7< [[_m<A7 =A7F [[_m<(1 =(1T>:-(-4:#x [[@-P)8 Q)8V38jR4 R4r   ro  c                J    \        V R\        RV: RV: R24      3R.4       R# )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
             )
         Nr  )r   r   )r  r  r  s   &&&r   r  r  D  sK        l #! %
	 	
r   c                   RV9   g   Q hVP                  R4      pV^ ,          p\        ^\        V4      ^,           4       Uu. uF  pRP                  VRV 4      NK  	  pp\	        RV: RV: RV: RV: R2	4      pRpR	V3\
        P                  P                  VR
4      V3.p	VR,           FK  p
\
        P                  P                  ! V
P                  R4      R
.,           !  pV	P                  VR34       KM  	  \        W	4       R# u upi )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  NzE        import setuptools
        setuptools.setup(
            name=z,
            version=z,
            packages=z",
            namespace_packages=[z]
        )
    z7__import__('pkg_resources').declare_namespace(__name__)r   z__init__.py:   NNr   )	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  K  \ "!!* .	
H ED(#bggll9m&Ld%STEB<<77<<'--"4"FHh^$   y + Ks   D
c           
      Z    \        V R \        R4      P                  WVR7      3R.4       R# )r   z                import setuptools
                setuptools.setup(
                  name={name!r},
                  version={version!r},
                  python_requires={python_requires!r},
                )
                )r!   r  python_requiresNr  )r   r   r  )r  r  r  r  s   &&&&r   r  r    sD     	 &!O   !	
r   c                   \        V4      ^8  g   Q h\        P                  ! V R4      ;_uu_ 4       pV F  w  r4\        P                  ! VP                  R4      4      p\        P                  ! VR7      p\        VP                  4       4      Vn        \        \        P                  ! 4       4      Vn        VP                  WeR7       K  	  RRR4       R#   + '       g   i     R# ; i)zy
Create a simple sdist tarball at dist_path, containing the files
listed in ``files`` as ``(filename, content)`` tuples.
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  c           
        \        V4      pRRRRRV RV 2.R\        P                  P                  V 4      ./pV'       d   VP	                  V4       \        P                  P                  V R4      p	\        P                  ! V	4       V'       d   . p
. pV Fq  pVP                  V4      pVRP                  4       9   d   TpMT
p\        V\        \        34      '       d   R	P                  V4      pVP                  V R
V 24       Ks  	  \        R4      P                  RP                  V
4      RP                  V4      R7      pMRp\        \        P                  P                  V	R4      RRR7      ;_uu_ 4       pVP!                  V4       RRR4       Vf   \        R4      p\        \        P                  P                  V	R4      RRR7      ;_uu_ 4       pVP!                  WH,          4       RRR4       \        P                  P                  W RV R24      pV! VW4       V	#   + '       g   i     L; i  + '       g   i     LS; i)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  r  r  r  z==r  zname version;z: zg
            [metadata]
            {metadata}
            [options]
            {options}
            
)optionsmetadatar   rh  r   r   r   NzI            import setuptools
            setuptools.setup(**%r)
        r   -z.tar.gz)r   r]   r   abspathupdater^   r   popr  
isinstancetupler  r   r   r  r   r   )r   r  r  r  setup_py_templater  r  normalized_distnametest_setup_attrsr  r!  r"  r!   valuesectiontest_setup_cfg_contentsr   foobar_paths   &&&&&&&           r   r  r    s   $ %X.
512"WI>?RWW__T23	 ,ww||D*-HHHX !D$((.E~++--"!%%//NNdV2eW-. " #'#
 &IIg&YYx(  
 	  #%	bggll8[13	I	IQ	'( 
J   
 
bggll8Z0#	H	HA	!45 
I '',,t'<AgYg%NOKh0O# 
J	I 
I	Hs   =H*H=*H:	=I	javaz0Test cannot run under java when executable is shr   c                   @   a  ] tR tRt o RtRtR tR tR tR t	Rt
V tR	# )
TestScriptHeaderi  u   /Users/José/bin/pythonz$C:\Program Files\Python36\python.exec                    R \         P                  ! \        P                  P	                  \
        P                  4      4       R2p\         P                  P                  R4      pW!8X  g   Q hR# )#!r   z#!/usr/local/bin/pythonN	r:   nt_quote_argr]   r   normpathr   rU  r@   
get_headerr$   r  r  s   &  r   test_get_script_header'TestScriptHeader.test_get_script_header   sN    (8(8(HIJ"M++,EF!!!r   c                    R \         P                  ! \        P                  P	                  \
        P                  4      4       R2p\         P                  P                  R4      pW!8X  g   Q hR# )r4   -x
z#!/usr/bin/python -xNr5  r9  s   &  r   test_get_script_header_args,TestScriptHeader.test_get_script_header_args  sN    (8(8(HIJ%P++,BC!!!r   c                    \         P                  P                  R V P                  R7      pRV P                   R2pW8X  g   Q hR# )#!/usr/bin/pythonrU  r4  r=  N)r:   r@   r8  non_ascii_exer$   r  r  s   &  r   $test_get_script_header_non_ascii_exe5TestScriptHeader.test_get_script_header_non_ascii_exe
  sI    ++D,>,> , 
 **+51!!!r   c                    \         P                  P                  R RV P                  ,           R,           R7      pRV P                   R2pW8X  g   Q hR# )rA  "rB  #!"z"
N)r:   r@   r8  exe_with_spacesrD  s   &  r   &test_get_script_header_exe_with_spaces7TestScriptHeader.test_get_script_header_exe_with_spaces  sS    ++C$2F2F,F,L , 
 --.c2!!!r   r#   N)r-   r.   r/   r0   rC  rJ  r:  r>  rE  rK  r1   r2   r3   s   @r   r2  r2    s*     
 .M=O"
"
"" "r   r2  c                      a  ] tR tRt o R tR t]P                  ! R]P                  4      ]P                  P                  ]P                  4      R 4       4       tR tV 3R lR ltR	tV tR
# )TestCommandSpeci  c                d    \         P                  ! RR.4      pVP                  4       R8X  g   Q hR# )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                    \         P                  ! R.4      p\         P                  P                  V4      pWJ g   Q hR# )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                    \         P                  P                  R R4       \        P                  P                  4       p\        V4      ^8X  g   Q hVP                  4       P                  R4      '       g   Q hR# )__PYVENV_LAUNCHER__NrI  )	r]   r   r&  r:   r;   r=   r  r>   rD   rQ  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                    \         P                  P                  R4      p\        V4      ^8X  g   Q hRVP	                  4       9  g   Q hR# )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-pythonrH  N)r:   r;   rV  r  r>   rQ  s   & r   "test_from_simple_string_uses_shlex2TestCommandSpec.test_from_simple_string_uses_shlex2  s=    
 nn''(@A3x1}}#--/)))r   c                   < V ^8  d   QhRR/# )r8   returnNr#   )r  r4   s   "r   __annotate__TestCommandSpec.__annotate__;  s      t r   c                &   \         P                  ! \        4      ;_uu_ 4       p\        P                  P                  \        4       4       RRR4       \        XP                  4      R8X  g   Q VP                  4       hR#   + '       g   i     L=; i)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;   rV  objectr   r,  )r$   exc_infos   & r   %test_from_param_raises_expected_error5TestCommandSpec.test_from_param_raises_expected_error;  s_     ]]9%%NN%%fh/ & #VV	>>	V &%s   (B  B	r#   N)r-   r.   r/   r0   rR  rX  r   r  r2  rJ  r  r]   r   r\  r_  ri  r1   r2   r3   s   @r   rN  rN    s_     = 
ZZ "2"B"BC	ZZ__RZZ 1 ! D1* r   rN  c                   &   a  ] tR tRt o R tRtV tR# )TestWindowsScriptWriteriF  c                   \         P                  P                  R 4      pVP                  R4      '       g   Q hVP	                  R4      '       g   Q hVP                  R4      pVP                  R4      pVP                  R4      '       d   Q hR# )r   r4  r   z\"N)r:   WindowsScriptWriterr8  rD   endswithlstriprstrip)r$   hdrs   & r   test_header#TestWindowsScriptWriter.test_headerG  sv    $$//3~~d####||D!!!!jjjj>>%(((((r   r#   N)r-   r.   r/   r0   rs  r1   r2   r3   s   @r   rl  rl  F  s     ) )r   rl  c                   ,   a  ] tR tRt o V 3R ltRtV tR# )VersionStubiQ  c                V   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[;R&   S[ ;R&   # )r8   r  r  microreleaselevelserial)r  r   )r  r4   s   "r   rc  VersionStub.__annotate__Q  s>     J J  J  	 
 K r   r#   N)r-   r.   r/   r0   __annotate_func__r1   r2   r3   s   @r   rv  rv  Q  s      r   rv  c                 ~   \        4       pVP                  R 4      pR.Vn        ^ Vn        RVn        \        V 4      Vn        RVn        VP                  R4      p\        V 4      Vn        RVn        VP                  4       ;_uu_ 4       p\        P                  ! 4       ;_uu_ 4        \        P                  ! R4       Rp\        ^^
^R^ 4      pVP                  RR4       VP                  R	V4       VP                  R
V4       VP                  VR\        P                  ! 4       4       VP!                  4        RRR4       RRR4       \#        \$        R4      '       d   RMRp	VP&                  P)                  4       p
\*        P,                  ! V	R,           V
4      '       d'   \*        P,                  ! V	R,           V
4      '       g   Q hVP.                  R,          R8X  g   Q hVP.                  R,          R8X  g   Q hVP.                  R,          R8X  g   Q hR#   + '       g   i     L; i  + '       g   i     L; i)rY   rW   TNrF  ignorez:3.10.1 (main, Dec 21 2021, 09:17:12) [GCC 10.2.1 20210110]finalr   zsys.versionzsys.version_infocreate_home_pathpypy_version_infopypyrU  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simplefilterrv  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  Y  s    >D


~
.CvCHCLCHv;CC&&y1K#&v;K #'K 					%)@)@)B)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%   	H,'BH	;H,H)$H,,H<	darwinzDhttps://github.com/pypa/setuptools/pull/4716#issuecomment-2447624418c                   VP                  RR4       VP                  R\        VR,          4      4       VP                  R\        VR,          4      4       VP                  R\        VR,          4      4       VP                  RR4       VP                  R	R4       \        \        P
                  ! 4       4      pVP                  R
R
R7       VR,          pVP                  R
R
R7       VP                  R\        V4      4       RpVR,          P                  VRR7       \        VP                  R4      4      . 8X  g   Q h\        VP                  R4      4      . 8X  g   Q h\        RRR.4       \        VP                  R4      4      . 8X  g   Q hVP                  R4       Uu0 uF  qfP                  kK  	  ppVR0,
          pVR08X  g   Q hR# u upi )zC`setup.py develop` should honor `--user` even under build isolationr   FHOMEz.homeUSERPROFILEAPPDATAzsite.USER_BASENzsite.USER_SITET)parentsrE  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   ri  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   %Gr#   )U__doc__r+  r  rB   r   r]   r  rE   r}   rW  r   r  r_   r  r  r   r   typingr   unittestr   rl   jaracor   r   r  r  rY   r:   r   r   r   r	   
setuptoolsr
   setuptools._normalizationr   r   setuptools.distsetuptools.sandboxr   setuptools.testsr   setuptools.tests.serverr   r   r   r   textwrapr   distutils.errorsrn   r   r   r   r   r6   r   filterwarningsr   r   usefixturesr   r3  r5  r@  rB  ro  r  r  r  r   r  r   r   rD   is_shrU  r2  rN  rl  rv  r  r_  r  r#   r   r   <module>r     s     	   	  	   
            , , U U  0 < ( ( * ;    / /  \2 \2~ 01A
 A
 2A
H   ))X
 X
 * *X
v   ,-- - .-
  D" D"NL4 L4^4!!H08& #JZ LLF#@@(@=  " "	":* *Z) )* +8\ LLHQ  9+	9+r   