HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/relenv/build/__pycache__/__init__.cpython-310.pyc
o

;j�@s�dZddlmZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
mZmZdd	lmZmZmZdd
l	mZerNddlZddlmZmZddd�Zddd�Zddd�ZdS)z4
Entry points for the ``relenv build`` CLI command.
�)�annotationsN)�
TYPE_CHECKING�)�
build_arch)�Version�get_default_python_version�python_versions�resolve_python_version�)�darwin�linux�windows)�builds)�	FrameType�
ModuleType�returnrcCs:tjdkrtStjdkrtStjdkrtStdtj����)z:
    Return the right module based on `sys.platform`.
    rr�win32�Unsupported platform: )�sys�platformrrr
�RuntimeError�rr�I/opt/saltstack/salt/lib/python3.10/site-packages/relenv/build/__init__.py�platform_modules


r�
subparsers�3argparse._SubParsersAction[argparse.ArgumentParser]�NonecCs�t�}|jddd�}|jtd�|jdt�|jtdd�|jdd	d
dd�t�}|jd
|tdd�|jdd	d
dd�|jdd	d
dd�|jdd	d
dd�|jddddgdd�|jdd	d
dd�|jdd	d
dd�|jd d!d"d#d$�d%S)&z�
    Setup the subparser for the ``build`` command.

    :param subparsers: The subparsers object returned from ``add_subparsers``
    :type subparsers: argparse._SubParsersAction
    �buildz,Build Relenv Python Environments from source)�description)�funcz--archz,The host architecture [default: %(default)s])�default�choices�type�helpz--cleanF�
store_truezfClean up before running the build. This option will remove the logs, src, build, and previous tarball.)r �actionr#z--pythonz>The python version (e.g., 3.10, 3.14.4) [default: %(default)s])r r"r#z--no-cleanupz�By default the build directory is removed after the build tarball is created. Setting this option will leave the build directory in place.z--force-downloadz4Force downloading source tarballs even if they existz--download-onlyz&Stop after downloading source tarballsz--step�stepsZSTEP�appendz�A step to run alone, can use multiple of this argument. When this option is used to invoke builds, depenencies of the steps are ignored.  This option should be used with care, as it's easy to request a situation that has no chance of being succesful. )�dest�metavarr%r r#z--no-prettyzELog build output to stdout instead of displaying a simplified status.z--compact-prettyz>Use compact UI without progress bars (simpler, less detailed).z--log-level�warning)�errorr*�info�debugz2Log level determines how verbose the logs will be.)r r!r#N)	r�
add_parser�set_defaults�main�add_argumentrZARCHES�strr)r�modZbuild_subparserZdefault_versionrrr�setup_parser,s�	�������
��
�r4�args�argparse.NamespacecCs�t��t�d�tj���t_t�d�tj���t_tjt	j	vr-t
dtj���t�d�zt|j
�}Wn2tyf}z&t
d|���t�}d�dd�|D��}t
d|���t�d�WYd	}~nd	}~wwt|�}t�}t
d
|���t	j	tj}t|�|_t|�|j_t|�|jdd_|||jdd_|�|j�|j|jkr�t
d
�d	}|jr�dd�|jD�}|jr�d}d}	nd}|j}	ddd�}
t�tj|
�|||j|j|j |j!|j"||j#�$�|	d�	d	S)z�
    The entrypoint to the ``build`` command.

    :param args: The arguments to the command
    :type args: ``argparse.Namespace``
    zutf-8rr
zError: �
cSsg|]}t|��qSr)r2��.0�_rrr�
<listcomp>��zmain.<locals>.<listcomp>zKnown versions are:
Nz
Build Python �python�downloadzVWarning: Cross compilation support is experimental and is not fully tested or working!cSsg|]}|���qSr)�stripr8rrrr;�r<FT�_signal�int�frame�FrameType | NonerrcSst�d�dS)Nr
)r�exit)r@rBrrr�signal_handler�szmain.<locals>.signal_handler)	r&�arch�cleanZcleanup�force_download�
download_only�show_ui�	log_level�expanded_ui)r@rArBrCrr)%�random�seed�codecs�	getwriterr�stdout�detach�stderrrr�printrDr	r=rr�joinrr2�version�dirsZrecipiesZchecksumZset_archrFrr&Z	no_prettyZcompact_pretty�signal�SIGINTrGZ
no_cleanuprHrIrK�upper)r5Zbuild_version_str�e�
pyversionsZstrversionsZ
build_versionrr&rJrLrErrrr0�s`
��


�r0)rr)rrrr)r5r6rr)�__doc__�
__future__rrOrMrXr�typingr�commonrr\rrrr	�rrr
r�argparse�typesrrrr4r0rrrr�<module>s"


^