
    -Ph2              
         d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm	Z	 d dl
Z
ddlmZ ddlmZmZ dd	lmZmZ d#dZ e
j        d           e
j        dddd           e
j        ddddd           e
j        dddde          d$d                                                Zd%d!Zed"k    r e             dS dS )&    )annotationsN)CalledProcessError)	Container)warn   )find_fragments)get_remote_branches%list_changed_files_compared_to_branch)config_option_helpload_config_from_optionsbranchesContainer[str]return
str | Nonec                L    d| v rdS d| v rt          dt          d           dS d S )Nzorigin/mainzorigin/masterzfUsing "origin/master" as default compare branch is deprecated and will be removed in a future version.   )
stacklevel)r   DeprecationWarning)r   s    O/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/towncrier/check.py_get_default_compare_branchr      sK      }(""7		
 	
 	
 	
 4    check)namez--compare-withBRANCHz|Checks files changed running git diff --name-only BRANCH... BRANCH is the branch to be compared with. Default to origin/main)defaultmetavarhelpz--dir	directoryPATHz:Check fragment in directory. Default to current directory.z--configconfig	FILE_PATHcompare_withNonec                (    t          | ||           dS )z.
    Check for new fragments on a branch.
    N)__main)r"   r   r    s      r   _mainr&   #   s    : <F+++++r   comparewithconfig_pathc                (   t          ||          \  }}| t          t          |                    } | (t          j        d           t          j        d           	 t          ||           }n@# t          $ r3}t          j        d           t          j        |j	                    d }~ww xY w|s,t          j        d|  d           t          j        d           d |D             }t          j        d	           t          j        d
           t          |d          D ]\  }}	t          j        | d|	            t          j        d
           t          ||d          d         }
t          j                            t          j                            ||j                            }||v r(t          j        d           t          j        d           t#                      }t#                      }|
D ]C\  }}|j        |         d         r|                    |           .|                    |           D||z  }|sv||z  }|rEt          j        d           t          |d          D ]\  }}t          j        | d|            nt          j        d           t          j        d           d S t          j        d           t          |d          D ]\  }}t          j        | d|            t          j        d           d S )N)base_directoryz*Could not detect default branch. Aborting.r   z"git produced output while failing:zOn z2 branch, or no diffs, so no newsfragment required.r   c                L    h | ]!}t           j                            |          "S  )ospathabspath).0r.   s     r   	<setcomp>z__main.<locals>.<setcomp>`   s&    ===tRW__T""===r   zLooking at these files:z----)startz. T)strictz+Checks SKIPPED: news file changes detected.r   z5Found newsfragments of unchecked types in the branch:z*No new newsfragments found on this branch.zFound:)r   r   r	   clickechosysexitr
   r   output	enumerater   r-   r.   normpathjoinfilenamesettypesadd)r'   r   r(   r*   r    files_changedefilesnchangeall_fragment_files	news_file	fragmentsunchecked_fragmentsfragment_filenamecategoryfragments_in_branchunchecked_fragments_in_branchfragments                      r   r%   r%   C   s_    6iMMNF1~>>>
 
 
?@@@=K
 
    
7888
18
  
Q+QQQ	
 	
 	
 	==}===E	J()))	JvuA... % %	6
a##6##$$$$	Jv (tLLLQO  nfo!N!NOOIE
@AAAI%%'9 7 7#8<!'* 	7MM+,,,,##$56666#e+ (;e(C% 	EJNOOO()FaPPP / /8
a--8--..../ JCDDD
8$%8BBB 	+ 	+KAxJ!))x))****s   A/ /
B,9.B''B,__main__)r   r   r   r   )r"   r   r   r   r    r   r   r#   )r'   r   r   r   r(   r   r   r#   )
__future__r   r-   r6   
subprocessr   typingr   warningsr   r4   _builderr   _gitr	   r
   	_settingsr   r   r   commandoptionr&   r%   __name__r,   r   r   <module>rY      s  
 # " " " " " 				 



 ) ) ) ) ) )              $ $ $ $ $ $ L L L L L L L L C C C C C C C C    G	!	 	 	 	E   	  , , ,  	 	 2,C C C CL z	EGGGGG r   