
    ^jun                        d Z ddlZddlZddlZddlZddlmZ ddlm	Z	 ddl
mZmZ ddlmZmZmZmZmZmZ ddlmZmZmZmZmZmZmZ ded	efd
Zdddeded	dfdZded	e e   fdZ!d.deded	e e   fdZ" G d d      Z#dedee   ded	ee e      fdZ$de%d	efdZ&d/dddedee   ded	dfdZ'	 	 	 d0dddedededee e      d	e(f
d Z)	 	 	 	 d1dddedee   dededee e      d	e(fd!Z*	 	 	 d0dddedededee e      d	e(f
d"Z+	 	 	 	 d1dedee   deded	e(f
d#Z,	 	 	 	 	 	 d2dddedee   ded$ed%ed&ee   dee e      d	e(fd'Z-d(ed)e(f   d	ed*   fd+Z.d3d,Z/d3d-Z0y)4u  CLI entry point for pyDeprecate validation.

Provides two entry points for scanning Python code for misconfigured ``@deprecated`` wrappers:

- ``pydeprecate <subcommand> <path>`` — console script installed via ``pip install 'pyDeprecate[cli]'``
- ``python -m deprecate <subcommand> <path>`` — module invocation of the same CLI

Subcommands:
    check   — Validate wrapper configuration and flag misconfigured or chain-forming wrappers.
    expiry  — Check for deprecated wrappers that have passed their scheduled ``remove_in`` deadline.
    chains  — Detect deprecated wrappers whose ``target`` is itself a deprecated callable.
    all     — Run all three checks in a single scan pass.
    status  — Render a markdown deprecation table to stdout (and optionally save it to a file).

    N)Callable)Path)AnyOptional)_auto_detect_version_find_child_packages_is_package_dir_managed_sys_path_resolve_module_name_safe_module_name)DeprecationWrapperInfo
TableStyle_check_expiry_for_callablesfind_deprecation_wrappersgenerate_deprecation_tablevalidate_deprecation_chainsvalidate_deprecation_expirynamereturnc                 D    t         j                  j                  |       duS )zBReturn True if *name* is importable without actually importing it.N)	importlibutil	find_specr   s    Y/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/deprecate/_cli.py_is_package_availabler   ,   s    >>##D)55    Fstderrmsgr   c                    t         j                  r(t         j                  |      j                  | dd       y|rt        j
                  nt        j                  }t        | |       y)aN  Print a message, using Rich console when available.

    Routes output through :class:`~rich.console.Console` when the ``rich``
    package is installed, falling back to built-in :func:`print` otherwise.

    Args:
        msg: The message to print.
        stderr: If ``True``, send the message to *stderr* instead of *stdout*.

    F)markup	highlight)fileN)	_Reporter	_HAS_RICH_consoleprintsysr   stdout)r    r   std_s      r   _printr,   1   sH     6"((Ue(L#szzcr   pathc                    t        |       j                         g }t        j                  dd }t        j                  dd t        _        	 t	        j                         d       D ]f  }|j                         r*|j                  dk(  r|j                  j                  d      r>|j                  }	 |j                  t        |d             h 	 |t        _        t!        fdj#                  d      D              }|rt        dd       |S # t        $ r t        d	| d
d       Y t        $ r}t        d| d| d       Y d}~d}~ww xY w# |t        _        w xY w)aQ  Scan a plain directory of top-level Python files.

    Nested Python files in subdirectories are skipped unless they are part of an importable package layout. Plain
    directories do not generally support dotted imports for nested modules, so this function only scans top-level
    modules and warns when deeper files are present.

    N   c                     | j                   S Nr   )ents    r   <lambda>z!_scan_directory.<locals>.<lambda>Q   s
     r   )keyz.py__F	recursivez	Skipping z1: module-level code exited (not a library module)Tr   zCould not scan : c              3   v   K   | ]0  }|j                   k7  s|j                  j                  d         2 yw)r5   N)parentr   
startswith).0fpyabs_paths     r   	<genexpr>z"_scan_directory.<locals>.<genexpr>^   s4      **-3::YaKaCHH%%*s   9!9z*.pyzSkipping nested Python files in plain directory scan. Use an importable package layout with '__init__.py' files, or scan an importable module/package path instead.)r   resolver)   argvsortediterdiris_filesuffixr   r;   stemextendr   
SystemExitr,   	Exceptionanyrglob)r-   resultsoriginal_argventrymodule_nameenested_python_files_foundr>   s          @r   _scan_directoryrR   C   sK    $Z'')H,.GHHQKMxx|CH!H,,.4HI 		JEMMO(=ejjF[F[\`Fa$zzKJ8PUVW		J !&) *191G* ' !I	

 N#  p;-/`ajno JRs;DIIJ !sC   A&E 4DE E,E .E6E	E EE E#r7   c                 |   t        |       }|j                         rvt        |      r.t        t        |       j	                         j
                  |      S t        |      }t        |      dk(  rt        t        |d         |      S t        |       S |j                         rt        d| d      t        | |      S )zScan a directory or importable module/package name for deprecated wrappers.

    File paths are not accepted because ``find_deprecation_wrappers()`` expects an importable module or package name,
    not a filesystem path.

    r6   r/   r   zFile paths are not supported: z@. Pass an importable module/package name or a directory instead.)r   is_dirr	   r   r@   r   r   len
_scan_pathstrrR   rD   
ValueError)r-   r7   pth
child_pkgss       r   rV   rV   k   s     T
C
zz|3,T$Z-?-?-A-F-FR[\\)#.
z?ac*Q-0IFFt$$
{{},TH4tu
 	
 %TY??r   c                      e Zd ZU  ed      Zeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed<   	 dd	lmZ dd
lmZ ddlmZ eZ
eZ e       Z ed      Z	ed(dedefd       Zedededededef
d       Zedededededeeedf      deddfd       Zedee   ddfd       Zedee   ddfd       Zedee   ddfd       Z edddee   d eddfd!       Z!ed"ee   ddfd#       Z"edd$d%ee   d&edefd'       Z#y# e$ r Y w xY w))r%   richr&   N_out_err	_rich_box
_RichTabler   )box)Console)TableTr   Fr   r   c                 F    | rt         j                  S t         j                  S )z7Return the Rich Console for stdout (default) or stderr.)r%   r^   r]   r   s    r   r'   z_Reporter._console   s     "(y~~;Y^^;r   titlecoltitle_style	col_stylec                    t         j                  | t         j                  j                  |      }|j	                  dd       |j	                  dd       |j	                  ||       |S )z6Build a three-column Module/Function/<col> Rich table.re   ra   rg   ModulecyanstyleFunctionmagenta)r%   r`   r_   ROUNDED
add_column)re   rf   rg   rh   tables        r   _make_tablez_Reporter._make_table   sf     $$5i6I6I6Q6Q_j$k095I.r   rows.plain_prefixc          	      $   t         j                  rSt         j                  | |||      }|D ]  } |j                  |   t         j	                         j                  |       yt        d|        |D ]  \  }}	}
t        d| d|	 d|
         y)zLRender a three-column Module/Function/Detail table (rich or plain fallback).)rg   rh   
	- .r8   N)r%   r&   rt   add_rowr'   r(   r,   )re   rf   rg   rh   ru   rv   rs   rowmodfndetails              r   _render_tablez_Reporter._render_table   s     ))%+Yb)cE $s#$ &&u-R~&'#' 4RcU!B4r&234r   itemsc                     t         j                  dddd| D cg c]4  }|j                  |j                  dj	                  |j
                        f6 c}d       yc c}w )	z3Report wrappers with invalid ``args_mapping`` keys.zInvalid Argument MappingszInvalid Argsbold redred, z7[ERROR] Found functions with invalid argument mappings:rg   rh   ru   rv   N)r%   r   modulefunctionjoininvalid_argsr   rs     r   r   z_Reporter.invalid_args   sV     	'"MRS188QZZ1>>)BCSR 	  	

 T   9Ac                     t         j                  dddd| D cg c]4  }|j                  |j                  dj	                  |j
                        f6 c}d       yc c}w )	zBReport wrappers whose ``args_mapping`` maps an argument to itself.z'Identity Argument Mappings (arg -> arg)zIdentity Argsbold yellowyellowr   zG[WARNING] Found functions with identity argument mappings (arg -> arg):r   N)r%   r   r   r   r   identity_args_mappingr   s     r   identity_args_mappingsz _Reporter.identity_args_mappings   sY     	5%V[\QR188QZZ13J3J)KL\b 	  	

 ]r   c                     dt         dt        fd}t        j                  dddd| D cg c]!  }|j                  |j
                   ||      f# c}d	       y
c c}w )z:Report wrappers that have no observable effect on callers.r   r   c                     g }| j                   r|j                  d       | j                  r|j                  d       | j                  r|j                  d       dj	                  |      S )NzEmpty mappingzSelf referencezAll identity mappingsr   )empty_args_mappingappendself_referenceall_identityr   )r   partss     r   _reasonsz%_Reporter.no_effect.<locals>._reasons   sU    E##_--.~~4599U##r   z No-Effect Wrappers (zero impact)Reasonr   r   zA[WARNING] Found deprecated wrappers with NO EFFECT (zero impact):r   N)r   rW   r%   r   r   r   )r   r   r   s      r   	no_effectz_Reporter.no_effect   sa    	$. 	$3 	$ 	.%?DE!188QZZ!5E\ 	  	

 Fs   &Aerrorr   c                    |rdnd}|rdnd}|rdnd}t         j                  dd||| D cg c]=  }|j                  |j                  |j                  |j                  j
                  nd
f? c}| d       y	c c}w )zQReport deprecated-to-deprecated forwarding chains; ``error=True`` renders in red.r   r   r   r   z[ERROR]z	[WARNING]zDeprecation Chainsz
Chain TypeN z6 Found deprecated wrappers forming deprecation chains:r   )r%   r   r   r   
chain_typevalue)r   r   rn   rh   prefixr   s         r   chainsz_Reporter.chains   s     $
"E	# jopef188QZZq||?W););]_`p"8#YZ 	  	

 qs   AA9expiredc                 b   t         j                  rt         j                  dt         j                  j                  d      }|j                  dd       | D ]  }|j                  |        t         j                         j                  |       y	t        d       | D ]  }t        d|         y	)
zIReport deprecated wrappers that have passed their ``remove_in`` deadline.zExpired Deprecated Wrappersr   rj   Messager   rm   z+
[ERROR] Found expired deprecated wrappers:ry   N)
r%   r&   r`   r_   rq   rr   r{   r'   r(   r,   )r   rs   r    s      r   expiryz_Reporter.expiry   s     ((39L9L9T9Tbl ) E Ye4 #c"# &&u-AB %cU|$%r   error_on_chainsrL   r   c                   | D cg c]  }|j                   s| }}| D cg c]  }|j                  s| }}| D cg c]  }|j                  s| }}| D cg c]  }|j                  | }}|s|s|s|sy|rt        j                  |       |rt        j                  |       |rt        j                  |       |rt        j                  ||       yc c}w c c}w c c}w c c}w )zGPrint categorised diagnostics and return whether any issues were found.Fr   T)r   r   r   r   r%   r   r   )rL   r   r   r   r   r   r   s          r   issuesz_Reporter.issues  s     $+=aann==-4!P8O8O!!P!P '711;;Q7	7$A(@!AA 6)v""<0!,,-CD	*V?;# >!P7As+   CCCCC#C#C(+C()F)$__name__
__module____qualname__r   r&   bool__annotations__r]   r   r^   r_   r`   r\   ra   _rich_box_importrich.consolerb   _RichConsole
rich.tablerc   _RichTable_importImportErrorstaticmethodr'   rW   rt   listtupler   r   r   r   r   r   r   r    r   r   r%   r%      s7   +F3It3D#D#IsJ
089$	&
~4( < <# < < 3 S # # RU   444 	4
 4 5c?#4 4 
4 4( 	
D!78 	
T 	
 	
 	
d+A&B 	
t 	
 	
 
45 
$ 
 
, EJ 
d12 
d 
t 
 
 %S	 %d % % QV 34 $ [_  k  s   &D D	D	r%   versionc                     t        |       }	 t        |||      S # t        $ r3}t        |      rt	        dd       nt	        d| d       Y d}~yd}~ww xY w)u[  Run the expiry scan and return expired wrapper messages, or None when packaging is unavailable.

    Caller is responsible for setting up ``sys.path`` via :func:`_managed_sys_path` before calling.

    Args:
        path: Package directory path or importable module name string.
        version: Current package version for comparison, or None to auto-detect.
        recursive: Scan submodules recursively.

    Returns:
        List of expired wrapper message strings (may be empty), or None when the
        ``packaging`` library is unavailable (advisory — warning already printed to stderr).

    r6   mThe 'expiry' subcommand requires the 'packaging' library.
Install it with: `pip install 'pyDeprecate[audit]'`Tr   zCould not determine the current package version automatically.
Pass --version explicitly, or ensure the package is installed and importable.

Original error: N)r   r   r   "_is_missing_packaging_import_errorr,   )r-   r   r7   rO   excs        r   
_do_expiryr   #  sn     't,K*;9UU -c2F ##&%) 	 s    	A)AAr   c                     | t        | dd      fD ];  }|t        |dd      }t        |t              s$|dk(  s|j                  d      s; y dt        |       v S )a  Return True when an ImportError was caused by a missing packaging dependency.

    Args:
        error: The ImportError raised while trying to inspect expiry information.

    Returns:
        True if the error indicates that the ``packaging`` library is unavailable.

    	__cause__Nr   	packagingz
packaging.TzNo module named 'packaging')getattr
isinstancerW   r;   )r   r   r   s      r   r   r   G  sg     wuk489 ;sFD)dC dk&9T__\=Z )CJ66r   user_providedr   c          	          t        |       }t        d|         ||rdnd}t        d| d| d| d       yt        d|        y)	zMPrint a consistent scan header: scanning location, package name, and version.z
Scanning: Nzuser-providedzauto-detectedz	Package: z  Version: z ())r   r,   )r-   r   r   r   sources        r   _print_scan_headerr   _  sV    t$F
Zv$16(+gYbBC6(#$r   )	_wrappers	exit_zeror   c                "   |,t        |        t        |       5  t        | |      }ddd       |st        d       yt        j                  |d      rt        d       nt        d       t        d	 |D              }|s|rd
S dS # 1 sw Y   _xY w)a  Scan Python code for misconfigured ``@deprecated`` wrappers and deprecation chains.

    Reports invalid argument mappings (exit 1), identity mappings, no-effect wrappers,
    and deprecation chains (advisory warnings only, exit 0). Use the ``chains``
    subcommand for a dedicated hard-error chain check.

    Args:
        path: Path to the module, package directory, or importable module name to scan.
        recursive: Scan submodules recursively (default True). Pass ``--norecursive`` to scan top-level only.
        exit_zero: Always exit 0 even if hard errors (invalid argument mappings) are found.
            Useful for advisory CI steps that should report but never block.
        _wrappers: Pre-scanned wrapper list. When provided, skips the scan step. Underscore
            prefix hides this parameter from the Fire CLI (internal use by ``cmd_all`` only).

    Returns:
        0 on success or advisory-only issues; 1 when hard errors are found and ``exit_zero`` is False.

    Nr6   zNo deprecated callables found.r   Fr   z*
Issues were found in deprecated wrappers.z&
All deprecated wrappers look correct!c              3   4   K   | ]  }|j                     y wr1   )r   )r<   r   s     r   r?   zcmd_check.<locals>.<genexpr>  s     8ann8   r/   )r   r
   rV   r,   r%   r   rJ   )r-   r7   r   r   has_invalids        r   	cmd_checkr   j  s    2 4 t$ 	>"49=I	> /0	59<=898i88K+1414	> 	>s   BBc                   |t        |      }|Q||nt        t        |       |       }t        | ||du       t	        |       5  t        | ||      }ddd       y|}n|t        dd       y	 t        ||      }|st        d	       yt        j                  |       t        d
t        |       d       |rdS dS # 1 sw Y   mxY w# t        $ r t        dd       Y yw xY w)a  Check for deprecated wrappers that have passed their scheduled removal version.

    Requires the ``packaging`` library: ``pip install 'pyDeprecate[audit]'``.
    A missing ``packaging`` library is treated as advisory (returns 0 with a warning).

    Args:
        path: Path to the module, package directory, or importable module name to scan.
        version: Current package version for comparison (e.g. ``"2.0.0"``). Auto-detected
            from installed package metadata if not provided.
        recursive: Scan submodules recursively (default True). Pass ``--norecursive`` to scan top-level only.
        exit_zero: Always exit 0 even if expired wrappers are found.
            Useful for advisory CI steps that should report but never block.
        _wrappers: Pre-scanned wrapper list. When provided, skips the scan step and derives
            expired wrappers via ``_check_expiry_for_callables``. Requires *version* to be
            non-``None`` when set. Underscore prefix hides this parameter from the Fire CLI
            (internal use by ``cmd_all`` only).

    Returns:
        0 on success or when the ``packaging`` library is unavailable; 1 when expired
        wrappers are found and ``exit_zero`` is False.

    Nr-   r   r   zECannot check expiry: version not resolved. Pass --version explicitly.Tr   r   z%No expired deprecated wrappers found.rx   z expired wrapper(s) found.r/   )rW   r   r   r   r
   r   r,   r   r   r%   r   rU   )r-   r   r7   r   r   resolved_versionrawr   s           r   
cmd_expiryr     s   > g,&-&97?STefjTkrv?w4!1PTATUt$ 	@T#3Y?C	@; ?Zcgh	1)WEG 67W
RG~7891 q 1	@ 	@  	F
 	s   B?2C ?CC$#C$c                P   |5t        |        t        |       5  t        t        |       |      }ddd       |D cg c]  }|j                  | }}|st        d       yt        j                  |d       t        dt        |       d       |rdS d	S # 1 sw Y   hxY wc c}w )
a  Detect deprecated wrappers whose ``target`` is itself a deprecated callable (chains).

    Two chain kinds are detected: ``target`` (forwarding chain to another deprecated
    callable) and ``stacked`` (composed argument mappings that should be collapsed).

    Args:
        path: Path to the module, package directory, or importable module name to scan.
        recursive: Scan submodules recursively (default True). Pass ``--norecursive`` to scan top-level only.
        exit_zero: Always exit 0 even if chains are found.
            Useful for advisory CI steps that should report but never block.
        _wrappers: Pre-scanned wrapper list. When provided, skips the scan step and filters
            for ``chain_type is not None`` internally. Underscore prefix hides this parameter
            from the Fire CLI (internal use by ``cmd_all`` only).

    Returns:
        0 when no chains are found or ``exit_zero`` is True; 1 when chains are found.

    Nr6   zNo deprecation chains found.r   Tr   rx   z deprecation chain(s) found.r/   )	r   r
   r   r   r   r,   r%   r   rU   )r-   r7   r   r   r   r   s         r   
cmd_chainsr     s    2 4 t$ 	e34H4NZcdI	e"?Aall&>a?F?-.V4(
RF}89:1 q 	e 	e?s   BB#B#B c                    |t        |      }t        |       j                         r| nd}||nt        t	        |       |      }t        | ||du       t        |       5  t        | |      }ddd       t        | |d      }t        | ||d|      }t        | |d|      }	t        | |||       t        |xs |xs |	      }
|
r|rd	S d
S # 1 sw Y   axY w)a  Run all three checks then append a deprecation table.

    Performs a single scan pass and distributes the wrappers to ``cmd_check``,
    ``cmd_expiry``, and ``cmd_chains`` so the filesystem is only traversed once.
    After all three checks complete, ``cmd_status`` is always called to append a
    compact markdown deprecation table to the output.
    Version is auto-detected from installed package metadata when not provided.
    A missing ``packaging`` library skips the expiry check with a warning and does not
    count as a hard error.

    Args:
        path: Path to the module, package directory, or importable module name to scan.
        version: Current package version for expiry comparison (e.g. ``"2.0.0"``).
            Auto-detected from installed package metadata if not provided.
        recursive: Scan submodules recursively (default True). Pass ``--norecursive`` to scan top-level only.
        exit_zero: Always exit 0 even if issues are found.
            Useful for advisory CI steps that should report but never block.

    Returns:
        0 when all checks pass or ``exit_zero`` is True; 1 when any hard error is found.
        The deprecation table is always appended regardless of pass/fail outcome.

    Nr   r   r6   F)r7   r   r   )r   r7   r   r   )r   r7   r   r   r/   )rW   r   existsr   r   r   r
   rV   r   r   r   
cmd_statusr   )r-   r   r7   r   version_pathr   wrappers
check_codeexpiry_codechains_code
has_errorss              r   cmd_allr     s    : g,:,,.4DL&,@ARSWAX_k,l  t-WD=PQ	4	  9di89
 49QYZJT+;y\amuvKTY%S[\Kt-hWj>K>;?J)1229 9s    CCrn   include_membersoutputc                   |t        |      }	 t        |      }t        |       }	||nt        |	| 	      }
|5t        | |
|du
       t        |       5  t        |	|
|||      }ddd       nt        |	|
||      }t        j                  r0ddlm} t        j                         j!                   |             nt	               |Kt#        |      }|j$                  j'                  dd       |j)                  |d       t	        d| d       y# t        $ rD dj                  d t        D              }t	        d|d| dd       t        j
                  }Y Gw xY w# 1 sw Y   xY w)u   Print a markdown deprecation status table to stdout.

    Scans the target package for deprecated wrappers and renders their lifecycle
    status as a Markdown table. Standalone — runs no checks, always exits 0.
    When ``--output`` is given, the table is also written to that file.

    Args:
        path: Path to the module, package directory, or importable module name to scan.
        version: Current package version for lifecycle status (e.g. ``"2.0.0"``).
            Auto-detected from installed package metadata if not provided.
        recursive: Scan submodules recursively (default True). Pass ``--norecursive`` to scan top-level only.
        style: Table format — ``compact`` (default) or ``matrix``.
        include_members: Include deprecated class members such as methods and constructors (default True).
        output: Optional file path to write the markdown table. The table is always
            printed to stdout regardless of this flag.

    Returns:
        Always 0 — status table generation is not a pass/fail gate.

    Nr   c              3   4   K   | ]  }|j                     y wr1   )r   )r<   ss     r   r?   zcmd_status.<locals>.<genexpr>Q  s     6a!''6r   zInvalid style z.; falling back to 'compact'. Expected one of: rz   Tr   r   r   )current_versionr7   rn   r   )r   rn   r   r   )Markdown)parentsexist_okutf-8encodingu   → Saved to: )rW   r   rX   r   r,   COMPACTr   r   r   r
   r   r%   r&   rich.markdownr   r'   r(   r   r:   mkdir
write_text)r-   r   r7   rn   r   r   r   table_stylevalidrO   r   markdownr   out_paths                 r   r   r   .  s   < g,) ' 't,K")"5w;OP[bf;g4!1PTATUt$ 	1 0#! /H	 	 .,	
 *""8H#56x<dT:Hw7z*48M  )		6:66y(VW\V]]^_hlm (()	 	s   D E%A	E"!E"%E.r~   .).Nc                 `     t        j                         dt        dt        ddf fd       }|S )aj  Wrap a cmd_* function so its integer return value becomes a sys.exit() call.

    Acts as the single top-level exception handler for the CLI: unhandled exceptions
    are converted to a non-zero sys.exit with the exception message as the exit code
    string. SystemExit is re-raised unchanged so Fire's --help and normal exits pass
    through unmodified.

    argskwargsr   Nc                      	 t        j                   | i |       y # t        $ r  t        $ r(}t        j                  t	        |             Y d }~y d }~ww xY wr1   )r)   exitrH   rI   rW   )r   r   r   r~   s      r   wrapperz_wrap.<locals>.wrapper  sL    	HHR(() 	 	HHSX	s    AAA)	functoolswrapsobject)r~   r   s   ` r   _wrapr  ~  s<     __Rv  D   Nr   c                  &   t         j                  t         j                  fD ]b  } t        | d      st	        | dd      j                         dk7  s/t        j                  t              5  | j                  d       ddd       d y# 1 sw Y   oxY w)a   Reconfigure stdout/stderr to UTF-8 on platforms where the default encoding may reject non-ASCII characters.

    On Windows the default console codec (``charmap``) cannot encode Unicode emoji used by
    :class:`~deprecate.audit.DeprecationStatus`.  Calling ``reconfigure`` before any output is written ensures emoji
    reach the terminal (or CI log) without a :exc:`UnicodeEncodeError`.

    The call is a no-op when the streams are already UTF-8 or when they lack a ``reconfigure`` method (binary streams,
    pytest capture wrappers).

    reconfigurer   r   r   N)
r)   r*   r   hasattrr   lower
contextlibsuppressrI   r  )streams    r   _ensure_utf8_streamsr
    s}     ::szz* 56=)gfj'.R.X.X.Z^e.e$$Y/ 5""G"45 555 5s   )BB	c            	      v   t                	 ddl} h d}t        j
                  dd }|r|d   |vr|d   dvrdg|} j                  t        t              t        t              t        t              t        t              t        t              d|	       y# t        $ r t        j                  d       Y w xY w)
z CLI entry point for pydeprecate.r   NzbThe 'pydeprecate' CLI requires the 'fire' package.
Install it with: pip install 'pyDeprecate[cli]'>   allcheckr   r   statusr/   >   -h--helpr  )r  r   r   r  r  )command)r
  firer   r)   r   rA   Firer  r   r   r   r   r   )r  subcommandsrA   s      r   clir    s    x AK88AB<DQ{*tAw>N/N$II9%J'J'>J'	
   	  xvwxs   B B87B8)Tr1   )rz   TF)rz   NTF)rz   NTcompactTN)r   N)1__doc__r  r   importlib.utilr   r)   collections.abcr   pathlibr   typingr   r   deprecate._pkgr   r   r	   r
   r   r   deprecate.auditr   r   r   r   r   r   r   rW   r   r   r,   r   rR   rV   r%   r   r   r   r   intr   r   r   r   r   r  r
  r  r   r   r   <module>r     s4       
 $      6 6 6
 (-    $%# %$'="> %P@S @T @T:P5Q @:X Xv S  8C=  T  htTWyFY  H7k 7d 70%Z_ %S %8C= %SW %dh % (5
 9=(5
(5(5 (5
 345(5 	(5X !	=! 9==!
=!c]=! =! 	=! 345=! 	=!B #!
 9=#!
#!#! #!
 345#! 	#!N !	03
03c]03 03 	03
 	03h !  H 9=H
Hc]H H 	H
 H SMH 345H 	H`hsCx  Xi%8 ,5"r   