관리-도구
편집 파일: rust.cpython-38.pyc
U ,�e^ � @ st d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dlmZ d dlm Z d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d lmZ d d lmZ d dlmZ d dlmZ d d lmZ dZejZ ej!Z"ej#dd�dd�dd��Z$ddd�dd�Z%dddd�dd�Z&ej'dddd�dd ��Z(dd!d"d#�d$d%�Z)ddd"d&�d'd(�Z*ddd)d"d*�d+d,�Z+dS )-� )�annotationsN)� Generator)�Sequence)� lang_base)� parse_shebang)� envcontext)�PatchesT)�Var)�Prefix)�cmd_output_b)�make_executable)�win_exeZrustenv� )�maxsize�str)�returnc C s$ t dddd�d dkrdS tjS d S )N�cargo� --versionF)�checkr �system)r �C�DEFAULT� r r �G/opt/hc_python/lib/python3.8/site-packages/pre_commit/languages/rust.py�get_default_version s r )�language_versionr c C s | t jkrdS | S dS )z=Transform the language version into a rust toolchain version.ZstableN)r r )r r r r �_rust_toolchain+ s r r )� target_dir�versionr c C s: dt j�| d�t jtd�fff|dkr4dt|�ffnd�S )N�PATH�binr ZRUSTUP_TOOLCHAINr )�os�path�join�pathsepr r )r r r r r � get_env_patch3 s ���r% r zGenerator[(None, None, None)])�prefixr r c c s2 t �| t|�}tt||��� d V W 5 Q R X d S )N)r �environment_dir�ENVIRONMENT_DIRr r% )r&