+
    2j/                        R t ^ RIHt ^ RIt^ RIHt ^RIHt ^RIH	t	 ^RI
Ht ]'       d   ^ RIHt ^RIHt ^R	IHt ]P$                  ! ]4      tR
 R ltR R ltR R ltR R ltR R ltR R ltR R ltR# )a[  Extras-of-extras expansion for the provider.

The provider models extras as proxy packages: ``foo[bar]`` is a
distinct package whose only candidates are the versions of ``foo``
that declare ``bar`` in their ``Provides-Extra`` field.  This
module owns the per-extra version chooser, the per-extra
dependency lookup, and the missing-extra fallback.
)annotationsN)TYPE_CHECKING)VersionRange)canonicalize_name)refuse_url_dep)RangeProtocol)Version)Providerc               0    V ^8  d   QhRRRRRRRRRRR	R
/# )   providerr	   packagestrbaseextraversion_ranger   returnVersion | None )formats   "f/home/user/billing-ledger-validation/.venv/lib/python3.14/site-packages/nab_python/_provider/extras.py__annotate__r      sL     B BBB B 	B
  B B    c                t   V P                  V4      w   rVV P                  V4      pV P                  Wg4      pV P                  P	                  V4      p	V	f   \
        P                  RVV4       Tp
MWI,          p
\        V
P                  VRR7      4      pV P                  V4      '       d   VP                  4        \        WW;4      pVe    Wc3V P                  9   d   \        WW<W4      pVfF   V	eB   VP                  VRRR7       Uu. uF  pW9  g   K  VNK  	  up;p'       d   \        WWiV4       V# u upi )aR  Pick a version for an extras proxy package.

Delegates to the base package's version list. In BACKTRACK mode,
eagerly checks if the version provides the extra and skips it
if not.  The strategy decision (highest vs lowest) is keyed off
the *base* canonical name; an extras proxy never gets a different
answer than its underlying package.
z<no base range for %s; base admission cannot be applied to %s
descending)assume_sortedT)prereleasesr   )split_and_normalizefetch_versionsversions_onlysolution_rangesgetloggerdebuglistfilterwants_lowestreverse_pick_in_moderoot_extras_pick_for_user_extra_record_base_range_blocks)r   r   r   r   r   _
normalizedversion_listall_versions
base_rangeadmit_range
candidateschosenvexcluded_by_bases   &&&&&          r   choose_extra_versionr6      s_     33D9Aq**40L))*CL ))--j9JJ	

 $#0k((\(RSJZ((85=Fz1X5I5II%E:
 	" '-- d, . !A &	 !   	"z7G	
 M!s   D5D5c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r   r	   r   r   r   r2   list[Version]r   r   r   )r   s   "r   r   r   b   s:     & &&
& & 	&
 &r   c                   ^RI HpHp V P                  V4      w   rgWr3V P                  9   pV P
                  VP                  8H  p	V F  p
V P                  Wz4      '       d   K   V P                  W4       T'       g	   T	'       g   T
u # T P                  P                  Yz34      pT'       d&   TP                   Uu0 uF  p\        T4      kK  	  upM	\        4       pTe	   Y-9   g   K  T
u # 	  R#   T d     K  i ; iu upi )a  Pick a candidate honoring ``ExtrasMode``.

Fetches base metadata so an extraction failure (unparseable PKG-INFO,
a disallowed sdist build, or no metadata source at all) skips the
candidate rather than raising later, when the proxy refetches the base
to expand the extra. This applies to user-requested extras too, since
the proxy always needs the base metadata. BACKTRACK mode additionally
checks ``Provides-Extra`` for transitive extras.
)
ExtrasModeMetadataErrorN)r   r:   r;   r   r)   extras_mode	BACKTRACKhas_invalid_metadataget_dependenciesmetadata_cacher!   provides_extrar   set)r   r   r   r2   r:   r;   r,   r-   is_user	backtrackversionmetadataeprovideds   &&&&          r   r(   r(   b   s      533D9Aq!X%9%99G$$
(<(<<I((==	%%d4 )N**..
/DE  ,4+B+BC+Baq!+BC 	
 u0N! "   		 Ds   %C1<C?1C<;C<c               4    V ^8  d   QhRRRRRRRRRR	R
R	RR/# )r   r   r	   r   r   r   r3   r   r2   r8   r/   r   r   r   )r   s   "r   r   r      sN     * **
* * 	*
 *  * *r   c                  a aa ^RI Hp S P                  VP                  8X  d   V# S P	                  S4      w   rxS P
                  P                  V\        P                  ! 4       4      p	S P                  P                  V4      p
V
e	   W,          p	V	P                  V4       Uu. uF  qV9  g   K  VNK  	  ppV'       g   V# \        ;QJ d!    VVV 3R lV 4       F  '       g   K   RM	  RM! VVV 3R lV 4       4      '       d   V# \        ;QJ d!    VVV 3R lV 4       F  '       g   K   RM	  RM! VVV 3R lV 4       4      '       d   R# V# u upi )a-  Keep or drop ``chosen`` when the root asked for ``extra``.

A root extra pins the first in-range version even when that version
lacks the extra, so the miss is reported against it rather than
against an older version that declares it.  The exception is a range
the search narrowed off every version declaring the extra: reporting
no version there leaves a clause the search can backjump on.  The
check runs against the root requirement's range intersected with the
user's constraint, so the answer follows the index rather than the
metadata fetched so far.
)r:   Nc              3  @   <"   T F  p\        SSSV4      x  K  	  R # 5iNversion_provides_extra.0r4   r   r   r   s   & r   	<genexpr>'_pick_for_user_extra.<locals>.<genexpr>   s      
PZ!(D%;;Z   TFc              3  @   <"   T F  p\        SSSV4      x  K  	  R # 5irL   rM   rO   s   & r   rQ   rR      s      
MW!(D%;;WrS   )r   r:   r<   WARNr   root_requirementsr!   r   fullconstraintsr%   any)r   r   r   r3   r2   r/   r:   r,   r-   
root_range
constraintr4   outsides   fff&&&       r   r*   r*      s    ( &z.33D9Aq++//
L<M<M<OPJ%%))*5J,
$++L9Q9Qj=Pqq9GQ
s
PZ
Psss
PZ
PPP s
MW
Msss
MW
MMMM Rs   $E1Ec          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r   r	   r   r   r   rE   r   r   boolr   )r   s   "r   r   r      s:      
  	
 
r   c                    ^RI Hp V P                  V4      w   rV V P                  W4       T P                  Yc3,          pTP
                   Uu0 uF  p\        T4      kK  	  p	pY)9   #   T d     R# i ; iu upi )zWhether ``version`` of ``base`` declares ``extra`` and yields metadata here.

Honoring a cross-tuple preference for a ``base[extra]`` proxy is only
safe when the preferred version both provides the extra and has
extractable metadata in this tuple.
)r;   F)r   r;   r   r?   r@   rA   r   )
r   r   r   rE   r;   r,   r-   rF   rG   rH   s
   &&&&      r   rN   rN      s     )33D9Aq!!$0 &&
'<=H.6.E.EF.E!!$.EHF   Gs   A) A7)A43A4c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   r   r	   	proxy_pkgr   base_normalizedr0   zRangeProtocol[Version]excludedr8   r   Noner   )r   s   "r   r   r      sD     &# &#&#&# &# '	&#
 &# 
&#r   c                   ^RI Hp V P                  P                  V4      pVe/   V F'  pV P                  WV3,          P                  V4       K)  	  M-V F'  pV P                  WV3,          P                  V4       K)  	  V! V 4       R# )a  Push binary clauses for proxy candidates filtered by base's range.

Each excluded version V records ``proxy_pkg`` at V with ``base`` at
``base_decision`` (or the range-block analogue) impossible.
Without these, the resolver only sees a single-term NO_VERSIONS
clause for the proxy and cannot connect the proxy's
unsatisfiability to the base decision that caused it; with them,
conflict resolution can learn to revisit the base decision.

The caller guarantees ``excluded`` is non-empty: filtering only
populates it when ``base_range`` is set, so the range-block path
always has a target to record against.  When the resolver has
already decided the base, recording against the decision is
tighter (the blocker names one selectable version) than recording
against the range.
)flush_pending_blocksN)	lookaheadrf   solution_decisionsr!   pending_blocksappendpending_range_blocks)r   ra   rb   r0   rc   rf   base_decisionr4   s   &&&&&   r   r+   r+      s    2 0//33ODM A##Y$OPWW 
 A))Z8fQi  "r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r   r	   r   r   r   rE   r   r   dict[str, VersionRange]r   )r   s   "r   r   r      s:     , ,,
, , 	,
 ,r   c                   ^RI HpHp V P                  V4      w   rgV! Wr4      pW3p	WP                  9   d   V P                  V	,          # V P                  W4       Ws3p
V P                  P                  V
4      pVf   RV RV 2pV! V4      hV P                  P                  V
/ 4      P                  V4      pV'       d   V^ ,          w  r\        WV4       V P                  P                  V
/ 4      pVV9  d   \        WW#V	4      # \        VV,          4      pVP                  V\        P                  ! 4       4      \        P                  ! V4      ,          VV&   VV P                  V	&   V P!                  V4       V# )z-Get dependencies for an extras proxy package.)r;   
join_extrazNo metadata cached for ==)r   r;   rp   r   
deps_cacher?   r@   r!   deferred_url_extrasr   extra_deps_maphandle_missing_extradictr   rW   	singletonprefetch_new_deps)r   r   r   rE   r;   rp   r,   r-   	extra_key	cache_keybase_cache_keyrF   msgdeferredrequrl	extra_mapdepss   &&&&              r   get_extra_dependenciesr      sr    533D9Aq:-I$I'''""9-- d, *N&&**>:H (vRy9C  ++//CGGNHA;xc*''++NB?II#H%)TT	% !D xxL%%'w'(D &*H	"t$Kr   c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   r   r	   r-   r   r   rE   r   rz   ztuple[str, Version]r   rn   r   )r   s   "r   r   r   *  sD     " """ " 	"
 #" "r   c                   ^RI HpHp W3V P                  9   pV'       d/   V P                  VP
                  8w  d   V RV RV R2pV! V4      h\        P                  RVVV4       V\        P                  ! V4      /p	WP                  V&   V	# )a  Handle a request for an extra not in Provides-Extra.

In ERROR_USER and BACKTRACK modes, user-provided extras raise
immediately. Transitive missing extras always warn and return
only the base dep (BACKTRACK skips these versions in
choose_version before we get here).
)r:   MissingExtraErrorrq   z does not provide extra ''z"%s==%s does not provide extra '%s')r   r:   r   r)   r<   rU   r"   warningr   rw   rr   )
r   r-   r   rE   rz   r:   r   rC   r|   r   s
   &&&&&     r   ru   ru   *  s     9!X%9%99G8'':??:Bwi'@qI$$
NN,	 ..w78D%)	"Kr   )__doc__
__future__r   loggingtypingr   _vendor.packaging.rangesr   _vendor.packaging.utilsr   metadata_resolverr   nab_resolver.typesr   _vendor.packaging.versionr   r   r	   	getLogger__name__r"   r6   r(   r*   rN   r+   r   ru   r   r   r   <module>r      se    #    3 7 -03# 
		8	$BJ&R*Z4&#R,^"r   