Viewing File: /opt/hc_python/lib/python3.12/site-packages/pre_commit/languages/__pycache__/dotnet.cpython-312.pyc

�

i0i�
��P�ddlmZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
mZddlmZddlmZddlmZdd	lmZd
ZdZej.Zej2Zej6Zdd�Zej<dd
��Zej<dd��Z 								dd�Z!y)�)�annotationsN)�	Generator)�Sequence)�	lang_base)�
envcontext)�PatchesT)�Var)�Prefix�	dotnetenv�binc��dtjj|t�tjtd�fffS)N�PATH)�os�path�join�BIN_DIR�pathsepr	)�venvs �J/opt/hc_python/lib/python3.12/site-packages/pre_commit/languages/dotnet.py�
get_env_patchrs2��	�"�'�'�,�,�t�W�-�r�z�z�3�v�;�G�H���c#�K�tj|t|�}tt	|��5d��ddd�y#1swYyxYw�w)N)r�environment_dir�ENVIRONMENT_DIRrr)�prefix�version�envdirs   r�in_envr s5����
�
&�
&�v���
H�F�	�M�&�)�	*�
�
+�	*�	*�s�0A�A�	A�A	�Ac#�
K�tj�5}tjj	|d�}t|d�5}|j
d�ddd�|��ddd�y#1swY�xYw#1swYyxYw�w)Nznuget.config�wzw<?xml version="1.0" encoding="utf-8"?><configuration>  <packageSources>    <clear />  </packageSources></configuration>)�tempfile�TemporaryDirectoryrrr�open�write)�tmpdir�nuget_config�fs   r�_nuget_config_no_sourcesr('si����	�	$�	$�	&�&��w�w�|�|�F�N�;��
�,��
$��
�G�G�#�
�%���
'�	&�
$�
$��
'�	&�s4�B�-A7�A+�A7�"	B�+A4	�0A7�7B�<Bc���tjd|�tjd|�tj|t|�}|jd�}tj|dddddd|��f�|j|�}tj|�D�cgc]}|jd�s�|��}}|std	��|D�]i}tjtj
j||��5}	d
�|	j�D�\}
|	j|
�5}t j"j$j'|�}ddd�ddd�t)j*dj-�j.�}
|
std��|j1d
|
d�d��}|�td��|j2}|std��t5�5}tj|dddd|dtj
j|t6�d||f
�ddd���lycc}w#1swY��xYw#1swY��xYw#1swY���xYw)N�dotnetzpre-commit-build�packz--configuration�Releasez
--propertyzPackageOutputPath=z.nupkgz+could not find any build outputs to installc3�DK�|]}|jd�s�|���y�w)z.nuspecN)�endswith)�.0�xs  r�	<genexpr>z&install_environment.<locals>.<genexpr>Ts����H�,�Q�!�*�*�Y�2G�q�,�s� � z{.*}z%could not parse namespace from nuspecz.//r�idz expected to find an "id" elementz"id" element missing tool name�tool�installz--configfilez--tool-pathz--add-source)r�assert_version_default�assert_no_additional_depsrrr�	setup_cmdr�listdirr.�AssertionError�zipfile�ZipFiler�namelistr#�xml�etree�ElementTree�parse�re�match�getroot�tag�find�textr(r)rr�additional_dependenciesr�	build_dir�	nupkg_dirr0�nupkgs�nupkgr'�nuspec�spec�tree�	namespace�tool_id_element�tool_idr&s                 r�install_environmentrR7s��
�$�$�X�w�7�
�'�'��2I�J�
�
&�
&�v���
H�F����.�/�I������f��y��.�y�k�:�	
�����I�&�I����I�.�
G�.�A�!�*�*�X�2F�a�.�F�
G���J�K�K���
�_�_�R�W�W�\�\�)�U�;�
<��H�!�*�*�,�H�G�F������4��y�y�,�,�2�2�4�8�� �=�
�H�H�W�d�l�l�n�&8�&8�9�	�� �!H�I�I��)�)�c�)�A�,��r�$:�;���"� �!C�D�D�!�&�&��� �!A�B�B�&�
'�<������f�i�"�L�!�2�7�7�<�<���#@�"�I���	
�(�
'�'��H� ���=�
<��$(�
'�s=� H:�7H:�+I�.*H?�I�+AI�?I�I�I	�I!	)r�str�returnr)rr
rrSrTzGenerator[None])rTzGenerator[str])rr
rrSrGz
Sequence[str]rT�None)"�
__future__r�
contextlib�os.pathrrAr!�xml.etree.ElementTreer=r:�collections.abcrr�
pre_commitr�pre_commit.envcontextrrr	�pre_commit.prefixr
rr�basic_get_default_version�get_default_version�basic_health_check�health_check�basic_run_hook�run_hookr�contextmanagerrr(rR�rr�<module>rfs���"���	����%�$� �,�*�%�$���
���9�9���+�+���#�#���������������8��8��8�"/�8�
�	8r
Back to Directory File Manager