ó
    F\hÍy  ã                   óF  • 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r	\R                  " \5      r " S S5      r  S\" 5       S.S jjrSS jr\S	:X  a  S
r \" 5         Sr\R,                  " \5        gg! \ a  r\" S\-  \R*                  S9   SrCN3SrCff = f)z›
Virtual environment (venv) package for Python. Based on PEP 405.

Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
é    N)Úpipc                   óÐ   • \ rS rSrSr   S\" 5       S.S jjrS rS rS r	\
S	 5       rS
 rS rSS jrS r\R"                  S:w  a  S rOS rS rS rS rS rS rS rS rSrg)Ú
EnvBuilderé   a   
This class exists to allow virtual environment creation to be
customized. The constructor parameters determine the builder's
behaviour when called upon to create a virtual environment.

By default, the builder makes the system (global) site-packages dir
*un*available to the created environment.

If invoked using the Python -m option, the default is to use copying
on Windows platforms but symlinks elsewhere. If instantiated some
other way, the default is to *not* use symlinks.

:param system_site_packages: If True, the system (global) site-packages
                             dir is available to created environments.
:param clear: If True, delete the contents of the environment directory if
              it already exists, before environment creation.
:param symlinks: If True, attempt to symlink rather than copy files into
                 virtual environment.
:param upgrade: If True, upgrade an existing virtual environment.
:param with_pip: If True, ensure pip is installed in the virtual
                 environment
:param prompt: Alternative terminal prefix for the environment.
:param upgrade_deps: Update the base venv modules to the latest on PyPI
:param scm_ignore_files: Create ignore files for the SCMs specified by the
                         iterable.
N©Úscm_ignore_filesc                ó$  • Xl         X l        X0l        X@l        XPl        X`l        US:X  a2  [        R                  R                  [        R                  " 5       5      nX`l
        Xpl        [        [        [        R                  U5      5      U l        g )NÚ.)Úsystem_site_packagesÚclearÚsymlinksÚupgradeÚwith_pipÚorig_promptÚosÚpathÚbasenameÚgetcwdÚpromptÚupgrade_depsÚ	frozensetÚmapÚstrÚlowerr   )	Úselfr   r   r   r   r   r   r   r   s	            Ú$/usr/lib/python3.13/venv/__init__.pyÚ__init__ÚEnvBuilder.__init__1   si   € ð %9Ô!ØŒ
Ø ŒØŒØ ŒØ!ÔØ�S‹=Ü—W‘W×%Ñ%¤b§i¢i£kÓ2ˆFØŒØ(ÔÜ )¬#¬c¯i©iÐ9IÓ*JÓ KˆÕó    c                 óN  • [         R                  R                  U5      nU R                  U5      nU R                   H  n[        U SU S35      " U5        M     U R                  nSU l        U R                  U5        U R                  U5        U R                  (       a  U R                  U5        U R                  (       d"  U R                  U5        U R                  U5        U(       a  SU l        U R                  U5        U R                  (       a  U R                  U5        gg)zr
Create a virtual environment in a directory.

:param env_dir: The target directory to create an environment in.

Úcreate_Ú_ignore_fileFTN)r   r   ÚabspathÚensure_directoriesr   Úgetattrr   Úcreate_configurationÚsetup_pythonr   Ú
_setup_pipr   Úsetup_scriptsÚ
post_setupr   Úupgrade_dependencies)r   Úenv_dirÚcontextÚscmÚtrue_system_site_packagess        r   ÚcreateÚEnvBuilder.create@   së   € ô —'‘'—/‘/ 'Ó*ˆØ×)Ñ)¨'Ó2ˆØ×(Ô(ˆCÜ�D˜G C 5¨Ð5Ô6°wÖ?ñ )ð %)×$=Ñ$=Ð!Ø$)ˆÔ!Ø×!Ñ! 'Ô*Ø×Ñ˜'Ô"Ø�=�=Ø�O‰O˜GÔ$Ø�|�|Ø×Ñ˜wÔ'Ø�O‰O˜GÔ$Þ$ð )-ˆDÔ%Ø×%Ñ% gÔ.Ø××Ø×%Ñ% gÕ.ð r   c                 ó´  • [         R                  " U5       H¾  n[         R                  R                  X5      n[         R                  R	                  U5      (       d$  [         R                  R                  U5      (       a  [         R                  " U5        M‚  [         R                  R                  U5      (       d  M¨  [        R                  " U5        MÀ     g ©N)
r   Úlistdirr   ÚjoinÚislinkÚisfileÚremoveÚisdirÚshutilÚrmtree)r   r   Úfns      r   Úclear_directoryÚEnvBuilder.clear_directory^   sv   € Ü—*’*˜TÖ"ˆBÜ—‘—‘˜dÓ'ˆBÜ�w‰w�~‰~˜b×!Ñ!¤R§W¡W§^¡^°B×%7Ñ%7Ü—	’	˜"–Ü—‘—‘˜r×"Ó"Ü—’˜bÖ!ò #r   c                 ó<   • UUUUS.n[         R                  " USUS9$ )N)ÚbaseÚplatbaseÚinstalled_baseÚinstalled_platbaseÚvenv)ÚschemeÚvars)Ú	sysconfigÚget_path)r   r,   ÚnamerF   s       r   Ú
_venv_pathÚEnvBuilder._venv_pathf   s,   € àØØ%Ø")ñ	
ˆô ×!Ò! $¨v¸DÑAÐAr   c                 ó  • [         R                  S:X  aÓ  [        R                  R	                  U5      [        R                  R	                  U5      :X  a  gSSKn UR                  [        R                  " U5      5      n UR                  [        R                  " U5      5      n[        R                  R	                  U5      [        R                  R	                  U5      :X  a  ggX:H  $ ! [         a     Nxf = f! [         a     Nbf = f)zÐCheck whether two paths appear the same.

Whether they refer to the same file is irrelevant; we're testing for
whether a human reader would look at the path string and easily tell
that they're the same file.
Úwin32Tr   NF)	ÚsysÚplatformr   r   ÚnormcaseÚ_winapiÚGetLongPathNameÚfsdecodeÚOSError)ÚclsÚpath1Úpath2rQ   s       r   Ú
_same_pathÚEnvBuilder._same_patho   sÕ   € ô �<‰<˜7Ó"Ü�w‰w×Ñ Ó&¬"¯'©'×*:Ñ*:¸5Ó*AÓAØãðØ×/Ñ/´·²¸EÓ0BÓC�ðØ×/Ñ/´·²¸EÓ0BÓC�ô �w‰w×Ñ Ó&¬"¯'©'×*:Ñ*:¸5Ó*AÓAØØà‘>Ð!øô ó Ùðûô ó Ùðús$   Á%C, Â%C< Ã,
C9Ã8C9Ã<
D	ÄD	c                 óD  • S n[         R                  [         R                  " U5      ;   a   [        SU S[         R                   S35      e[         R                  R                  U5      (       a"  U R                  (       a  U R                  U5        [        R                  " 5       nXl
        [         R                  R                  U5      S   Ul        U R                  b  U R                  OUR                  Ul        U" U5        [        R                  nU(       d  [        S5      e[         R                  R                  [         R                  R!                  U5      5      u  pV[        R"                  S:X  a@  [         R                  R%                  U5      S   R'                  S	5      (       a  S	OS
nSU S3nXCl        XSl        Xcl        U R/                  US5      nU R/                  US5      n	U R/                  US5      n
X“l        U" U	5        X£l        U" U
5        [        R4                  S:”  aƒ  [         R6                  S:X  ao  [        R"                  S:w  a[  [         R                  R9                  US5      n[         R                  R                  U5      (       d  [         R:                  " SU5        Xƒl        [         R                  R?                  X�5      Ul         [         R                  R9                  X†5      Ul!        U" U5        URB                  Ul"        [        R"                  S:X  ap  [         R                  RG                  URB                  5      nU RI                  XÃRB                  5      (       d'  [J        RM                  SURB                  U5        XÃl"        U$ )zŠ
Create the directories for the environment.

Returns a context object which holds paths in the environment,
for use by subsequent logic.
c                 ó&  • [         R                  R                  U 5      (       d  [         R                  " U 5        g [         R                  R	                  U 5      (       d$  [         R                  R                  U 5      (       a  [        SU -  5      eg )NzUnable to create directory %r)r   r   ÚexistsÚmakedirsr6   r7   Ú
ValueError)Úds    r   Úcreate_if_neededÚ7EnvBuilder.ensure_directories.<locals>.create_if_needed’   s[   € Ü—7‘7—>‘> !×$Ñ$Ü—’˜A•Ü—‘—‘ ×"Ñ"¤b§g¡g§n¡n°Q×&7Ñ&7Ü Ð!@À1Ñ!DÓEÐEð '8r   zRefusing to create a venv in z( because it contains the PATH separator r
   é   z“Unable to determine path to the running Python interpreter. Provide an explicit path or check that your PATH environment variable is correctly set.rM   r   Ú_dÚ Úpythonú.exeÚscriptsÚincludeÚpurelibl        ÚposixÚdarwinÚlib64Úlibz†Actual environment location may have moved due to redirects, links or junctions.
  Requested location: "%s"
  Actual location:    "%s")'r   ÚpathsepÚfspathr^   r   r\   r   r=   ÚtypesÚSimpleNamespacer,   ÚsplitÚenv_namer   rN   Ú_base_executabler#   rO   ÚsplitextÚendswithÚ
executableÚ
python_dirÚ
python_exerJ   Úinc_pathÚlib_pathÚmaxsizerI   r5   ÚsymlinkÚbin_pathÚrelpathÚbin_nameÚenv_exeÚenv_exec_cmdÚrealpathrX   ÚloggerÚwarning)r   r,   r`   r-   rw   ÚdirnameÚexenamerc   ÚbinpathÚincpathÚlibpathÚ	link_pathÚreal_env_exes                r   r$   ÚEnvBuilder.ensure_directoriesŠ   s¬  € ò	Fô �:‰:œŸš 7Ó+Ó+ÜÐ<¸W¸Ið F?Ü?A¿z¹z¸lÈ!ðMó Nð Nä�7‰7�>‰>˜'×"Ñ" t§z§zØ× Ñ  Ô)Ü×'Ò'Ó)ˆØ!ŒÜŸ7™7Ÿ=™=¨Ó1°!Ñ4ˆÔØ(,¯©Ñ(?˜ŸšÀW×EUÑEUˆŒÙ˜Ô!Ü×)Ñ)ˆ
ÞÜð .ó /ð /ô Ÿ7™7Ÿ=™=¬¯©¯©¸Ó)DÓEÑˆÜ�<‰<˜7Ó"ô Ÿ™×)Ñ)¨'Ó2°1Ñ5×>Ñ>¸t×DÑD‘È"ˆBØ˜r˜d $Ð'ˆGØ'ÔØ$ÔØ$ÔØ—/‘/ '¨9Ó5ˆØ—/‘/ '¨9Ó5ˆØ—/‘/ '¨9Ó5ˆà"ÔÙ˜Ô!Ø"ÔÙ˜Ô!ä�[‰[˜5Ó ¤r§w¡w°'Ó'9Ü�\‰\˜XÓ%ÜŸ™Ÿ™ W¨gÓ6ˆIÜ—7‘7—>‘> )×,Ñ,Ü—
’
˜5 )Ô,Ø"ÔÜŸ7™7Ÿ?™?¨7Ó<ˆÔÜŸ'™'Ÿ,™, wÓ8ˆŒÙ˜Ô!ð  'Ÿ™ˆÔÜ�<‰<˜7Ó"ô Ÿ7™7×+Ñ+¨G¯O©OÓ<ˆLØ—?‘? <·±×AÑAÜ—‘ð  <ð  'Ÿ™°ô	>ð
 (4Ô$Øˆr   c                 óÄ  • [         R                  R                  UR                  S5      =Ul        n[        USSS9 nUR                  SUR                  -  5        U R                  (       a  SnOSnUR                  SU-  5        UR                  S	[        R                  S
S -  5        U R                  b   UR                  SU R                  < S35        UR                  S[         R                  R                  [        R                  5      -  5        / n[         R                  S:H  nU(       a"  U R                  (       a  UR!                  S5        U(       d"  U R                  (       d  UR!                  S5        U R"                  (       d  UR!                  S5        U R                  (       a  UR!                  S5        U R$                  (       a  UR!                  S5        U R&                  (       a  UR!                  S5        U R(                  (       a  UR!                  S5        U R*                  b  UR!                  SU R*                   S35        U R,                  (       d  UR!                  S5        UR!                  UR                  5        SR                  U5      nUR                  S[        R                   SU S35        S
S
S
5        g
! , (       d  f       g
= f)a  
Create a configuration file indicating where the environment's Python
was copied from, and whether the system site-packages should be made
available in the environment.

:param context: The information for the environment creation request
                being processed.
z
pyvenv.cfgÚwúutf-8©Úencodingz
home = %s
ÚtrueÚfalsez"include-system-site-packages = %s
zversion = %d.%d.%d
Né   z	prompt = Ú
zexecutable = %s
Úntú
--symlinksú--copiesú--without-pipú--system-site-packagesú--clearú	--upgradeú--upgrade-depsz
--prompt="Ú"ú--without-scm-ignore-filesÚ z
command = z	 -m venv )r   r   r5   r,   Úcfg_pathÚopenÚwriterx   r   rN   Úversion_infor   rƒ   rw   rI   r   Úappendr   r   r   r   r   r   )r   r-   r   ÚfÚinclÚargsr—   s          r   r&   ÚEnvBuilder.create_configurationÓ   sþ  € ô #%§'¡'§,¡,¨w¯©ÀÓ"MÐMˆÔ˜4Ü�$˜ gÒ.°!Ø�G‰G�M G×$6Ñ$6Ñ6Ô7Ø×(×(Ø‘à�Ø�G‰GÐ9¸DÑ@ÔAØ�G‰GÐ*¬S×-=Ñ-=¸b¸qÐ-AÑAÔBØ�{‰{Ñ&Ø—‘˜) D§K¡K¡?°"Ð5Ô6Ø�G‰GÐ'¬"¯'©'×*:Ñ*:¼3¿>¹>Ó*JÑJÔKØˆDÜ—‘˜D‘ˆBÞ�d—m—mØ—‘˜LÔ)Þ˜dŸmŸmØ—‘˜JÔ'Ø—=—=Ø—‘˜OÔ,Ø×(×(Ø—‘Ð4Ô5Ø�z�zØ—‘˜IÔ&Ø�|�|Ø—‘˜KÔ(Ø× × Ø—‘Ð,Ô-Ø×ÑÑ+Ø—‘˜j¨×)9Ñ)9Ð(:¸!Ð<Ô=Ø×(×(Ø—‘Ð8Ô9à�K‰K˜Ÿ™Ô(Ø—8‘8˜D“>ˆDØ�G‰G�j¤§¡Ð 0°	¸$¸¸rÐBÔC÷E /×.Ö.ús   ½JKË
Kc                 ó^  • [         R                  S:w  d   eU R                  (       + nU(       d¹   [         R                  R	                  U5      (       d”  U(       aw  [         R                  R                  U5      [         R                  R                  U5      :X  d   e[         R                  " [         R                  R                  U5      U5        O[         R                  " X5        U(       a  [        R                  " X5        gg! [         a    [        R                  SX5        Sn NCf = f)z·
Try symlinking a file, and if that fails, fall back to copying.
(Unused on Windows, because we can't just copy a failed symlink file: we
switch to a different set of files instead.)
r—   úUnable to symlink %r to %rTN)r   rI   r   r   r6   r†   r}   r   Ú	Exceptionr„   r…   r:   Úcopyfile)r   ÚsrcÚdstÚrelative_symlinks_okÚ
force_copys        r   Úsymlink_or_copyÚEnvBuilder.symlink_or_copy  sÊ   € ô �w‰w˜$‹ÐˆØŸ™Ô&ˆ
Þð	"Ü—w‘w—~‘~ c×*Ñ*Þ+Ü!Ÿw™wŸ™¨sÓ3´r·w±w·±ÀsÓ7KÓKÐKÐKÜŸ
š
¤2§7¡7×#3Ñ#3°CÓ#8¸#Õ>äŸ
š
 3Ô,ö Ü�OŠO˜CÕ%ð øô ó "Ü—‘Ð;¸SÔFØ!’
ð"ús   °B!D ÃD Ä"D,Ä+D,c                 óæ   • [         R                  R                  UR                  S5      n[	        USSS9 nUR                  S5        UR                  S5        SSS5        g! , (       d  f       g= f)z�
Create a .gitignore file in the environment directory.

The contents of the file cause the entire environment directory to be
ignored by git.
z
.gitignorer�   r�   r‘   zC# Created by venv; see https://docs.python.org/3/library/venv.html
z*
N)r   r   r5   r,   r£   r¤   )r   r-   Úgitignore_pathÚfiles       r   Úcreate_git_ignore_fileÚ!EnvBuilder.create_git_ignore_file  sU   € ô Ÿ™Ÿ™ g§o¡o°|ÓDˆÜ�. #°Ò8¸DØ�J‰Jð Kô Là�J‰J�uÔ÷ 9×8Ö8ús   ¶#A"Á"
A0r—   c                 óh  • UR                   nUR                  nU R                  nUR                  nU" UR                  U5        [
        R                  R                  U5      (       d  [
        R                  " US5        SSS[        R                  S    34 H—  n[
        R                  R                  X&5      n[
        R                  R                  U5      (       a  MH  U" UR                  USS9  [
        R                  R                  U5      (       a  M€  [
        R                  " US5        M™     g)	ú—
Set up a Python executable in the environment.

:param context: The information for the environment creation request
                being processed.
ií  re   Úpython3zpython3.rb   T)r±   N)r~   r�   r³   rx   rw   r   r   r6   ÚchmodrN   r¥   r5   r\   )r   r-   rˆ   r   Úcopierr†   Úsuffixs          r   r'   ÚEnvBuilder.setup_python%  sÞ   € ð ×&Ñ&ˆGØ—?‘?ˆDØ×)Ñ)ˆFØ×(Ñ(ˆGÙ�7×%Ñ% tÔ,Ü—7‘7—>‘> $×'Ñ'Ü—’˜˜uÔ%Ø# YØ%¤c×&6Ñ&6°qÑ&9Ð%:Ð;ó=�ä—w‘w—|‘| GÓ4�Ü—w‘w—~‘~ d×+Ó+ñ ˜7Ÿ?™?¨DÀtÒLÜŸ7™7Ÿ>™>¨$×/Ó/ÜŸš  uÖ-ò=r   c                 óª  • UR                   nUR                  n[        R                  R	                  UR
                  5      n[        R                  R                  U5      S   n[        R                  R                  U5      R                  S5      (       a  SOSn[        R                  " 5       (       a  UnOB[        R                  R                  [        R                  R                  [        5      SS5      n[        R                  " S5      (       d¶  [        R                  R                  USU S35      n[        R                  R                  US	U S35      n	S
USU S3USU	S	U S3U	0n
[        R                  R                  USU S35      n[        R                  R                  USU S35      n	S
USU S3USU	S	U S3U	0nGOS[        R                   S    S3n[        R                  R                  USU U S35      n[        R                  R                  US	U U S35      n	S
USU S3USU S3USU U S3USU	S	U S3U	S	U S3U	S	U U S3U	0n
[        R                  R                  USU S35      n[        R                  R                  USU S35      n	S
USU S3USU S3USU U S3USU	S	U S3U	S	U S3U	S	U U S3U	0nSnU R"                  (       Ga5  SnU
R%                  [        R&                  " U5       Vs0 s H�  n[        R                  R                  U5      R)                  S5      (       d  M8  [        R                  R                  [        R                  R                  U5      S   5      S:X  d  M}  U[        R                  R                  X>5      _MŸ     sn5        / nU
R+                  5        HO  u  nn[        R                  R                  UU5      n [        R,                  " UU5        UR/                  U5        MQ     U(       aR  UR+                  5        H>  u  nn[        R                  R                  UU5      n [8        R:                  " UU5        M@     [        R                  " 5       (       Ga  [        R<                  " UR                  5       Hê  u  nnnSU;   d  M  [        R                  R	                  U5      n[        R                  R                  UR>                  SU5      n[        R                  RA                  U5      (       d  [        RB                  " U5        [        R                  R                  US5      n[        R                  R                  US5      n[8        RD                  " UU5          g   ggs  snf ! [0         a{    [2        R5                  SUU5        SnU HA  n [        R6                  " U5        M  ! [0         a    [2        R5                  SU5         M?  f = f   [2        R5                  S5           GM  f = f! [0         a    [2        R5                  SUU5         GM  f = f)r»   r   rc   rd   rg   r—   ÚPy_GIL_DISABLEDre   rf   Úpythonwz
python.exezpythonw.exeÚvenvlauncherÚvenvwlauncherz3.rb   ÚtÚvenvlaunchertÚvenvwlaunchertTF)re   Ú	vcruntimez.dllr¬   zFailed to clean up symlink %rzRetrying with copieszUnable to copy %r to %rzinit.tclÚLibN)#r~   rx   r   r   r   r�   ru   rP   rv   rG   Úis_python_buildr5   r†   Ú__file__Úget_config_varrN   r¥   r   Úupdater4   Ú
startswithÚitemsr}   r¦   rT   r„   r…   Úunlinkr:   Úcopy2Úwalkr,   r\   r]   r®   )r   r-   rˆ   r†   r‡   Úexe_stemÚexe_drg   ry   Úpythonw_exeÚlink_sourcesÚcopy_sourcesÚexe_tÚ	do_copiesr§   Ú	to_unlinkÚdestr¯   ÚrootÚdirsÚfilesÚtcldirr°   s                          r   r'   rÀ   >  s¨  € ð ×&Ñ&ˆGØ×(Ñ(ˆGÜ—g‘g×&Ñ& w§¡Ó7ˆGÜ—w‘w×'Ñ'¨Ó0°Ñ3ˆHÜŸG™G×,Ñ,¨XÓ6×?Ñ?À×EÑE‘DÈ2ˆEÜ×(Ò(×*Ñ*Ø!‘äŸ'™'Ÿ,™,¤r§w¡w§¡´xÓ'@Ø'0°$ó8�ä×+Ò+Ð,=×>Ñ>ÜŸW™WŸ\™\¨'°V¸E¸7À$Ð3GÓH�
Ü Ÿg™gŸl™l¨7°g¸e¸WÀDÐ4IÓJ�à  *Ø˜U˜G 4Ð(¨*Ø! ;Ø˜e˜W DÐ)¨;ð	 �ô  ŸW™WŸ\™\¨'°\À%ÀÈÐ3MÓN�
Ü Ÿg™gŸl™l¨7°mÀEÀ7È$Ð4OÓP�à  *Ø˜U˜G 4Ð(¨*Ø! ;Ø˜e˜W DÐ)¨;ð	 ’ð œS×-Ñ-¨aÑ0Ð1°Ð3�ÜŸW™WŸ\™\¨'°V¸E¸7À5À'ÈÐ3NÓO�
Ü Ÿg™gŸl™l¨7°g¸e¸WÀUÀGÈ4Ð4PÓQ�à  *Ø˜U˜G 4Ð(¨*Ø˜U˜G 4Ð(¨*Ø˜U˜G E 7¨$Ð/°Ø! ;Ø˜e˜W DÐ)¨;Ø˜e˜W DÐ)¨;Ø˜e˜W U G¨4Ð0°+ð	 �ô  ŸW™WŸ\™\¨'°]À5À'ÈÐ3NÓO�
Ü Ÿg™gŸl™l¨7°nÀUÀGÈ4Ð4PÓQ�à  *Ø˜U˜G 4Ð(¨*Ø˜U˜G 4Ð(¨*Ø˜U˜G E 7¨$Ð/°Ø! ;Ø˜e˜W DÐ)¨;Ø˜e˜W DÐ)¨;Ø˜e˜W U G¨4Ð0°+ð	 �ð ˆIØ�}�}ˆ}Ø!�	ð ×#Ñ#Ü9;¿ºÀGÔ9Ló%Ú9L°AÜ—w‘w×'Ñ'¨Ó*×5Ñ5Ð6M×Nó 0äŸ™×(Ñ(¬¯©×)9Ñ)9¸!Ó)<¸QÑ)?Ó@ÀFÑJó 0�A”r—w‘w—|‘| GÓ/Ò/Ñ9Lñ%ô ð �	Ø!-×!3Ñ!3Ö!5‘I�D˜#ÜŸ7™7Ÿ<™<¨°Ó6�DðÜŸ
š
 3¨Ô-Ø!×(Ñ(¨Ö.ñ	 "6ö" Ø!-×!3Ñ!3Ö!5‘I�D˜#ÜŸ7™7Ÿ<™<¨°Ó6�DðMÜŸš S¨$Ö/ñ "6ô ×(Ò(×*Ò*ä)+¯ª°×1CÑ1CÖ)DÑ%�D˜$ Ø! UÕ*Ü!#§¡×!1Ñ!1°$Ó!7˜Ü!#§¡§¡¨g¯o©o¸uÀfÓ!M˜Ü!Ÿw™wŸ~™~¨f×5Ñ5ÜŸKšK¨Ô/Ü Ÿg™gŸl™l¨4°Ó<˜Ü Ÿg™gŸl™l¨6°:Ó>˜ÜŸš¨¨SÔ1Ùò *Eð +ùòA%øô #ó 
ÜŸ™Ð'CÀSÈ$ÔOØ$(˜	Û!*˜Að2Ü "§	¢	¨!¦øÜ#*ó 2Ü &§¡Ð/NØ/0÷!2ð2úñ "+ô Ÿ™Ð'=Ô>Üð
ûô" #ó MÜŸ™Ð'@À#Àt×LÐLðMús[   Ì7VÍAVÎ$VÏ/(V$ÑX,Ö$(X)×W%×#X)×% X		ØX)ØX		Ø	X)Ø(X)Ø,!YÙYc                 ó8  • UR                   /UQn[        R                  R                  5       =US'   nUR                  US'   UR                  SS5        UR                  SS5        UR                  US'   UR                   US'   [        R                  " U40 UD6  g)z8Executes the newly created Python using safe-ish optionsÚenvÚVIRTUAL_ENVÚ
PYTHONHOMENÚ
PYTHONPATHÚcwdrw   )r‚   r   ÚenvironÚcopyr,   ÚpopÚ
subprocessÚcheck_output)r   r-   Úpy_argsÚkwargsr©   râ   s         r   Ú_call_new_pythonÚEnvBuilder._call_new_python­  sŠ   € ð ×$Ñ$Ð/ wÐ/ˆÜ Ÿj™jŸo™oÓ/Ð/ˆˆu‰˜Ø$Ÿ_™_ˆˆMÑØ�‰�˜dÔ#Ø�‰�˜dÔ#ØŸ™ˆˆu‰Ø&×3Ñ3ˆˆ|ÑÜ×Ò Ñ/¨Ó/r   c           	      óš  •  U R                  USSSS[        R                  S9  g
! [        R                   a‘  n[        R
                  " S5      n[        R                  R                  U S35      (       dN  [        SR                  [        R                  " 5       UR                  5      5        [        R                  " S	5        e S
nAff = f)z1Installs or upgrades pip in a virtual environmentú-mÚ	ensurepipr�   z--default-pip)ÚstderrÚstdlibz/ensurepip/__main__.pyan  The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python{}-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: {}
rb   N)rî   rê   ÚSTDOUTÚCalledProcessErrorrG   rH   r   r   r\   ÚprintÚformatÚget_python_versionr‚   rN   Úexit)r   r-   Úerrrô   s       r   r(   ÚEnvBuilder._setup_pip¼  sª   € ð	Ø×!Ñ! '¨4°¸kØ"1¼*×:KÑ:Kð "ò Møä×,Ñ,ó 	Ü×'Ò'¨Ó1ˆFÜ—7‘7—>‘> V HÐ,BÐ"C×DÑDÜð ÷ �FŒ9×'Ò'Ó)¨7×+?Ñ+?Ó@ôBô —’˜”Øûð!	ús   ‚"% ¥C
¹BCÃC
c                 óæ   • [         R                  R                  [         R                  R                  [        5      5      n[         R                  R                  US5      nU R                  X5        g)a—  
Set up scripts into the created environment from a directory.

This method installs the default scripts into the environment
being created. You can prevent the default installation by overriding
this method if you really need to, or if you need to specify
a different location for the scripts to install. By default, the
'scripts' directory in the venv package is used as the source of
scripts to install.
rg   N)r   r   r#   r†   rÌ   r5   Úinstall_scripts)r   r-   r   s      r   r)   ÚEnvBuilder.setup_scriptsÓ  sE   € ô �w‰w�‰œrŸw™wŸ™¬xÓ8Ó9ˆÜ�w‰w�|‰|˜D )Ó,ˆØ×Ñ˜WÕ+r   c                 ó   • g)zõ
Hook for post-setup modification of the venv. Subclasses may install
additional packages or scripts here, add activation shell scripts, etc.

:param context: The information for the environment creation request
                being processed.
N© ©r   r-   s     r   r*   ÚEnvBuilder.post_setupâ  s   € ð 	r   c                 óö  • UR                   UR                  UR                  UR                  UR                  S.nS nS n[
        R                  nUR                  nUR                  S5      (       a  UnO)UR                  S5      (       a  UnO[
        R                  nUR                  5        VV	s0 s H  u  p‰X†" U	5      _M     nnn	UR                  5        H  u  pŠUR                  XŠ5      nM     U$ s  sn	nf )a1  
Replace variable placeholders in script text with context-specific
variables.

Return the text passed in , but with variables replaced.

:param text: The text in which to replace placeholder variables.
:param context: The information for the environment creation request
                being processed.
)Ú__VENV_DIR__Ú__VENV_NAME__Ú__VENV_PROMPT__Ú__VENV_BIN_NAME__Ú__VENV_PYTHON__c                 ó2   • U R                  SS5      n SU  S3$ )aƒ  
This should satisfy PowerShell quoting rules [1], unless the quoted
string is passed directly to Windows native commands [2].
[1]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules
[2]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing#passing-arguments-that-contain-quote-characters
Ú'z'')Úreplace©Úss    r   Ú	quote_ps1Ú/EnvBuilder.replace_variables.<locals>.quote_ps1ÿ  s!   € ð —	‘	˜#˜tÓ$ˆAØ�q�c˜�8ˆOr   c                 ó   • U $ r3   r  r  s    r   Ú	quote_batÚ/EnvBuilder.replace_variables.<locals>.quote_bat	  s   € ØˆHr   z.ps1z.bat)r,   rs   r   r€   r�   ÚshlexÚquoteÚscript_pathrv   rÐ   r  )r   Útextr-   Úreplacementsr  r  r  r  Úkeyr  Úquoteds              r   Úreplace_variablesÚEnvBuilder.replace_variablesì  sà   € ð $ŸO™OØ$×-Ñ-Ø&Ÿ~™~Ø!(×!1Ñ!1Ø&Ÿ™ñ
ˆò	ò	ô —‘ˆØ×)Ñ)ˆØ×Ñ ×'Ñ'Ø‰EØ×!Ñ! &×)Ñ)Ø‰Eô —K‘KˆEà4@×4FÑ4FÔ4HÔIÒ4H©&¨#˜˜U 1›XšÑ4HˆÑIØ'×-Ñ-Ö/‰KˆCØ—<‘< Ó,ŠDñ 0àˆùó Js   Â2C5c                 ó~  • UR                   n[        U5      n[        R                  S:X  a  S nOS n[        R                  " U5       GH  u  pgnXb:X  a7  USS  H,  n	U	S[        R                  4;  d  M  UR                  U	5        M.     MC  U GHÔ  n
U" U
5      (       a  M  [        R                  R                  Xj5      nXdS R                  [        R                  5      SS nU(       d  UnO![        R                  R                  " U/UQ76 n[        R                  R                  U5      (       d  [        R                  " U5        [        R                  R                  XÚ5      n[        R                  S:X  a/  UR                  S5      (       a  [        R                  " X¾5        GM  [        US5       n
U
R!                  5       nSSS5         X±l        U R%                  WR'                  S	5      U5      R)                  S	5      nUU:X  a  [        R                  " X¾5        GM˜  [        US5       n
U
R1                  U5        SSS5        [        R2                  " X¾5        GM×     GM!     g! , (       d  f       N«= f! [*         a#  n[,        R/                  S
UU5         SnAGM  SnAff = f! , (       d  f       Np= f)a#  
Install scripts into the created environment from a directory.

:param context: The information for the environment creation request
                being processed.
:param path:    Absolute pathname of a directory containing script.
                Scripts in the 'common' subdirectory of this directory,
                and those in the directory named for the platform
                being run on, are installed in the created environment.
                Placeholder variables are replaced with environment-
                specific values.
r—   c                 ó’   • [         R                  R                  U 5      n U R                  S5      =(       a    U R	                  S5      $ )N)re   rD   ©rf   z.pdb)r   r   rP   rÏ   rv   ©r§   s    r   Ú	skip_fileÚ-EnvBuilder.install_scripts.<locals>.skip_file,  s:   € Ü—G‘G×$Ñ$ QÓ'�ØŸ™Ð%7Ó8÷ 9ØŸJ™JÐ'7Ó8ð:r   c                 ó   • g)NFr  r   s    r   r!  r"  1  s   € Ør   NÚcommoné   r  Úrbr�   z+unable to copy script %r, may be binary: %sÚwb)r~   Úlenr   rI   rÓ   r8   r   r5   rr   Úsepr\   r]   rv   r:   rÒ   r£   Úreadr  r  ÚdecodeÚencodeÚUnicodeErrorr„   r…   r¤   Úcopymode)r   r-   r   rˆ   Úplenr!  rÝ   rÞ   rß   r_   r§   Úsrcfiler¿   ÚdstdirÚdstfileÚdataÚnew_dataÚes                     r   rþ   ÚEnvBuilder.install_scripts  s  € ð ×"Ñ"ˆÜ�4‹yˆÜ�7‰7�d‹?ó:ò
ä!#§¢¨§ÑˆD˜Ø‹|Ø™a›�AØ ¬2¯7©7Ð 3Õ3ØŸ™ Ažñ !ñ Ü�Ù˜Q—<‘<ÙÜŸ'™'Ÿ,™, tÓ/�Ø˜e˜×*Ñ*¬2¯6©6Ó2°1°2Ð6�ÞØ$‘FäŸW™WŸ\š\¨'Ð;°FÒ;�FÜ—w‘w—~‘~ f×-Ñ-Ü—K’K Ô'ÜŸ'™'Ÿ,™, vÓ1�Ü—7‘7˜d“? w×'7Ñ'7Ð8H×'IÑ'IÜ—L’L Ô2ÚÜ˜' 4Ô(¨AØŸ6™6›8�D÷ )ð	Ø*1Ô'à×.Ñ.¨t¯{©{¸7Ó/CÀWÓMß#™V G›_ð ð ˜tÓ#Ü—L’L ×2ä˜g tÔ,°ØŸ™ Ô)÷ -ä—O’O G×5ôA ò "/÷* )Õ(ûô $ó Ü—N‘Nð $7Ø8?ÀôDæûðú÷ -Õ,ús0   Æ7I-Ç6I>È2J.É-
I;É>
J+ÊJ&Ê&J+Ê.
J<c                 óŒ   • [         R                  S[         SUR                   35        U R                  " USSSS/[        Q76   g )Nz
Upgrading z packages in rñ   r   Úinstallr�   )r„   ÚdebugÚCORE_VENV_DEPSr~   rî   r  s     r   r+   ÚEnvBuilder.upgrade_dependencies[  sH   € Ü�‰ØœÐ(¨°g×6FÑ6FÐ5GÐHô	
ð 	×Ò˜g t¨U°I¸{ð 	/Ü-ô	/r   )	r   r   r   r   r   r   r   r   r   )FFFFFNF)F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r0   r=   rJ   ÚclassmethodrX   r$   r&   r³   r¸   r   rI   r'   rî   r(   r)   r*   r  rþ   r+   Ú__static_attributes__r  r   r   r   r      s�   † ñð6 :?ØGKØ#ðLá9B»öLò/ò<"òBð ñ"ó ð"ò4GòR,Dô\&ò,ð 
‡w�w�$ƒó	.ò2m	ò^0òò.,òò.ò`=6õ~/r   r   r   c          
      ó@   • [        UX#UXVUS9nUR                  U 5        g)z,Create a virtual environment in a directory.)r   r   r   r   r   r   r   N)r   r0   )	r,   r   r   r   r   r   r   r   Úbuilders	            r   r0   r0   c  s*   € ô Ð.BØ$À(Ø &Ø*:ñ<€Gð ‡N�N�7Õr   c                 óÞ  • SS K nUR                  [        SSS9nUR                  SSSSS	9  UR                  S
SSSSS9  [        R
                  S:X  a  SnOSnUR                  5       nUR                  SUSSSS9  UR                  SU(       + SSSS9  UR                  SSSSSS9  UR                  SSSSSS9  UR                  SSSSS S!9  UR                  S"S#S$9  UR                  S%SSS&S'S(R                  [        5       S)3S9  UR                  S*S+S,[        5       [        S-/5      S.S/9  UR                  U 5      nUR                  (       a  UR                  (       a  [        S05      e[        UR                  UR                  UR                   UR                  UR"                  UR$                  UR&                  UR(                  S19nUR*                   H  nUR-                  U5        M     g )2Nr   zFCreates virtual Python environments in one or more target directories.z|Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory.)ÚprogÚdescriptionÚepilogrÞ   ÚENV_DIRÚ+z)A directory to create the environment in.)ÚmetavarÚnargsÚhelpr›   FÚ
store_trueÚsystem_sitezDGive the virtual environment access to the system site-packages dir.)ÚdefaultÚactionrÜ   rM  r—   Tr˜   r   z[Try to use symlinks rather than copies, when symlinks are not the default for the platform.r™   Ústore_falsez\Try to use copies rather than symlinks, even when symlinks are the default for the platform.rœ   r   zcDelete the contents of the environment directory if it already exists, before environment creation.r�   r   zlUpgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place.rš   r   z]Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default))rÜ   rP  rQ  rM  z--promptz;Provides an alternative prompt prefix for this environment.)rM  rž   r   zUpgrade core dependencies (z, z) to the latest version in PyPIr    r   Ústore_constÚgitzYSkips adding SCM ignore files to the environment directory (Git is supported by default).)rÜ   rQ  ÚconstrP  rM  z1you cannot supply --upgrade and --clear together.)r   r   r   r   r   r   r   r   )ÚargparseÚArgumentParserr<  Úadd_argumentr   rI   Úadd_mutually_exclusive_groupr5   r:  r   Ú
parse_argsr   r   r^   r   rO  r   r   r   r   r   rÞ   r0   )r©   rV  ÚparserÚuse_symlinksÚgroupÚoptionsrD  r_   s           r   Úmainr_  n  s`  € Ûà×$Ñ$¬(ð2@ð-Dð %ð 	E€Fð ×Ñ˜¨	¸ØHð ñ Jà
×ÑÐ0¸%Ø+°-ð9ð ñ :ô 
‡w�w�$ƒØ‰àˆØ×/Ñ/Ó1€EØ	×Ñ�|¨\Ø*°ð,ð ñ -ð
 
×Ñ�z¨|Ô+;Ø+°*ð,ð ñ -ð
 ×Ñ˜	¨5¸Ø$ð ,Cð ñ Dð
 ×Ñ˜¨U¸<Ø&ð .Kð ñ Lð
 ×Ñ˜¨jØ $¨]ð+ð ñ ,ð
 ×Ñ˜
ð1ð ñ 2ð ×ÑÐ(°%ÀØ+Ø:¸4¿9¹9Ä^Ó;TÐ:Uð V=ð =ð ñ >ð ×ÑÐ4Ð;MØ,´I³KÜ )¨5¨'Ó 2ðHð ñ Ið
 ×Ñ Ó%€GØ‡‡˜7Ÿ=Ÿ=ÜÐLÓMÐMÜ¨g×.AÑ.AØ&Ÿ}™}Ø")×"2Ñ"2Ø!(§¡Ø")×"2Ñ"2Ø '§¡Ø&-×&:Ñ&:Ø*1×*BÑ*BñD€Gð �\Œ\ˆØ�‰�qÖò r   Ú__main__rb   z	Error: %s)r·   )FFFFNFr3   )r@  Úloggingr   r:   rê   rN   rG   rp   r  r:  Ú	getLoggerr<  r„   r   r   r0   r_  Úrcr­   r5  r÷   ró   rú   r  r   r   Ú<module>rd     sº   ðñó Û 	Û Û Û 
Û Û Û ð €Ø	×	Ò	˜8Ó	$€÷K	/ñ K	/ð\ 7<ØEJðá(›{öôIðX ˆzÓØ	
€Bð0ÙŒØˆð ‡H‚HˆR…Lð øð
 ó 0Ùˆk˜A‰o C§J¡J×/ûð0ús   Á	A< Á<B ÂBÂB 