Ë
c‡½j~h ã ó2 — d Z ddlZddlZddlZddlZddlZddlZddlZddlZdZ ej e« Z G d„ d« Z
dd„Zd
d„Zedk( rd Z e« dZ ej* e« yy# e$ r!Z ed
ez ej( ¬« Y dZ[Œ5dZ[ww xY w)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 ó¬ — e Zd ZdZ dd„Zd„ Zd„ Zd„ Zed„ « Z d„ Z
d „ Zej d
k7 rdd„Zndd„Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)Ú
EnvBuilderaâ
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
Nc óà — || _ || _ || _ || _ || _ || _ |dk( r1t j j t
j « « }|| _
|| _ y )NÚ.)Úsystem_site_packagesÚclearÚsymlinksÚupgradeÚwith_pipÚorig_promptÚosÚpathÚbasenameÚgetcwdÚpromptÚupgrade_deps)Úselfr r r
r r r r s ú&/usr/lib64/python3.12/venv/__init__.pyÚ__init__zEnvBuilder.__init__/ s` € ð %9ˆÔ!؈Œ
Ø ˆŒ
؈ŒØ ˆŒ
Ø!ˆÔØ�SŠ=Ü—W‘W×%Ñ%¤b§i¡i£kÓ2ˆF؈ŒØ(ˆÕó c óÔ — t j j |« }| j |« }| j }d| _ | j |« | j
|« | j r| j |« | j s"| j |« | j |« |rd| _ | j |« | j r| j |« yy)zŠ
Create a virtual environment in a directory.
:param env_dir: The target directory to create an environment in.
FTN)r r ÚabspathÚensure_directoriesr Úcreate_configurationÚsetup_pythonr Ú
_setup_pipr Ú
setup_scriptsÚ
post_setupr Úupgrade_dependencies)r Úenv_dirÚcontextÚtrue_system_site_packagess r ÚcreatezEnvBuilder.create= sà € ô —'‘'—/‘/ 'Ó*ˆØ×)Ñ)¨'Ó2ˆð %)×$=Ñ$=Ð!Ø$)ˆÔ!Ø×!Ñ! 'Ô*Ø×ј'Ô"Ø�=Š=Ø�O‰O˜GÔ$Ø�|Š|Ø×јwÔ'Ø�O‰O˜GÔ$Ù$ð )-ˆDÔ%Ø×%Ñ% gÔ.Ø×ÒØ×%Ñ% gÕ.ð r c óŠ — t j |« D ]« }t j j ||« }t j j |« st j j |« rt j |« Œwt j j |« sŒ—t j |« Œ y ©N)
r Úlistdirr ÚjoinÚislinkÚisfileÚremoveÚisdirÚshutilÚrmtree)r r Úfns r Úclear_directoryzEnvBuilder.clear_directoryY so € Ü—*‘*˜TÖ"ˆBÜ—‘—‘˜d BÓ'ˆBÜ�w‰w�~‰~˜bÔ!¤R§W¡W§^¡^°BÔ%7Ü— ‘ ˜"•
Ü—‘—‘˜rÕ"Ü—
‘
˜bÕ!ñ #r c ó@ — ||||dœ}t j |d|¬« S )N)ÚbaseÚplatbaseÚinstalled_baseÚinstalled_platbaseÚvenv)ÚschemeÚvars)Ú sysconfigÚget_path)r r! Únamer8 s r Ú
_venv_pathzEnvBuilder._venv_patha s, € àØØ%Ø")ñ
ˆô ×!Ñ! $¨v¸DÔAÐAr c ó — t j dk( rÏt j j |« t j j |« k( ryddl} |j
t j |« « } |j
t j |« « }t j j |« t j j |« k( ryy||k( S # t $ r Y Œvw xY w# t $ r Y Œ`w xY w)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Úpath2rB s r Ú
_same_pathzEnvBuilder._same_pathj s× € ô �<‰<˜7Ò"Ü�w‰w×Ñ Ó&¬"¯'©'×*:Ñ*:¸5Ó*AÒAØãð
Ø×/Ñ/´·±¸EÓ0BÓC�ð
Ø×/Ñ/´·±¸EÓ0BÓC�ô �w‰w×Ñ Ó&¬"¯'©'×*:Ñ*:¸5Ó*AÒAØØà˜E‘>Ð!øô ò
Ùð
ûô ò
Ùð
ús$ Á$C( Á>$C7 Ã( C4Ã3C4Ã7 DÄDc óx — d„ }t j t j |« v r t d|› dt j › d�« ‚t j j |« r| j r| j |« t j « }||_
t j j |« d |_ | j �| j n|j }d|z |_
||« t j }|st d« ‚t j j t j j! |« « \ }}||_ ||_ ||_ | j) |d« }| j) |d « } | j) |d
« }
| |_ || « |
|_ ||
« t j. dkD r{t j0 dk( rht j2 d
k7 rUt j j5 |d« }t j j |« st j6 d|« ||_ t j j; ||« |_ t j j5 ||« |_ ||« |j> |_ t j2 dk( rmt j jC |j> « }| jE ||j> « s(tF jI d|j> |« ||_ |S )zª
Create the directories for the environment.
Returns a context object which holds paths in the environment,
for use by subsequent logic.
c ó — t j j | « st j | « y t j j | « st j j | « rt
d| z « ‚y )NzUnable to create directory %r)r r ÚexistsÚmakedirsr) r* Ú
ValueError)Úds r Úcreate_if_neededz7EnvBuilder.ensure_directories.