§
!A?hÓf ã ó: — d Z ddlZddlZddlZddlZddlZddlZddlZddlZdZ ej
e¦ « Z G d„ d¦ « Z
d
d„Zdd„Zed k rId
Z e¦ « dZn'# e$ rZ edez ej ¬¦ « Y dZ[ndZ[ww xY w ej e¦ « dS dS )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)ÚpipÚ
setuptoolsc ó– — e Zd ZdZ dd„Zd„ Zd„ Zd„ Zd„ Zd „ Z e
j d
k rdd„Zndd„Zd
„ Z
d„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )Ú
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
FNc óâ — || _ || _ || _ || _ || _ || _ |dk r0t j t
j ¦ « ¦ « }|| _
|| _ d S )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 ú:/opt/alt/python-internal/lib64/python3.11/venv/__init__.pyÚ__init__zEnvBuilder.__init__/ si € ð %9ˆÔ!؈Œ
Ø ˆŒ
؈ŒØ ˆŒ
Ø!ˆÔØ�SŠ=ˆ=Ý”W×%Ò%¥b¤i¡k¤kÑ2Ô2ˆF؈ŒØ(ˆÔÐÐó c óð — t j |¦ « }| |¦ « }| j }d| _ | |¦ « | |¦ « | j r| |¦ « | j s*|
|¦ « | |¦ « |rd| _ | |¦ « | j r|
|¦ « dS dS )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Ô2ˆð %)Ô$=Ð!Ø$)ˆÔ!Ø×!Ò! 'Ñ*Ô*Ð*Ø×Ò˜'Ñ"Ô"Ð"ØŒ=ð %Ø�OŠO˜GÑ$Ô$Ð$ØŒ|ð %Ø×Ò˜wÑ'Ô'Ð'Ø�OŠO˜GÑ$Ô$Ð$Ø$ð /ð )-ˆDÔ%Ø×%Ò% gÑ.Ô.Ð.ØÔð /Ø×%Ò% gÑ.Ô.Ð.Ð.Ð.ð /ð /r c ó€ — t j |¦ « D ]¨}t j ||¦ « }t j |¦ « st j |¦ « rt j |¦ « Œut j |¦ « rt j |¦ « Œ©d S ©N)
r Úlistdirr ÚjoinÚislinkÚisfileÚremoveÚisdirÚshutilÚrmtree)r r Úfns r Úclear_directoryzEnvBuilder.clear_directoryY s› € Ý”*˜TÑ"Ô"ð "ð "ˆBÝ”—’˜d BÑ'Ô'ˆBÝŒw�~Š~˜bÑ!Ô!ð
"¥R¤W§^¢^°BÑ%7Ô%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" Únamer9 s r Ú
_venv_pathzEnvBuilder._venv_patha s4 € àØØ%Ø")ð
ð
ˆõ Ô! $¨v¸DÐAÑAÔAÐAr c ó˜ — d„ }t j t j |¦ « v r t d|› dt j › d�¦ « ‚t j |¦ « r| j r| |¦ « t j ¦ « }||_
t j |¦ « d |_ | j
�| j
n|j }d|z |_
||¦ « t j }|st d¦ « ‚t j t j |¦ « ¦ « \ }}||_ ||_ ||_ | |d ¦ « }| |d
¦ « } | |d¦ « }
| |_ || ¦ « ||
¦ « t j dk rtt j d
k rdt j dk rTt j |d¦ « }t j |¦ « st j d|¦ « ||_ t j ||¦ « |_ t j ||¦ « |_ ||¦ « |j |_ t j dk r‘t j |j ¦ « }t j ! |¦ « t j ! |j ¦ « k r(tD # 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 | ¦ « st j | ¦ « d S t j | ¦ « st j | ¦ « rt
d| z ¦ « ‚d S )NzUnable to create directory %r)r r ÚexistsÚmakedirsr* r+ Ú
ValueError)Úds r Úcreate_if_neededz7EnvBuilder.ensure_directories.