File: //opt/saltstack/salt/lib/python3.10/site-packages/relenv/__pycache__/create.cpython-310.pyc
o
;j� � @ s d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl m
Z
ddlmZm
Z
mZmZmZmZ ddlmZmZmZ e
rLddlZddlmZ ejd+d
d��ZG dd� de�Zd,dd�Z d-d.dd�Zd/d!d"�Zd0d#d$�Zd0d%d&�Z d1d)d*�Z!dS )2z
The ``relenv create`` command.
� )�annotationsN)�
TYPE_CHECKING� )�RelenvException�arches�archived_build�
build_arch�format_shebang�relative_interpreter)�get_default_python_version�python_versions�resolve_python_version)�Iterator�path�str | os.PathLike[str]�return�Iterator[None]c c s8 � t �� }zt �| � dV W t �|� dS t �|� w )z�
Context manager that changes to the specified directory and back.
:param path: The path to temporarily change to
:type path: str
N)�os�getcwd�chdir)r �cwd� r �A/opt/saltstack/salt/lib/python3.10/site-packages/relenv/create.pyr $ s �
r c @ s e Zd ZdZdS )�CreateExceptionzJ
Raised when there is an issue creating a new relenv environment.
N)�__name__�
__module__�__qualname__�__doc__r r r r r 4 s r �
subparsers�3argparse._SubParsersAction[argparse.ArgumentParser]�Nonec C s` | j ddd�}|jtd� |jddd� |jdt� ttj td d
� t � }|jd|tdd
� dS )z�
Setup the subparser for the ``create`` command.
:param subparsers: The subparsers object returned from ``add_subparsers``
:type subparsers: argparse._SubParsersAction
�createzrCreate a Relenv environment. This will create a directory of the given name with newly created Relenv environment.)�description)�func�namez#The name of the directory to create)�helpz--archz,The host architecture [default: %(default)s])�default�choices�typer% z--pythonz>The python version (e.g., 3.10, 3.14.4) [default: %(default)s])r&