ó
    &ÝNj°N  ã                   ó   • S r SSKrSSKrSSKJr  SSKJr  SSKJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJr  SSKJr  SSKJrJrJr  \(       a  SS	KJr  SS
KJr  \" S\
S9r " S S\\   5      rS\	S\	S\
4S jr  " S S5      r!SSS\	S\	SS4S jr"g)zb
This module contains the core `.Task` class & convenience decorators used to
generate new tasks.
é    N)Údeepcopy)Úupdate_wrapper)ÚTYPE_CHECKINGÚAnyÚCallableÚDictÚGenericÚIterableÚListÚOptionalÚSetÚTupleÚTypeÚTypeVarÚUnioné   )ÚContext)ÚArgumentÚParseResultÚtranslate_underscores)Ú	Signature)ÚConfigÚT)Úboundc                   óà  • \ rS rSrSr            S$S\S\\   S\\   S\\\      S\\   S	\	S
\	S\\
\\4      S\\\\   \4      S\\\\   \4      S\	S\\\      S\\\      SS4S jjr\S\4S j5       rS\4S jrS\S\	4S jrS\4S jrS\S\S\4S jr\S\	4S j5       rS\SS4S jrS\\\      S\\   4S jrS\S	\S\\   S\
\\4   4S  jr S%S!\\	   S\\   4S" jjrS#rg)&ÚTaské%   a/  
Core object representing an executable task & its argument specification.

For the most part, this object is a clearinghouse for all of the data that
may be supplied to the `@task <invoke.tasks.task>` decorator, such as
``name``, ``aliases``, ``positional`` etc, which appear as attributes.

In addition, instantiation copies some introspection/documentation friendly
metadata off of the supplied ``body`` object, such as ``__doc__``,
``__name__`` and ``__module__``, allowing it to "appear as" ``body`` for
most intents and purposes.

.. versionadded:: 1.0
NÚbodyÚnameÚaliasesÚ
positionalÚoptionalÚdefaultÚauto_shortflagsÚhelpÚpreÚpostÚ	autoprintÚiterableÚincrementableÚreturnc                 óø  • Xl         [        X R                   5        [        USS5      U l        [        USS5      U l        [        USS5      U l        X l        X0l        X`l        U R                  U5      U l
        [        U5      U l        U=(       d    / U l        U=(       d    / U l        Xpl        U=(       d    0 R!                  5       U l        U	=(       d    / U l        U
=(       d    / U l        SU l        X°l        g )NÚ__doc__Ú Ú__name__Ú
__module__r   )r   r   Úgetattrr-   r/   r0   Ú_namer    Ú
is_defaultÚfill_implicit_positionalsr!   Útupler"   r)   r*   r$   Úcopyr%   r&   r'   Útimes_calledr(   )Úselfr   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   s                 ÚI/home/mande/repo/quber/.venv/lib/python3.13/site-packages/invoke/tasks.pyÚ__init__ÚTask.__init__<   sÊ   € ð" Œ	Ü�tŸY™YÔ'ô ˜t Y°Ó3ˆŒÜ  j°"Ó5ˆŒÜ! $¨°bÓ9ˆŒð Œ
ØŒØ!Œà×8Ñ8¸ÓDˆŒÜ˜h›ˆŒØ Ÿ BˆŒØ*×0¨bˆÔØ.ÔØ—Z˜R×%Ñ%Ó'ˆŒ	à—9˜"ˆŒØ—J˜BˆŒ	ØˆÔà"�ó    c                 ó@   • U R                   =(       d    U R                  $ ©N)r2   r/   ©r8   s    r9   r   Ú	Task.nameg   s   € à�z‰z×*˜TŸ]™]Ð*r<   c                 ó´   • SnU R                   (       a*  SR                  SR                  U R                   5      5      nSR                  U R                  U5      $ )Nr.   z ({})z, z<Task {!r}{}>)r    ÚformatÚjoinr   )r8   r    s     r9   Ú__repr__ÚTask.__repr__k   s@   € ØˆØ�<�<Ø—n‘n T§Y¡Y¨t¯|©|Ó%<Ó=ˆGØ×%Ñ% d§i¡i°Ó9Ð9r<   Úotherc                 ó  • [        U[        5      (       a  U R                  UR                  :w  a  gU R                  UR                  :X  a  g U R                  R                  UR                  R                  :H  $ ! [
         a     gf = f)NFT)Ú
isinstancer   r   r   Ú__code__ÚAttributeError)r8   rF   s     r9   Ú__eq__ÚTask.__eq__q   sl   € Ü˜%¤×&Ñ&¨$¯)©)°u·z±zÓ*AØð �9‰9˜Ÿ
™
Ó"ØðØ—y‘y×)Ñ)¨U¯Z©Z×-@Ñ-@Ñ@Ð@øÜ!ó Ùðús   Á,A: Á:
BÂBc                 óX   • [        U R                  5      [        U R                  5      -   $ r>   )Úhashr   r   r?   s    r9   Ú__hash__ÚTask.__hash__   s   € ô �D—I‘I‹¤ d§i¡i£Ñ0Ð0r<   ÚargsÚkwargsc                 óÔ   • [        US   [        5      (       d(  Sn[        UR                  [	        US   5      5      5      eU R
                  " U0 UD6nU =R                  S-  sl        U$ )Nr   z9Task expected a Context as its first arg, got {} instead!r   )rH   r   Ú	TypeErrorrB   Útyper   r7   )r8   rQ   rR   ÚerrÚresults        r9   Ú__call__ÚTask.__call__…   s]   € ä˜$˜q™'¤7×+Ñ+ØMˆCä˜CŸJ™J¤t¨D°©G£}Ó5Ó6Ð6Ø—’˜DÐ+ FÑ+ˆØ×Ò˜QÑÕØˆr<   c                 ó    • U R                   S:„  $ )Nr   )r7   r?   s    r9   ÚcalledÚTask.called�   s   € à× Ñ  1Ñ$Ð$r<   r   c                 ó*  • [        U[        R                  5      (       a  UnOUR                  n[        R
                  " U5      n[        UR                  R                  5       5      n[        U5      (       d  [        S5      eUR                  USS S9$ )a¨  
Returns a modified `inspect.Signature` based on that of ``body``.

:returns:
    an `inspect.Signature` matching that of ``body``, but with the
    initial context argument removed.
:raises TypeError:
    if the task lacks an initial positional `.Context` argument.

.. versionadded:: 1.0
.. versionchanged:: 2.0
    Changed from returning a two-tuple of ``(arg_names, spec_dict)`` to
    returning an `inspect.Signature`.
z,Tasks must have an initial Context argument!r   N)Ú
parameters)rH   ÚtypesÚFunctionTyperX   ÚinspectÚ	signatureÚlistr^   ÚvaluesÚlenrT   Úreplace)r8   r   ÚfuncÚsigÚparamss        r9   ÚargspecÚTask.argspec“   sz   € ô  �dœE×.Ñ.×/Ñ/Ø‰Dà—=‘=ˆDä×Ò Ó%ˆÜ�c—n‘n×+Ñ+Ó-Ó.ˆô �6�{‰{äÐJÓKÐKØ�{‰{ f¨Q¨R jˆ{Ð1Ð1r<   c                 ó  • Ucv  U R                  U R                  5      R                  R                  5        Vs/ s H8  nUR                  [
        R                  R                  L d  M,  UR                  PM:     nnU$ s  snf r>   )	rj   r   r^   rd   r#   ra   r   Úemptyr   )r8   r!   Úxs      r9   r4   ÚTask.fill_implicit_positionals±   ss   € ð
 Ñð Ÿ™ d§i¡iÓ0×;Ñ;×BÑBÔDóâD�AØ—9‘9¤× 1Ñ 1× 7Ñ 7Ð7ó �—”ÙDð ð ð
 Ðùòs   ¹+A<Á(A<Útaken_namesc                 óh  • 0 nXR                   ;   US'   XR                  ;   US'   XR                  ;   a  [        US'   Ub  UO/ US'   XR                  ;   a  SUS'   UnSU;   a  XS'   [        U5      nU/nU R                  (       a(  U H"  nXq:X  a  M
  Xs;   a  M  UR                  U5          O   XdS	'   US [        R                  R                  4;  a&  [        U5      nUS   (       a	  U[        L d  X„S'   X$S'   X4 H3  n	X�R                  ;   d  M  U R                  R                  U	5      US
'     U$    U$ )Nr!   r"   Úkindr#   Tr*   Ú_Ú	attr_nameÚnamesr%   )r!   r"   r)   rc   r*   r   r$   Úappendra   r   rm   rU   Úboolr%   Úpop)
r8   r   r#   rp   ÚoptsÚoriginal_nameru   Úcharrr   Úpossibilitys
             r9   Úarg_optsÚTask.arg_opts¾   s>  € ð  "ˆà!§_¡_Ñ4ˆˆ\Ñà§=¡=Ñ0ˆˆZÑà—=‘=Ó ÜˆD�‰Lð *1Ñ)<™gÀ"ˆD�‰Oà×%Ñ%Ó%Ø$(ˆD�Ñ!ð ˆØ�$‹;Ø $�ÑÜ(¨Ó.ˆDØ�ˆØ××ã�Ø�¨Õ(;Ø—L‘L Ô&Ùñ ð ˆW‰à˜4¤×!2Ñ!2×!8Ñ!8Ð9Ó9ô
 ˜“=ˆDØ˜×$¨´ªØ#�V‘Ø%�‰OàÓ.ˆKØŸi™iÕ'Ø#Ÿy™yŸ}™}¨[Ó9��V‘ØØˆñ	 /ð ˆr<   Úignore_unknown_helpc           
      ó  • U R                  U R                  5      n[        UR                  R	                  5       5      n/ nUR                  R                  5        Hh  n[        S0 U R                  UR                  UR                  U5      D6nUR                  U5        UR                  [        UR                  5      5        Mj     U R                  (       aB  U(       d;  [        SR                  [!        U R                  R	                  5       5      5      5      e[#        [!        U R$                  5      5       HK  n['        U5       H9  u  p‰U	R                  U:X  d  M  UR)                  SUR+                  U5      5          MI     MM     U$ )a3  
Return a list of Argument objects representing this task's signature.

:param bool ignore_unknown_help:
    Controls whether unknown help flags cause errors. See the config
    option by the same name for details.

.. versionadded:: 1.0
.. versionchanged:: 1.7
    Added the ``ignore_unknown_help`` kwarg.
z4Help field was set for param(s) that don't exist: {}r   © )rj   r   Úsetr^   Úkeysrd   r   r}   r   r#   rv   Úupdateru   r%   Ú
ValueErrorrB   rc   Úreversedr!   Ú	enumerateÚinsertrx   )
r8   r   rh   rp   rQ   ÚparamÚnew_argÚposargÚiÚargs
             r9   Úget_argumentsÚTask.get_argumentsï   s+  € ð �l‰l˜4Ÿ9™9Ó%ˆô ˜#Ÿ.™.×-Ñ-Ó/Ó0ˆð ˆØ—^‘^×*Ñ*Ö,ˆEÜñ Ø—-‘- §
¡
¨E¯M©M¸;ÓGñˆGð �K‰K˜Ô ð ×Ñœs 7§=¡=Ó1Ö2ñ -ð �9�9Ö0ÜØF×MÑMÜ˜Ÿ™Ÿ™Ó)Ó*óóð ô œt D§O¡OÓ4Ö5ˆFÜ# Dž/‘�Ø—8‘8˜vÕ%Ø—K‘K  4§8¡8¨A£;Ô/Úó *ñ 6ð
 ˆr<   )r-   r0   r/   r2   r    r$   r(   r   r%   r*   r3   r)   r"   r!   r'   r&   r7   )Nr�   Nr�   FTNNNFNNr>   ) r/   r0   Ú__qualname__Ú__firstlineno__r-   r   r   Ústrr
   rw   r   r   r   r   r:   Úpropertyr   rD   ÚobjectrK   ÚintrO   r   rX   r[   rj   r4   r   r}   r   rŽ   Ú__static_attributes__r�   r<   r9   r   r   %   s  † ñð2 #Ø!#Ø.2Ø"$ØØ $Ø)-Ø/3Ø04ØØ,0Ø15ñ)#àð)#ð �s‰mð)#ð ˜#‘ð	)#ð
 ˜X c™]Ñ+ð)#ð ˜3‘-ð)#ð ð)#ð ð)#ð �t˜C ˜H‘~Ñ&ð)#ð �e˜D ™I s˜NÑ+Ñ,ð)#ð �u˜T #™Y¨˜^Ñ,Ñ-ð)#ð ð)#ð ˜8 C™=Ñ)ð)#ð   ¨¡Ñ.ð)#ð 
õ)#ðV ð+�có +ó ð+ð:˜#ô :ð˜Fð  tô ð1˜#ô 1ð˜cð ¨Sð °Qô ð ð%˜ó %ó ð%ð2˜Hð 2¨ô 2ð<Ø" 8¨C¡=Ñ1ðà	�#‰ôð/Øð/Ø"%ð/Ø47¸±Hð/à	ˆc�3ˆh‰ô/ðd 59ñ/Ø#+¨D¡>ð/à	ˆh‰÷/ð /r<   r   rQ   rR   r+   c                  ó4  ^^• TR                  S[        5      m[        U 5      S:X  a7  [        U S   5      (       a$  [	        U S   [        5      (       d  T" U S   40 TD6$ U (       a  ST;   a  [        S5      eU TS'   S[        S[        [           4UU4S jjnU$ )	aó
  
Marks wrapped callable object as a valid Invoke task.

May be called without any parentheses if no extra options need to be
specified. Otherwise, the following keyword arguments are allowed in the
parenthese'd form:

* ``name``: Default name to use when binding to a `.Collection`. Useful for
  avoiding Python namespace issues (i.e. when the desired CLI level name
  can't or shouldn't be used as the Python level name.)
* ``aliases``: Specify one or more aliases for this task, allowing it to be
  invoked as multiple different names. For example, a task named ``mytask``
  with a simple ``@task`` wrapper may only be invoked as ``"mytask"``.
  Changing the decorator to be ``@task(aliases=['myothertask'])`` allows
  invocation as ``"mytask"`` *or* ``"myothertask"``.
* ``positional``: Iterable overriding the parser's automatic "args with no
  default value are considered positional" behavior. If a list of arg
  names, no args besides those named in this iterable will be considered
  positional. (This means that an empty list will force all arguments to be
  given as explicit flags.)
* ``optional``: Iterable of argument names, declaring those args to
  have :ref:`optional values <optional-values>`. Such arguments may be
  given as value-taking options (e.g. ``--my-arg=myvalue``, wherein the
  task is given ``"myvalue"``) or as Boolean flags (``--my-arg``, resulting
  in ``True``).
* ``iterable``: Iterable of argument names, declaring them to :ref:`build
  iterable values <iterable-flag-values>`.
* ``incrementable``: Iterable of argument names, declaring them to
  :ref:`increment their values <incrementable-flag-values>`.
* ``default``: Boolean option specifying whether this task should be its
  collection's default task (i.e. called if the collection's own name is
  given.)
* ``auto_shortflags``: Whether or not to automatically create short
  flags from task options; defaults to True.
* ``help``: Dict mapping argument names to their help strings. Will be
  displayed in ``--help`` output. For arguments containing underscores
  (which are transformed into dashes on the CLI by default), either the
  dashed or underscored version may be supplied here.
* ``pre``, ``post``: Lists of task objects to execute prior to, or after,
  the wrapped task whenever it is executed.
* ``autoprint``: Boolean determining whether to automatically print this
  task's return value to standard output when invoked directly via the CLI.
  Defaults to False.
* ``klass``: Class to instantiate/return. Defaults to `.Task`.

If any non-keyword arguments are given, they are taken as the value of the
``pre`` kwarg for convenience's sake. (It is an error to give both
``*args`` and ``pre`` at the same time.)

.. versionadded:: 1.0
.. versionchanged:: 1.1
    Added the ``klass`` keyword argument.
Úklassr   r   r&   z2May not give *args and 'pre' kwarg simultaneously!r   r+   c                 ó   >• T" U 40 TD6nU$ r>   r�   )r   Ú_taskr˜   rR   s     €€r9   ÚinnerÚtask.<locals>.innerc  s   ø€ Ù�dÑ%˜fÑ%ˆØˆr<   )rx   r   re   ÚcallablerH   rT   r   r   )rQ   rR   r›   r˜   s    ` @r9   Útaskrž   !  s›   ù€ ðl Ÿ
™
 7¬DÓ1€Eä
ˆ4ƒy�Aƒ~œ( 4¨¡7×+Ñ+´J¸tÀA¹wÌ×4MÑ4MÙ�T˜!‘WÑ' Ñ'Ð'æØ�F‹?ÜØDóð ð ˆˆu‰ð”Hð ¤¤a¡÷ ð ð
 €Lr<   c                   ó  • \ rS rSrSr   SSSS\\   S\\\S4      S	\\\\	4      S
S4
S jjr
S\S
\	4S jrS\S
S 4S jrS
\4S jrS\S
\4S jrSSSSS
\4S jrS
\\\	4   4S jr  SS\\S       S\\\\	4      S
S 4S jjrSrg)ÚCallik  zù
Represents a call/execution of a `.Task` with given (kw)args.

Similar to `~functools.partial` with some added functionality (such as the
delegation to the inner task, and optional tracking of the name it's being
called by.)

.. versionadded:: 1.0
Nrž   r   Ú	called_asrQ   .rR   r+   c                 ó|   • Xl         X l        U=(       d
    [        5       U l        U=(       d
    [	        5       U l        g)aÁ  
Create a new `.Call` object.

:param task: The `.Task` object to be executed.

:param str called_as:
    The name the task is being called as, e.g. if it was called by an
    alias or other rebinding. Defaults to ``None``, aka, the task was
    referred to by its default name.

:param tuple args:
    Positional arguments to call with, if any. Default: ``None``.

:param dict kwargs:
    Keyword arguments to call with, if any. Default: ``None``.
N)rž   r¡   r5   rQ   ÚdictrR   )r8   rž   r¡   rQ   rR   s        r9   r:   ÚCall.__init__v  s)   € ð. Œ	Ø"ŒØ—OœE›GˆŒ	Ø×&¤£ˆ�r<   r   c                 ó.   • [        U R                  U5      $ r>   )r1   rž   )r8   r   s     r9   Ú__getattr__ÚCall.__getattr__“  s   € Ü�t—y‘y $Ó'Ð'r<   Úmemoc                 ó"   • U R                  5       $ r>   )Úclone)r8   r¨   s     r9   Ú__deepcopy__ÚCall.__deepcopy__–  s   € Ø�z‰z‹|Ðr<   c                 ó@  • SnU R                   b?  U R                   U R                  R                  :w  a  SR                  U R                   5      nSR                  U R                  R
                  U R                  R                  UU R                  U R                  5      $ )Nr.   z (called as: {!r})z%<{} {!r}{}, args: {!r}, kwargs: {!r}>)r¡   rž   r   rB   Ú	__class__r/   rQ   rR   )r8   Úakas     r9   rD   ÚCall.__repr__™  st   € ØˆØ�>‰>Ñ%¨$¯.©.¸D¿I¹I¿N¹NÓ*JØ&×-Ñ-¨d¯n©nÓ=ˆCØ6×=Ñ=Ø�N‰N×#Ñ#Ø�I‰I�N‰NØØ�I‰IØ�K‰Kó
ð 	
r<   rF   c                 óf   • SR                  5        H  n[        X5      [        X5      :w  d  M    g   g)Nztask args kwargsFT)Úsplitr1   )r8   rF   Úattrs      r9   rK   ÚCall.__eq__¥  s1   € ð
 '×,Ñ,Ö.ˆDÜ�tÓ"¤g¨eÓ&:Õ:Ùñ /ð r<   Úconfigr   Úcore_parse_resultr   c                 ó(   • [        XR                  S9$ )z£
Generate a `.Context` appropriate for this call, with given config.

.. versionadded:: 1.0
.. versionchanged:: 3.0
    Added the ``core_parse_result`` parameter.
)rµ   Ú	remainder)r   r¸   )r8   rµ   r¶   s      r9   Úmake_contextÚCall.make_context¯  s   € ô ˜f×0KÑ0KÑLÐLr<   c                 óŽ   • [        U R                  U R                  [        U R                  5      [        U R
                  5      S9$ )zY
Return keyword args suitable for cloning this call into another.

.. versionadded:: 1.1
)rž   r¡   rQ   rR   )r£   rž   r¡   r   rQ   rR   r?   s    r9   Ú
clone_dataÚCall.clone_data½  s7   € ô Ø—‘Ø—n‘nÜ˜$Ÿ)™)Ó$Ü˜DŸK™KÓ(ñ	
ð 	
r<   ÚintoÚwith_c                 ó|   • Ub  UOU R                   nU R                  5       nUb  UR                  U5        U" S0 UD6$ )a—  
Return a standalone copy of this Call.

Useful when parameterizing task executions.

:param into:
    A subclass to generate instead of the current class. Optional.

:param dict with_:
    A dict of additional keyword arguments to use when creating the new
    clone; typically used when cloning ``into`` a subclass that has
    extra args on top of the base class. Optional.

    .. note::
        This dict is used to ``.update()`` the original object's data
        (the return value from its `clone_data`), so in the event of
        a conflict, values in ``with_`` will win out.

.. versionadded:: 1.0
.. versionchanged:: 1.1
    Added the ``with_`` kwarg.
r�   )r®   r¼   r„   )r8   r¾   r¿   r˜   Údatas        r9   rª   Ú
Call.cloneÊ  s>   € ð6 Ñ(‘¨d¯n©nˆØ�‰Ó ˆØÑØ�K‰K˜ÔÙ‰}�t‰}Ðr<   )rQ   r¡   rR   rž   )NNN)NN)r/   r0   r�   r‘   r-   r   r’   r   r   r   r:   r¦   r”   r«   rD   rw   rK   r   r¹   r¼   r   rª   r–   r�   r<   r9   r    r    k  s'  † ñð $(Ø*.Ø+/ñ'àð'ð ˜C‘=ð'ð �u˜S #˜X‘Ñ'ð	'ð
 ˜˜c 3˜h™Ñ(ð'ð 
õ'ð:( ð (¨ô (ð ð ¨Fô ð

˜#ô 

ð˜Fð  tô ðMàðMð )ðMð 
ô	Mð
˜D  c ™Nô 
ð (,Ø*.ñà�t˜F‘|Ñ$ðð ˜˜S #˜X™Ñ'ðð 
÷	ð r<   r    rž   c                 ó   • [        XUS9$ )a	  
Describes execution of a `.Task`, typically with pre-supplied arguments.

Useful for setting up :ref:`pre/post task invocations
<parameterizing-pre-post-tasks>`. It's actually just a convenient wrapper
around the `.Call` class, which may be used directly instead if desired.

For example, here's two build-like tasks that both refer to a ``setup``
pre-task, one with no baked-in argument values (and thus no need to use
`.call`), and one that toggles a boolean flag::

    @task
    def setup(c, clean=False):
        if clean:
            c.run("rm -rf target")
        # ... setup things here ...
        c.run("tar czvf target.tgz target")

    @task(pre=[setup])
    def build(c):
        c.run("build, accounting for leftover files...")

    @task(pre=[call(setup, clean=True)])
    def clean_build(c):
        c.run("build, assuming clean slate...")

Please see the constructor docs for `.Call` for details - this function's
``args`` and ``kwargs`` map directly to the same arguments as in that
method.

.. versionadded:: 1.0
)rQ   rR   )r    )rž   rQ   rR   s      r9   ÚcallrÄ   ì  s   € ôB �¨Ñ/Ð/r<   )#r-   ra   r_   r6   r   Ú	functoolsr   Útypingr   r   r   r   r	   r
   r   r   r   r   r   r   r   Úcontextr   Úparserr   r   r   r   rµ   r   r   r   rž   r    rÄ   r�   r<   r9   Ú<module>rÉ      s¬   ðñó
 Û Ý Ý $÷÷ ÷ õ õ  ß @Ñ @æÝ!åáˆC�xÑ €ôyˆ7�1‰:ô yðxG�ð G˜sð G xô G÷T~ñ ~ðB!0ˆvð !0˜cð !0¨Sð !0°Võ !0r<   