관리-도구
편집 파일: primer.cpython-311.pyc
� �܋f� � � � d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl m Z d dlmZ d dl mZ d dlmZ G d � d � � ZdS )� )�annotationsN)�Path)� PackageToLint)� PrimerCommand)�CompareCommand)�PrepareCommand)� RunCommandc �R � e Zd ZdZdd�Zdd�Zedd�� � Zedd�� � ZdS )�Primerz)Main class to handle priming of packages.�primer_directoryr � json_path�return�Nonec � � || _ t j d�� � | _ | j � dd�� � | _ | j � d� � }|� ddd d �� � |� dd d d �� � |� ddd d �� � |� ddd d �� � | j � d� � }|� dddgdd�� � | j � d� � }|� ddd�� � |� ddd�� � |� ddd�� � | j � � � | _ | � |� � | _ | j j dk rt }n/| j j dk rt }n| j j dk rt } || j | j | j � � | _ d S ) Nz Pylint Primer)�prog�commandT)�dest�required�preparez--clonezClone all packages.� store_trueF)�help�action�defaultz--checkz0Check consistencies and commits of all packages.z--make-commit-stringzGet latest commit string.z--read-commit-stringzPrint latest commit string.�runz--type�main�przType of primer run.)�choicesr r �comparez--base-filez(Location of output file of the base run.)r r z --new-filez'Location of output file of the new run.z--commitz+Commit hash of the PR commit being checked.)r �argparse�ArgumentParser�_argument_parser�add_subparsers�_subparsers� add_parser�add_argument� parse_args�config�_get_packages_to_lint_from_json�packagesr r r r )�selfr r �prepare_parser� run_parser�compare_parser� command_classs �p/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/testutils/_primer/primer.py�__init__zPrimer.__init__ sk � � 0��� (� 7�_� M� M� M����0�?�?��T� @� � ��� �)�4�4�Y�?�?���#�#��1�,�PU� $� � � � �#�#��C��� $� � � � �#�#�"�,��� $� � � � �#�#�"�.��� $� � � � �%�0�0��7�7� �����v�t�n�t�BW� � � � � �)�4�4�Y�?�?���#�#���;� $� � � � �#�#���:� $� � � � �#�#���>� $� � � � �+�6�6�8�8����<�<�Y�G�G�� �$��;��)�+�+�1?�M�M� �[� �E� )� )�&�M�M� �[� �I� -� -�*�M�$�}�T�%:�D�M�4�;�W�W����� c �8 � | j � � � d S �N)r r )r* s r/ r z Primer.run\ s � ���������r1 �package_data�dict[str, str]�boolc � � | � dd � � }|sdS t d� |� d� � D � � � � }|t j d d� k S )N�minimum_pythonTc 3 �4 K � | ]}t |� � V � �d S r3 )�int)�.0�ns r/ � <genexpr>z3Primer._minimum_python_supported.<locals>.<genexpr>d s( � � � � K� K�A��Q��� K� K� K� K� K� Kr1 �.� )�get�tuple�split�sys�version_info)r4 �min_python_str�min_python_tuples r/ �_minimum_python_supportedz Primer._minimum_python_supported_ sg � �%�)�)�*:�D�A�A��� ��4� � K� K��1E�1E�c�1J�1J� K� K� K�K�K���3�#3�B�Q�B�#7�7�7r1 �dict[str, PackageToLint]c � � t | d�� � 5 }d� t j |� � � � � D � � cd d d � � S # 1 swxY w Y d S )N�utf8)�encodingc �b � i | ],\ }}t � |� � �|t d i |����-S )� )r rG r )r; �namer4 s r/ � <dictcomp>z:Primer._get_packages_to_lint_from_json.<locals>.<dictcomp>j sP � � � � �&�D�,��3�3�L�A�A���m�3�3�l�3�3�� � r1 )�open�json�load�items)r �fs r/ r( z&Primer._get_packages_to_lint_from_jsong s� � � �)�f� -� -� -� ��� �*.�)�A�,�,�*<�*<�*>�*>�� � � � � � � � � � � � � � ���� � � � � � s �0A�A�AN)r r r r r r )r r )r4 r5 r r6 )r r r rH ) �__name__� __module__�__qualname__�__doc__r0 r �staticmethodrG r( rM r1 r/ r r s� � � � � � �3�3�DX� DX� DX� DX�L� � � � �8� 8� 8� �\�8� �� � � �\�� � r1 r )� __future__r r rQ rC �pathlibr �pylint.testutils._primerr �'pylint.testutils._primer.primer_commandr �/pylint.testutils._primer.primer_compare_commandr �/pylint.testutils._primer.primer_prepare_commandr �+pylint.testutils._primer.primer_run_commandr r rM r1 r/ �<module>ra s� �� #� "� "� "� "� "� ���� ���� � � � � � � � � � � 2� 2� 2� 2� 2� 2� A� A� A� A� A� A� J� J� J� J� J� J� J� J� J� J� J� J� B� B� B� B� B� B�[� [� [� [� [� [� [� [� [� [r1