+
    2j0                      R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
Ht ^ RIHtHtHt ^ RIHt ^ RIHtHtHtHt ^ RIHtHt ^ R	IHt ^ R
IHtHt ^ RIH t H!t!H"t" ^RI#H$t$H%t% ^RI&H't' ^RI(H)t) ^RI*H+t+ ^RI,H-t- ^RI.H/t/ ^RI0H1t1H2t2H3t3H4t4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t=H>t>H?t? ^RI@HAtA ^RIBHCtCHDtDHEtE ^RIFHGtGHHtHHItIHJtJHKtK ^RILHMtMHNtNHOtOHPtPHQtQHRtRHStSHTtTHUtUHVtVHWtW ^RIXHYtYHZtZH[t[H\t\H]t]H^t^H_t_ ]'       d   ^ RI`HataHbtbHctc ^ RIdHete ^RIfHgtg . ROth]P                  ! ]j4      tk]l]l]m]m3,          R 3,          tn ! R! R]4      to ! R" R#]]mR$3,          4      tp]! R%R%R&7       ! R' R4      4       tq]! R%R%R&7       ! R( R)4      4       tr]! R%R%R&7       ! R* R4      4       ts] ! R+ R4      4       tt] ! R, R4      4       tuR-RR.RR/R0R1RR2RR3RR4R0R5RR6R/	R7 R8 lltvRR-RR.RR9RR:RR5RR;R%R<RR6R/R= R> llltw]
R? R@ l4       tx^
ty^tzRA RB lt{RC RD lt|RE RF lt}RG RH lt~RI RJ ltRK RL ltRM RN ltR-RR3RRORRPRQ/RR RS lltRT RU ltRV RW lt]! R%R%R&7       ! RX RY4      4       t]! R%R%R&7       ! RZ R[4      4       tR\ R] ltR^ R_ ltR` Ra ltRb Rc ltRd Re ltRRf Rg lltRRh Ri lltRj Rk ltRl Rm ltRn Ro ltRp Rq ltRr Rs ltRt Ru ltRv Rw ltRx Ry ltRz R{ ltR| R} ltR~ R ltRR R lltR R ltR R ltR R ltR R ltR R ltR R lt]! R%R%R&7       ! R R4      4       t]! R%R%R&7       ! R R4      4       tR R ltR R ltR R ltR R ltR R lt ! R R]4      tRRRR/R R lltR R ltR R ltR R ltR R ltR# )a  Resolve a project's dependencies for the environments it targets.

One engine serves every project.  ``[tool.nab.matrix]`` declares many
environments and a bare project declares none (the host is the target),
but either way :func:`~nab_python.config.plan_targets` hands back a list
of :class:`~nab_python.target.ResolveTarget` and each one gets a
single-environment resolve against a shared
:class:`~nab_python.fetch.FetchCoordinator`, so metadata is fetched once
across them.

A declared conflict is the one place a resolve can produce more than one
result for an environment, and it turns on what the selection reaches,
not on how many environments the project targets.  Directly co-selecting
two members of an exclusive set *forks*: each member gets its own resolve
and its pins carry a membership clause, so one lock serves both
selections.  A selection that reaches two members only transitively (an
umbrella extra or group) has no fork to carry the second, so it is
*refused*.  Both hold whether or not a matrix is declared.
)annotationsN)defaultdict)contextmanagersuppress)	dataclassfieldreplace)Path)TYPE_CHECKINGAny
NamedTupleProtocol)ARCHIVE_BUCKET
VCS_BUCKET)ResolutionError)ResolverResolverObserver)IncompatibilityIncompatibilityCauseRootRequirement)dependency_marker_holdsmembership_set_in_marker)admit_vcs_url)Marker)VersionRange)Requirementcanonicalize_name)ConfigErrorConflictForkConflictKindConflictSelectionErrorConflictSetNabProjectConfigconfigured_group_namesconflict_forksindex_cache_floors_from_configindex_routes_from_configplan_targetsread_pyproject_configvalidate_conflict_exclusionsvalidate_conflict_minimumswith_python_override)FetchCoordinator)	LockInput
TargetLockbuild_target_lock)ListingFilterCacheProviderResolutionStrategy
join_extrasplit_extra)expand_extra_requirementsexpand_group_includesexpand_self_extrasraise_for_unsatisfiableread_pyproject_build_requiresread_pyproject_dependenciesread_pyproject_groupsread_pyproject_name$read_pyproject_optional_dependenciesresolve_groups_to_requirementsself_extra_markers)UNBOUNDABLE_MARKER_VARIABLESNonIntervalMarkerErrorResolveTargetenvironment_declarationmarker_variablesmicro_boundary_pointsslices_from_points)IteratorMappingSequence)AsyncHttpTransport)VersionInstallContextsProgressSinkResolveForkResolveResultTargetResult.c                  2    ] tR t^~tRtR R ltR R ltRtR# )rN   a  What the engine reports resolve progress to; the CLI implements it.

``on_fetch`` fires once per package listing fetched (from the fetcher
thread); ``on_pin`` reports the current count of decided packages (from
the resolving thread).  Both are best-effort display hooks.
c                   V ^8  d   QhRR/#    returnNone )formats   "]/home/user/billing-ledger-validation/.venv/lib/python3.14/site-packages/nab_python/resolve.py__annotate__ProgressSink.__annotate__   s     @ @$ @    c                    R# )z1Record that one package listing has been fetched.NrX   selfs   &rZ   on_fetchProgressSink.on_fetch       r]   c                    V ^8  d   QhRRRR/# )rU   decidedintrV   rW   rX   )rY   s   "rZ   r[   r\      s     E Ec Ed Er]   c                    R# )z6Record the current count of decided (pinned) packages.NrX   )r`   re   s   &&rZ   on_pinProgressSink.on_pin   rc   r]   rX   N)__name__
__module____qualname____firstlineno____doc__ra   rh   __static_attributes__rX   r]   rZ   rN   rN   ~   s    @E Er]   c                  >    ] tR t^tRtR R ltR R ltR R ltRtR	# )
_ResolveObservera  Log resolver decisions at DEBUG and drive an optional progress sink.

A decision level is the count of packages currently decided, so it is the
live pinned gauge; a backjump lowers it, keeping the count honest under
backtracking.  Logging is unconditional (the log level gates it, so ``-vv``
surfaces the pin trace); ``sink`` is present only while a progress line is
being rendered.
c                    V ^8  d   QhRRRR/# )rU   sinkProgressSink | NonerV   rW   rX   )rY   s   "rZ   r[   _ResolveObserver.__annotate__   s      0 T r]   c                	    Wn         R # N_sink)r`   rs   s   &&rZ   __init___ResolveObserver.__init__   s    
r]   c               (    V ^8  d   QhRRRRRRRR/# )	rU   packagestrversionrL   levelrf   rV   rW   rX   )rY   s   "rZ   r[   ru      s(     % %3 % % % %r]   c                	    \         P                  R W4       V P                  e   V P                  P                  V4       R# R# )zpinned %s %sN_loggerdebugry   rh   )r`   r}   r   r   s   &&&&rZ   on_decision_ResolveObserver.on_decision   s1    ng7::!JJe$ "r]   c               $    V ^8  d   QhRRRRRR/# )rU   
from_levelrf   to_levelrV   rW   rX   )rY   s   "rZ   r[   ru      s!     ( (c (S (T (r]   c                	    \         P                  R W4       V P                  e   V P                  P                  V4       R# R# )zbackjumped from level %d to %dNr   )r`   r   r   s   &&&rZ   on_backjump_ResolveObserver.on_backjump   s2    6
M::!JJh' "r]   rx   N)	rj   rk   rl   rm   rn   rz   r   r   ro   rX   r]   rZ   rq   rq      s    %
( (r]   rq   rL   T)frozenslotsc                  T    ] tR t^t$ RtR
tR]R&   ]! ]R7      t	R]R&   Rt
R]R	&   R
tR# )rM   a  A fork's requirements, split back into the contexts PEP 751 installs.

``project`` is the project's own dependencies, and ``selectors``
holds one requirement list per active extra and group, keyed by its
``(kind, name)`` member.  The lock writer walks the resolved graph
from each of them, so each package is gated on the contexts that
reach it (see :attr:`~nab_python.lockfile.TargetLock.package_gates`)
and a default install leaves out what only a selection brings.

The fork's own ``selection`` is one of those selectors, so a package
it shares with another active selection names both members and
installs for either.

``project`` is the project's own dependencies *as this fork resolved
them*, empty in a fork a declared conflict excluded them from.

``name_project`` is set when ``[tool.nab].base-group`` names the
project's own dependencies.  It is a lock-wide fact rather than a
per-fork one: the name has to mean the same thing in every lock it
appears in, so the roots are walked even with nothing selected.
tuple[Requirement, ...]projectdefault_factoryz1Mapping[tuple[str, str], tuple[Requirement, ...]]	selectorsFboolname_projectrX   N)rj   rk   rl   rm   rn   r   __annotations__r   dictr   r   ro   rX   r]   rZ   rM   rM      s6    , (*G$)CHDI@  L$r]   c                  0    ] tR t^t$ RtR]R&   R]R&   RtR# )_ConfiguredContextzAn install context ``[tool.nab]`` configures rather than a run selects.

``name`` is ``None`` for the project's own dependencies when no
``base-group`` names them.  Unnamed they cannot be a conflict member,
so every fork carries them.

str | Nonenamer   requirementsrX   Nrj   rk   rl   rm   rn   r   ro   rX   r]   rZ   r   r      s     ))r]   r   c                  >    ] tR t^t$ RtR]R&   R]R&   RtR]R&   R	tR# )
rO   a  A conflict fork's resolver input: a selection and its requirements.

``selection`` is the conflicting members active in this fork, empty
for an unforked resolve; ``requirements`` are the requirements folded
for it: the configured contexts this fork carries plus the groups and
extras the selection activates.  Each fork runs against every target, with its
``selection`` stamped onto each so the pins land under a distinct
label and a membership-gated marker.

``contexts`` is that same requirement list split into the install
contexts the lock has to distinguish; ``None`` for a caller that
resolves a bare requirement list and has no project to split it
into, which leaves every package unconditional.
ztuple[tuple[str, str], ...]	selectionr   r   NInstallContexts | NonecontextsrX   )rj   rk   rl   rm   rn   r   r   ro   rX   r]   rZ   rO   rO      s      +*))'+H$+r]   c                      ] tR t^t$ RtR]R&   R]R&   ]! ]R7      tR]R&   R	t	R
]R&   ]
! 4       tR]R&   R	tR]R&   ^ tR]R&   ^ tR]R&   ^ tR]R&   ^ tR]R&   ^ tR]R&   ^ tR]R&   RtR]R&   RtR	# )rQ   a,  One target's resolve: its pins, or why it has none.

``lock`` is what this target contributes to the lockfile, and is
present exactly when the resolve succeeded.  ``consulted`` is every
marker the resolve read (root, constraint, and dependency), which is
what the lock declares its environment from.
rC   targetr   successr   dict[str, Version]pinsNzResolutionError | Noneerrorfrozenset[Marker]	consultedzTargetLock | Nonelockrf   	decisionsrounds	conflicts	backjumpsmetadata_fetcheddistributions_seeng        float	wall_timerX   )rj   rk   rl   rm   rn   r   r   r   r   r   	frozensetr   r   r   r   r   r   r   r   r   ro   rX   r]   rZ   rQ   rQ      s     M$T:D
:$(E!(#,;I ."D
"IsFCOIsIscIur]   c                      ] tR tRt$ RtR]R&   ]! ]R7      tR]R&   ]! ]R7      t	R]R&   ]! ]
R7      tR	]R
&   ]R R l4       t]R R l4       tR R ltR R ltRtR# )rP      a  The finished resolve: one :class:`TargetResult` per target per fork.

``base_results`` and ``env_base_names`` are populated only when
conflict forks ran: they record what a no-member resolve of each
environment produced, which is how the lock writer tells a base
dependency from one that only a member requires.  A failed base pass
leaves ``env_base_names`` incomplete, so it counts against
:attr:`success`.
ztuple[ResolveTarget, ...]targetsr   list[TargetResult]target_resultsbase_resultsz"dict[EnvSignature, frozenset[str]]env_base_namesc                   V ^8  d   QhRR/# )rU   rV   r   rX   )rY   s   "rZ   r[   ResolveResult.__annotate__  s     ; ; ;r]   c                    \         ;QJ d&    R V P                   4       F  '       d   K   R# 	  R# ! R V P                   4       4      # )z4Whether every target, and every base pass, resolved.c              3  8   "   T F  qP                   x  K  	  R # 5irw   )r   ).0trs   & rZ   	<genexpr>(ResolveResult.success.<locals>.<genexpr>  s     :(9"::(9   FT)allevery_resultr_   s   &rZ   r   ResolveResult.success  s9     s:(9(9:ss:s:s:(9(9:::r]   c                   V ^8  d   QhRR/# )rU   rV   ztuple[TargetResult, ...]rX   )rY   s   "rZ   r[   r     s     : :6 :r]   c                8    . V P                   OV P                  O5# )z3Every per-target resolve, the base passes included.)r   r   r_   s   &rZ   r   ResolveResult.every_result  s      :$$9t'8'899r]   c                   V ^8  d   QhRR/# rT   rX   )rY   s   "rZ   r[   r     s      4 r]   c                `    V P                    F  pVP                  f   K  VP                  h	  R# )zRe-raise the first target's :class:`ResolutionError`, if any.

For a caller with no per-target reporting of its own (a build-env
resolve, say), a failed target is just a failed resolve.
N)r   r   )r`   r   s   & rZ   raise_for_failureResolveResult.raise_for_failure  s'     ##Bxx#hh $r]   c                   V ^8  d   QhRR/# )rU   rV   z dict[str, list[tuple[str, str]]]rX   )rY   s   "rZ   r[   r   %  s      = r]   c                6   \        \        4      pV P                   Fp  pVP                  '       g   K  VP                  P                  4        F;  w  r4W,          P                  \        V4      VP                  P                  34       K=  	  Kr  	  \        V4      # )zCollapse the per-target pins into ``{package: [(version, label)]}``.

The labels are target ids, not PEP 508 markers; the lockfile
writer is what turns them into markers.
)r   listr   r   r   itemsappendr~   r   labelr   )r`   outr   r}   r   s   &    rZ   merged_pinsResolveResult.merged_pins%  so     8C47H%%B:::$&GGMMO ##S\299??$CD %4 &
 Cyr]   rX   N)rj   rk   rl   rm   rn   r   r   r   r   r   r   r   propertyr   r   r   r   ro   rX   r]   rZ   rP   rP      st     '&).t)DN&D',T'BL$B9>t9TN6T; ; : : r]   config	cache_dirofflineFpython_versiongroupsextrasbuild_requirementsresolution_strategyprogressc               H    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RRRR/# )rU   pathr	   	transportrK   r   NabProjectConfig | Noner   Path | Noner   r   r   r   r   Sequence[str]r   r   r   ResolutionStrategy | Noner   rt   rV   rP   rX   )rY   s   "rZ   r[   r[   4  s     c
 c

c
!c
 $	c

 c
 c
 c
 c
 c
 c
 3c
 "c
 c
r]   c       	           Vf   \        V 4      pV'       d)   V'       g	   V'       d   Rp\        V4      h\        V4      p\        W%4      p\	        V4      pV'       d   \        V 4      ML\        \        V 4      \        V 4      \        V 4      \        V 4      VP                  e   \        V 4      M. R7      p\        WbP                  VP                  4      p\!        V VVV\#        V4      VR7      w  pp\%        T\'        VP(                  4      TT\+        V4      \-        V4      V
e   V
P.                  MRR7      ;_uu_ 4       p\1        VVVVVVV	V
R7      uuRRR4       #   + '       g   i     R# ; i)ay  Resolve the project at ``path`` for every environment it targets.

``config`` defaults to :func:`read_pyproject_config(path)`.  The
caller supplies ``transport`` so the HTTP library choice stays
outside nab-python.  ``cache_dir`` and ``offline`` are runtime
overrides from the CLI; ``python_version`` applies
:func:`~nab_python.config.with_python_override`, moving the resolve
target onto that Python and leaving the rest of the environment
alone.

``groups`` and ``extras`` name PEP 735 groups and
``[project.optional-dependencies]`` keys to fold in;
``resolution_strategy`` overrides ``config.resolution`` when set.

``build_requirements`` resolves ``[build-system].requires`` instead of
the project's dependencies, for a lock of the environment the project
is built in rather than the one it runs in.  Neither ``groups`` nor
``extras`` mean anything there, so passing either raises.

A target that cannot be resolved is a failed :class:`TargetResult`,
not an exception, so a matrix reports every target that failed rather
than only the first.  Everything else (an unreadable pyproject, a
conflicting selection, an unsupported source) raises.
Nz>a build-requirements resolve has no groups or extras to select)dependenciesr   optionalproject_namebuild_requires)r   r   )indexesr   r   index_routesindex_cache_floorsra   )r   r   forksbase_requirementsr   r   )r)   
ValueErrorconfig_for_build_requirementsr,   r(   _tables_for_build_requires_ProjectTablesr;   r<   r>   r=   build_groupr:   active_group_namesdefault_groups
base_group_plan_forkstupler-   r   r   r'   r&   ra   resolve_with_coordinator)r   r   r   r   r   r   r   r   r   r   r   msgr   tableseffective_groupsr   r   coordinators   &&$$$$$$$$$       rZ   resolve_for_targetsr  4  sd   L ~&t,VRCS/!.v6!&9F6"G  	#4(4T:(.9$?,T2 %%1 .d3

 ( *%%v'8'8  +V} E 
V^^$-f59&A&.&:""
 
 
'/ 3	

 
 
 
s   E  E1	r   r   align_across_targetspreferencesc               H    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RRRR/# )rU   r  r-   r   Sequence[ResolveTarget]r   Sequence[Requirement]r   r   r   r   r   zSequence[ResolveFork] | Noner   Sequence[Requirement] | Noner   r   r  r   r  Mapping[str, Version] | Noner   rt   rV   rP   rX   )rY   s   "rZ   r[   r[     s     >
 >
!>
$>
 (>

 $>
 >
 (>
 4>
 3>
 >
 .>
 ">
 >
r]   c                  Ve   TM	\        4       p\        WK4      ;_uu_ 4       p\        T TTTVe   TMVP                  V
R7      pVe   \	        V4      M\        R\        V4      4      .pVP                   Uu. uF  p\        V4      NK  	  pp\        \	        V4      VVVV	V4      uuRRR4       # u upi   + '       g   i     R# ; i)a  Resolve ``targets`` against an already-open coordinator.

Splitting this from :func:`resolve_for_targets` lets a caller (and
every test) drive the engine from requirements it holds, reusing one
coordinator across resolves and skipping the pyproject read.

With ``forks`` every target is resolved once per fork, each fork's
``selection`` stamped onto the target; without them the resolve runs
once per target against ``requirements``.

``align_across_targets`` threads each target's pins forward as
preferences for the next, so a package the matrix does not force
apart keeps one version across targets.  ``preferences`` seeds that,
e.g. from a previous lock.

``base_requirements`` are the no-member requirements (the project
deps plus any non-conflicting selection).  When given, a final base
pass resolves them per target so the lock writer can tell a true base
dependency from one required by every member; pass it only when
conflict forks ran.
N)r  r   source_rootalign
resolutionr   rX   )
r#   _source_root_EngineSettingsr  r   rO   r   constraintsr   _resolve_with_micro_narrowing)r  r   r   r   r   r   r   r   r  r  r   	effectiver  settings	fork_listtextr  s   &&&$$$$$$$$      rZ   r   r     s    F !,2B2DI	i	+	+{"##& '2 $))
 !,DK;r5CV3W2X 	 6?5J5JK5JT{4(5JK,M
' 
,	+" L# 
,	+	+s   AB79B2B72B77C	c               $    V ^8  d   QhRRRRRR/# )rU   r   r   r   r#   rV   zIterator[Path | None]rX   )rY   s   "rZ   r[   r[     s$      $4r]   c              #     "   V f%   VP                   '       g   VP                  '       g   V x  R# \        P                  ! RRR7      ;_uu_ 4       p\	        V4      x  RRR4       R#   + '       g   i     R# ; i5i)zYield the directory a declared VCS or archive source materialises under.

With caching off there is no cache root, but the source still has to
be materialised to read its version and dependencies, so the run gets
a temporary directory instead.
Nznab-sources-T)prefixignore_cleanup_errors)vcs_sourcesarchive_sourcestempfileTemporaryDirectoryr	   )r   r   scratchs   && rZ   r  r    sd      V%7%7%76;Q;Q;Q		$	$T
 
	7m
 
 
 
s'   A=A=&A=A)
A=)A:	4	A=c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# rU   r   r  r  Sequence[ResolveFork]r  r  r  r  r  r	  r   r  rV   rP   rX   )rY   s   "rZ   r[   r[     sN     6 6$6$6 '6 	6
 .6 46 6r]   c                |   \        WW#WE4      pV  Uu. uF  p. NK  	  ppTp	\        \        4       Fj  p\        WV	4      p
V
f   V	u # T
p\	        WRR7       UUu0 uF  w  rV'       g   K  \        V4      kK  	  ppp\        V VVVVVVV4      p\        WW4      p	Kl  	  R\         R2p\        V4      hu upi u uppi )a>  Resolve ``targets``, then split any minor a marker cut and re-resolve.

A consulted marker can cut a minor's micro line
(``python_full_version < "3.10.2"``).  Resolving the minor once at its
synthesized ``.0`` declares the whole minor by how ``.0`` read the clause,
excluding the real interpreters on the other side.  Resolving one target
per micro slice instead lets each slice declare its own environment row and
pins.

The split points come from the markers a resolve consulted, so a boundary
reachable only above an earlier split is not visible until that slice has
been resolved.  The loop is a fixpoint: it re-splits and re-resolves until a
pass reveals no new boundary.  Only a minor that split is re-resolved; every
target no marker cut (host targets among them, since they name a real micro)
keeps its first-pass result.
Tstrictz9environment micro-boundary splitting did not converge in z passes)	_resolve_passesrange_MAX_MICRO_SPLIT_PASSES_grow_micro_pointszipenv_signature_resolve_slices_merge_micro_resultsr   )r   r  r  r  r  r   result_pointscombinedgrownr   target_points
split_sigsslice_resultr   s   &&&&&&          rZ   r  r    s    0 K;F 07"7w!2wF"7H*+"7H==O *-WT)J
)J% "M&!)J 	 

 '	
 (R) ,,	#$G	-  #
7 #8
s   B3B8*B8c               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# )rU   r   r  r/  Sequence[Sequence[Version]]r  r!  r  r  r  r  r  r	  r   r  
first_passrP   rV   rX   )rY   s   "rZ   r[   r[   4  sm     @ @$@'@ %@ '	@
 @ .@ 4@ @ @r]   c           
     v   \        WRR7       UU	u. uF  w  rV	'       d   \        W4      M. NK  	  p
pp	\        T;'       g    / 4      p. p\        V4       EF  w  rVP                  V\        V 4      ,          V^,           \        V 4      ,           p\        WRR7       F  w  ppV'       g   \        VV.VP                  R7      pK)  V Uu. uF2  pVP                  '       d   VP                  VP                  4      MTNK4  	  pp\        VVP                  VVVVP                  4      pVP                  V4       \        VVVP                  R7      pK  	  EK  	  V
 UUu. uF  pV F  pVNK  	  K  	  ppp\        TYcYE;'       g    / 4      w  pp\        \!        V4      VVVR7      # u up	pi u upi u uppi )aU  Resolve every split target's slices, one pass per fork.

A fork's pass walks the whole matrix in order: a split target has its
slices resolved, and an unsplit target folds its first-pass pins in where
it sits rather than resolving a second time.  Alignment therefore threads
through the slices in matrix order, as it does in the first pass.
Tr#  r  r   r   r   r   )r)  rG   r   	enumerater   len_threaded_preferencesr  r   with_selection	_run_passr   r   extend
_base_passrP   r   )r   r/  r  r  r  r  r   r7  r   r2  slicedaccumulatedresultsindexfork
fork_firsttarget_slicesfirst_resulttfork_slicespass_resultsgroup
all_slicesr   r   s   &&&&&&&&                 rZ   r+  r+  4  s   & &)%F%F!F 6C61J%F  
 {((b)K"$G +..CL EAIW#=

 ,/v$+O'M< 3,x~~  '&A 59NNN  0I&   %!!L NN<(/\K+ ,P ,> "(7A!!J7#-%H>O>OR$ L. j!!%	 U($ 8s    F*F0#!F0!F5c               (    V ^8  d   QhRRRRRRRR/# )	rU   r   r  r/  r6  r-  rP   rV   zlist[list[Version]] | NonerX   )rY   s   "rZ   r[   r[   w  s0     & &$&'& &  	&r]   c                   \        \        4      pVP                   F>  pV\        VP                  4      ;;,          \        VP
                  4      ,          uu&   K@  	  . pRp\        WRR7       F  w  rx\        V4      p	\        Wx4       F@  p
VP                  \        V
4      \        4       4      pV	P                  \        W{4      4       KB  	  \        V	4      pV\        V4      8w  d   RpVP                  V4       K  	  V'       d   V# R# )aD  Return ``points`` grown by the boundaries ``result`` consulted, or None.

None means no minor gained a split point: the fixpoint has settled.  Each
target's boundaries are gathered from every slice it currently has, so a
boundary a marker consults only above an earlier split is picked up once
that slice has been resolved.
FTr#  N)r   setr   r*  r   r   r)  rG   getupdaterF   sortedr   r   )r   r/  r-  consulted_by_sigr   r1  changedr   r2  foundrB  r   ordereds   &&&          rZ   r(  r(  w  s     9DC8H!!ryy12c",,6GG2 " "$EG!$WT!BM"(?F(,,]6-BCEJILL.vAB @ -d=))GW "C 5%%r]   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	rU   r   r  r-  rP   r4  r3  zset[EnvSignature]rV   rX   )rY   s   "rZ   r[   r[     s:      $   "	
 r]   c                  a R V3R llpVP                   P                  4        UUu/ uF  w  rVVS9  g   K  WVbK  	  pppVP                  VP                   4       \        ;QJ d    . V3R lV  4       F  NK  	  5M! V3R lV  4       4      p\	        . VOVP
                  O5V! VP                  4      \        VP                  4      ,           V! VP                  4      \        VP                  4      ,           VR7      # u uppi )a  Fold ``slice_result`` back over the first-pass ``result``.

A target that split is dropped from ``result`` (its ``.0`` entry and its
base pass) and its slices are taken from ``slice_result`` instead; every
unsplit target keeps its first-pass entry, so it is never resolved again.
c                    V ^8  d   QhRRRR/# )rU   rD  Sequence[TargetResult]rV   r   rX   )rY   s   "rZ   r[   *_merge_micro_results.<locals>.__annotate__  s      T T, T1C Tr]   c                j   < V  Uu. uF!  p\        VP                  4      S9  g   K  VNK#  	  up# u upi rw   )r*  r   )rD  r   r3  s   & rZ   kept"_merge_micro_results.<locals>.kept  s-    $SWrbii(@
(RWSSSs   00c              3  L   <"   T F  p\        V4      S9  g   K  Vx  K  	  R # 5irw   )r*  )r   rJ  r3  s   & rZ   r   '_merge_micro_results.<locals>.<genexpr>  s     Mw!-*:**LAAws   $
$r:  )	r   r   rS  r   rP   r   r   r   r   )	r   r-  r4  r3  r_  signamesr   unsplits	   &&&f     rZ   r,  r,    s    T T
 !//5577JCj  	
7  
 ,556eMwMeeMwMMG1'1L001F112T,:U:U5VV&--.l6O6O1PP%	 s
   D D c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# r   rX   )rY   s   "rZ   r[   r[     sN     ( ($($( '( 	(
 .( 4( (r]   c           	        \        T;'       g    / 4      p. pV F  pV  U	u. uF1  qP                  '       d   V	P                  VP                  4      MT	NK3  	  p
p	\        V
VP                  VVVVP
                  4      pVP                  V4       \        WkVP                  R7      pK  	  \        YY#T;'       g    / 4      w  r\        \        V 4      VVVR7      # u up	i )zResolve every fork against every target, plus the base pass.

The fork loop threads each target's pins forward across the whole run;
the base pass, when given, records the no-member pins per environment.
r9  r:  )r   r   r>  r?  r   r   r@  r=  r  rA  rP   r   )r   r  r  r  r  r   rC  rD  rF  rJ  fork_targetsrL  r   r   s   &&&&&&        rZ   r%  r%    s     {((b)K"$GOV
OV!AT^^,AEw 	 
 !MM
 	|$+X^^
 " $.K;;L;L"$ L g!%	 '
s   7Cc               0    V ^8  d   QhRRRRRRRRR	R
RR/# )rU   r   r  r   r  r  r  r  r  r  Mapping[str, Version]rV   z=tuple[list[TargetResult], dict[EnvSignature, frozenset[str]]]rX   )rY   s   "rZ   r[   r[     sE      #  #$ #3 # ' # 	 #
 ' # C #r]   c                P   Vf   . / 3# \        \        V 4      WW44      p/ pV F~  pVP                  '       d5   \        R VP                   4       4      V\        VP                  4      &   KI  \        P                  RVP                  P                  VP                  4       K  	  WV3# )zResolve the no-member requirements per target, if there are any.

The pass names the deps that install regardless of which member is chosen,
so the writer keeps the membership clause on a dep required only by members.
c              3  8   "   T F  p\        V4      x  K  	  R # 5irw   r   r   r   s   & rZ   r   _base_pass.<locals>.<genexpr>  s      A4;D!$''Gr   z)Base attribution skipped for tuple %s: %s)r?  r   r   r   r   r*  r   r   warningr   r   )r   r   r  r  r  rD  r   r   s   &&&&&   rZ   rA  rA    s      2vW(xG :<N:::7@ A46GGA 8N=34 OO;		  ""r]   c               (    V ^8  d   QhRRRRRRRR/# )rU   r   r   r   r   r   rV   tuple[str, ...]rX   )rY   s   "rZ   r[   r[     s0     4 44!4 4 	4r]   c                   a \         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      p\        \        P                  . V OVO54      4      # )a  Return the ``[dependency-groups]`` names this run activates, in order.

``base-group`` may be named in ``default-groups`` to keep the
project's own dependencies in the default selection.  Its
requirements are ``[project].dependencies``, which are roots already,
so it is dropped here rather than looked up as a declared group.
``groups`` is this run's ``--groups`` selection and keeps the name, so
selecting a group the project does not declare still raises.
c              3  T   <"   T F  pSe   \        V4      S8w  g   K  Vx  K  	  R # 5irw   r   )r   r   r   s   & rZ   r   %active_group_names.<locals>.<genexpr>  s-      "D!24!8J!F 	"s   (
()r   r   fromkeys)r   r   r   policys   &&f rZ   r   r     sP     U "UU " F
 11&1233r]   dependency_groups
created_bynabc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )rU   r-  rP   r   r   r   r   rw  rx  r~   rV   r.   rX   )rY   s   "rZ   r[   r[     sF     5 55 $5 	5
 %5 5 5r]   c               d   Ve   TM	\        4       p/ p/ p. pV P                   F  p	V	P                  f   K  V	P                  WiP                  P                  &   \        V	P                  4      p
W9  d(   \        4       Wz&   VP                  V	P                  4       Wz;;,          V	P                  ,          uu&   K  	  \        V\        V P                  4      \        W4      VP                  V\        V4      \        V4      VP                  VP                   VP"                  VP$                  R7      # )a  Assemble the lock input from a finished resolve.

Every target that resolved contributes its pins, its forward
dependency edges, and the environment it declares (see
:func:`_declared_environments`).  A target that failed contributes
nothing, so callers that want the whole matrix represented check
``result.success`` first.

``extras`` and ``dependency_groups`` are this run's selection, which
the lock records at the top level;  ``default-groups``, the declared
conflicts, and ``base-group`` are project policy and come from
``config``.
)r   r   environmentsrequires_pythonrx  r   rw  r   r   r   r   )r#   r   r   r   r   r*  rQ  r   r   r.   r   r   _declared_environmentsr}  r   r   r   r   r   )r-  r   r   rw  rx  r  r   r   	declaringr   	signatures   &$$$$      rZ   build_lock_inputr    s    * !,2B2DI%'G13I%'I##77?#%77		 
 "")),	%#&5I RYY', $  F112+IA!11V} 12 //%%'')) r]   c                    V ^8  d   QhRRRR/# )rU   r   rC   rV   EnvSignaturerX   )rY   s   "rZ   r[   r[   P  s     4 4- 4L 4r]   c                Z    \        \        V P                  P                  4       4      4      # )z2Return ``target``'s environment as a hashable key.)r   rT  
marker_envr   )r   s   &rZ   r*  r*  P  s!    ))//1233r]   c               $    V ^8  d   QhRRRRRR/# )rU   r  r  r   z"Mapping[EnvSignature, set[Marker]]rV   zlist[Marker]rX   )rY   s   "rZ   r[   r[   U  s&     6 6&616 6r]   c                t   \        4       pVP                  4        F'  pV F  pV\        \        V4      4      ,          pK   	  K)  	  \	        V\
        ,          4      pV'       d&   \        P                  RRP                  V4      4       V  Fr  pVP                  R8X  d   K  \        4       pV\        V4      ,           F  pV\        \        V4      4      ,          pK   	  RV9   g   K]  \        P                  R4        M	  V  Uu. uF'  p\        \        Wa\        V4      ,          4      4      NK)  	  up# u upi )a  Build the lock's PEP 751 ``environments``, one per environment.

The pins hold for the environments the resolve targeted, so the lock
says so: every dependency whose marker was False on a target was
dropped there, and an installer that answers one of those markers
differently needs a different package set.  Each declaration is built
from the markers that target's resolve actually read (see
:func:`~nab_python.target.environment_declaration`).

A marker on an axis the lock cannot bound (see
:data:`~nab_python.target.UNBOUNDABLE_MARKER_VARIABLES`) is reported:
the lock stays open on it, so an installer whose kernel differs will
still accept the lock, with the dep that marker gated missing.  A marker
on ``implementation_version`` under a non-CPython target is reported the
same way (see :func:`~nab_python.target.unboundable_variables`): the
value there is synthetic, so the lock leaves the axis open.
zA marker in this resolve consults %s, which names the resolving machine's kernel build; the lockfile cannot declare it, so an installer whose value differs will still accept this lock and miss the dependencies that marker gates., cpythonimplementation_versiona2  A marker in this resolve consults implementation_version on a non-CPython target; the value nab uses there is the Python level, not the interpreter's release, so the lockfile leaves that axis open and an installer whose value differs will still accept this lock and miss the dependencies that marker gates.)rQ  valuesrE   r~   rT  rA   r   ro  joinimplementationr*  r   rD   )r  r   	variablesmarkersmarkerunboundabler   consulted_namess   &&      rZ   r~  r~  U  s   * %I##%F)#f+66I  & %AABK8 IIk"	
   I-$'Ef 566F/F<<O 7#6OO  $  F 	&vv9N/OPQ  s   -D5c                      ] tR tRt$ RtR]R&   R]R&   R]R&   R	]R
&   R]R&   RtR]R&   ]! ]R7      t	R]R&   ]! ]
R7      tR]R&   RtR# )r  i  z0What every per-target resolve in one run shares.r-   r  r#   r   r   r  r   r  r3   r  Nrt   r   r   r1   listing_filter_cacheset[str]warned_root_markersrX   )rj   rk   rl   rm   rn   r   r   r   r1   r  rQ  r  ro   rX   r]   rZ   r  r    sU    :!! K""$(H!( 05EW/X,X %*#$>>r]   r  c                  `    ] tR tRt$ RtR]R&   R]R&   R]R&   R	]R
&   ]! ]R7      tR]R&   Rt	R# )r   i  z0The pyproject tables a resolve reads, read once.list[Requirement]r   /Mapping[str, Sequence[str | Mapping[str, str]]]r   Mapping[str, Sequence[str]]r   r   r   r   r   rX   N)
rj   rk   rl   rm   rn   r   r   r   r   ro   rX   r]   rZ   r   r     s2    :##;;))(-d(CN%C:r]   r   c               $    V ^8  d   QhRRRRRR/# )rU   r   r#   r   r   rV   z9tuple[_ConfiguredContext, tuple[_ConfiguredContext, ...]]rX   )rY   s   "rZ   r[   r[     s$      &4>r]   c                    \        V P                  \        VP                  4      4      pV P                  e+   \        V P                  \        VP
                  4      4      3MRpW#3# )zSplit the configured install contexts into the project's and the rest.

The project's own dependencies are always a context, named or not.  The
build requirements are one only when ``build-group`` names them, which
is also the only time they were read.
rX   )r   r   r   r   r   r   )r   r   r   r   s   &&  rZ   _configured_contextsr    sb     !!2!2E&:M:M4NOG ) 
F..f6K6K0L	MO 
 r]   c               (    V ^8  d   QhRRRRRRRR/# )	rU   rF  r   r   r   r   Sequence[_ConfiguredContext]rV   z>tuple[tuple[Requirement, ...], tuple[_ConfiguredContext, ...]]rX   )rY   s   "rZ   r[   r[     s1      
 , D	r]   c                   a  \         ;QJ d    . V 3R lV 4       F  NK  	  5M! V 3R lV 4       4      pVP                  e   VP                  S P                  9   d   VP                  V3# RV3# )zReturn the configured contexts ``fork`` resolves, project first.

An unnamed context cannot be a conflict member, so every fork carries
it; a named one is carried only by the fork that chose it.
c              3  `   <"   T F#  qP                   SP                  9   g   K  Vx  K%  	  R # 5irw   )r   active_configured)r   crF  s   & rZ   r   _carried_by.<locals>.<genexpr>  s"     My!FFd6L6L,LAAys   .
.rX   )r   r   r  r   )rF  r   r   carrieds   f&& rZ   _carried_byr    sY     eMyMeeMyMMG||w||t/E/EE##W,,w;r]   c                    V ^8  d   QhRRRR/# )rU   r   r	   rV   r   rX   )rY   s   "rZ   r[   r[     s      T n r]   c                2    \        \        V 4      / / RR7      # )zRead ``path`` as a project whose dependencies are its build requirements.

``[build-system].requires`` is one flat list, so the group and extra
tables are empty, and the project name with them: it is read only to
expand self-referencing extras.
N)r   r   r   r   )r   r:   )r   s   &rZ   r   r     s"     248	 r]   c                    V ^8  d   QhRRRR/# )rU   r   r#   rV   rX   )rY   s   "rZ   r[   r[     s      *: ?O r]   c                "    \        V RRRRR7      # )a:  Return ``config`` with the settings a build-requirements lock cannot use.

``default-groups`` and the conflicts declared over groups and extras
describe a selection ``[build-system].requires`` does not have, and
``base-group`` names the project's own dependencies, which a build
lock holds none of.  Left in they fail the run rather than narrow it:
:func:`_tables_for_build_requires` supplies no group or extra table
for them to resolve against.  ``build-group`` goes too: a lock whose
roots already are the build requirements has no second context to
gate them behind.
N)r   r   r   r   rX   )r   )r   s   &rZ   r   r     s       r]   c               (    V ^8  d   QhRRRRRRRR/# )rU   rC  r   rD  r\  r  r   rV   rX   )rY   s   "rZ   r[   r[     s0      ## 	
 r]   c                   V'       g   V # V F2  pVP                   '       g   K  V P                  VP                  4       K4  	  V # )zBFold a pass's pins into the preferences the next pass starts from.)r   rS  r   )rC  rD  r  r   s   &&$ rZ   r=  r=    s:     :::rww'  r]   c               4    V ^8  d   QhRRRRRRRRRR	R
RRR/# )rU   r   r  r   r  r  r  r  r  rj  r   r   rV   r   rX   )rY   s   "rZ   r[   r[     sN      $' ' 	
 ' % r]   c           	         . p\        V4      pV  F9  p\        WW#Wu4      p	VP                  V	4       \        Wy.VP                  R7      pK;  	  V# )aW  Resolve every target in ``targets`` once, in order.

With alignment on, each target's pins are threaded forward as
preferences for the next, so the pins stay aligned across targets
wherever the environments admit it.

``contexts`` splits ``requirements`` into the install contexts the
lock gates its packages on; see :class:`InstallContexts`.
r9  )r   _resolve_one_targetr   r=  r  )
r   r   r  r  r  r   rD  rC  r   r   s
   &&&&&&    rZ   r?  r?    sU    " #%G{#K +
 	r+KX^^T  Nr]   c               4    V ^8  d   QhRRRRRRRRRR	R
RRR/# )rU   r   rC   r   r  r  r  r  r  rj  r   r   rV   rQ   rX   )rY   s   "rZ   r[   r[   "  sW     n nn'n 'n 	n
 'n %n nr]   c                   VP                   pV P                  p \        VVVVP                  R7      w  rp
\        VVVRVP                  R7      P                  p\        Y4       TP                  p\        TP                  3/ RT bRT	bR	TbR
T
bRTP                  bRTP                  bRTP                  bRTP                  bRTP                  bRTP                   bRTP"                  bR\%        TP&                  4      ;'       g    RbR\%        TP(                  4      ;'       g    RbRTe   T\*        ,          MRbR\%        TP,                  4      ;'       g    RbRTe   T\.        ,          MRbRTbRTP0                  bRTP2                  bR\5        R T	 4       4      bR\7        T4      bRTP8                  b p\;        TP<                  4      p\?        TT\@        RTPB                  R7      p\D        PG                  R T PH                  4       \J        PL                  ! 4       p TPO                  YR!7      pTPQ                  4        UUu/ uF  w  pp\S        T4      ^,          e   K  TTbK!  	  ppp\U        YT4       \J        PL                  ! 4       T,
          p\D        P[                  R%\]        T4      T PH                  TTP^                  P`                  TP^                  Pb                  4       \e        YW4      w  pp\        R+RT R"R&R'TR(\g        YT4      R)\i        TT TTP                  Pj                  TTTR*7      R$T/\Y        TT4      B #   \
         d   p\        T RTR7      u Rp?# Rp?ii ; iu uppi   \
         dM   p\W        Y4       \        R+RT R"RR#TR$\J        PL                  ! 4       T,
          /\Y        TT4      B u Rp?# Rp?ii ; i),z2Run one single-environment resolve for ``target``.)environmentwarned
constraint)r  kindr  F)r   r   r   Nr   root_requirementsr  root_extrasuploaded_prior_todist_policybuild_policypackage_overridesindex_overridestrust_unverified_sdist_deps
vcs_configlocal_sourcesr  vcs_cache_dirr  archive_cache_dirbuild_configdecision_orderr   direct_packagesc              3  R   "   T F  p\        V4      ^,          e   K  Vx  K  	  R# 5i)   N)r5   rm  s   & rZ   r   &_resolve_one_target.<locals>.<genexpr>X  s"      "
2Tk$6G6JDD2s   '
'r  r  0)observer
range_typeroot_versionformat_rangezresolving %s)r  r   r   r   zHresolved %d packages for %s in %.2fs (%d distributions seen, %d fetched)Tr   r   r   )r   resolved_keys
base_rootsselector_rootsrX   )6r   r  _build_resolver_inputsr  rangesr   rQ   _extend_constraints_to_proxiesr  r2   r  r  r  r  r  r  r  vcsr   r  r  r   r  r   r  r  r   r   r  rq   r   r   r   r  r   r   r   time	monotonicresolver   r5   _raise_for_source_python_augment_resolution_error_target_statsinfor<  statsr   r   _install_context_roots_consulted_markersr0   r   )r   r   r  r  r  r   r   r  r  resolver_requirementsr  resolver_constraintsexcr  providerr  resolverstartrawkvr   elapsedr  r  s   &&&&&&                   rZ   r  r  "  s*    __F##KE@V#//	A
=+  6#// 
 & 	 ##7E&&K 0 )	
   !22 && (( !22 .. %+$F$F :: 6//088D ++,44 3>2IkJ.t  V334<<!$ -8,CK.(%( )* ,,+, %//-. " "
2"
 
/4 %56 &::7H:   1 12H'/**(H MM.&,,/NNE
0S!$JAAq0A1J 48 nn&GLLRD	))'' "8!NJ   %X[I	
 ((00!)
  (
+ K  E65DDE` K 
!#0 


 
 nn&.	

 Hh/
 	

sU   A M &%M9 M3)M30M9 M0M+%M0+M03M9 9OAOOOc               $    V ^8  d   QhRRRRRR/# )rU   r   r   r  Mapping[str, str]rV   zJtuple[frozenset[str] | None, dict[tuple[str, str], frozenset[str]] | None]rX   )rY   s   "rZ   r[   r[     s$      $3DOr]   c           
         V e%   V P                   '       g   V P                  '       g   R# \        V P                  V4      V P                   P	                  4        UUu/ uF  w  r#V\        W14      bK  	  upp3# u uppi )ah  Return the lock writer's install-context roots for one target.

``(None, None)`` when nothing needs attributing, which leaves every
package unconditional: no selection to name, and no name for the
project's own dependencies either.  A requirement whose marker this
target's environment fails is dropped, exactly as the resolve dropped
it, so it gates nothing.
)NN)r   r   
_root_keysr   r   )r   r  memberr   s   &&  rZ   r  r    s~      2 2 2h6K6K6K8##[1 )1(:(:(@(@(B	
(B$ J|99(B	
 	
s   A9c               $    V ^8  d   QhRRRRRR/# )rU   r   r  r  r  rV   zfrozenset[str]rX   )rY   s   "rZ   r[   r[     s$      '6Gr]   c                @  a \        4       pV  F  pVP                  e   \        VP                  V4      '       g   K/  \        \	        VP
                  4      4      oVP                  S4       VP                  V3R lVP                   4       4       K  	  \        V4      # )a   Return the resolver keys ``requirements`` names directly.

The same shape :func:`_build_resolver_inputs` feeds the resolver: a
canonical name per requirement, plus a ``name[extra]`` proxy key per
requested extra, with marker-excluded requirements dropped.
c              3  <   <"   T F  p\        SV4      x  K  	  R # 5irw   )r4   )r   extrar   s   & rZ   r   _root_keys.<locals>.<genexpr>  s     DJtU++s   )
rQ  r  r   r~   r   r   addrS  r   r   )r   r  keysreqr   s   &&  @rZ   r  r    s|     UD::!*AJJ+
 +
 $SXX./DDD  T?r]   c               (    V ^8  d   QhRRRRRRRR/# )rU   r  r2   r   r  r  rV   r   rX   )rY   s   "rZ   r[   r[     s0         '  '  	 r]   c                    \        V P                  4      p\        P                  ! W4       F.  pVP                  f   K  VP                  VP                  4       K0  	  \        V4      # )zEvery PEP 508 marker this resolve read.

The provider records the markers it read off the dependency graph;
the root requirements and constraints are collected here, since their
markers are evaluated before the provider exists.
)rQ  consulted_markers	itertoolschainr  r  r   )r  r   r  r   r  s   &&&  rZ   r  r    sN     H../I|9::!MM#**% : Yr]   c               $    V ^8  d   QhRRRRRR/# )rU   r  zResolver[str, Version]r  r2   rV   zdict[str, int]rX   )rY   s   "rZ   r[   r[     s$      $08r]   c                   RV P                   P                  RV P                   P                  RV P                   P                  RV P                   P                  RVP                   P
                  RVP                   P                  /# )zFReturn the resolver and provider counters for a :class:`TargetResult`.r   r   r   r   r   r   )r  r   r   r   r   r   r   )r  r  s   &&rZ   r  r    sh    
 	(..''X^^--X^^--X^^--HNN;;hnn?? r]   c               4    V ^8  d   QhRRRRRRRRR	R
RR
RR/# )rU   r   r	   r   r   r   r#   r   r  r   rq  r   rV   z2tuple[list[ResolveFork], list[Requirement] | None]rX   )rY   s   "rZ   r[   r[     sW     \$ \$
\$\$ \$ %	\$ \$ \$ 8\$r]   c               N   \        V4      p\        W!4      w  rxVP                  '       d^   \        VP                  VP                  VP
                  V4       \        VP                  VV. \        VP
                  V4      OVOV4       \        WEVP                  V4      p	. p
\        4       pV	 EF0  pVP                  '       d=   \        VP                  VVP                  . VP                  OVP                  O5V4       \        VP                  4      ^8  dX   VP                  V9  dG   VP                  VP                  4       \!        \#        VP
                  VP                  V 4      V4       \%        WV4      w  rV
P'                  \)        VP*                  \-        \/        WWVR7      4      \1        V\3        WWR7      VP4                  RJR7      R7      4       EK3  	  Rp\        V	4      ^8  d1   \7        V	^ ,          4      p\%        VWx4      w  pp\/        WVVVR7      pW3# )a|  Plan the resolves a selection needs, and the base pass they need.

An engaged conflict forks whether or not a matrix is declared: one
resolve per choice of member, each carrying its own requirements,
with the member stamped onto the selection so its pins land under a
membership-gated marker.  The exclusion check below still refuses a
selection that reaches two members of a set without directly
selecting either (an umbrella extra or group), since a fork can only
carry a directly-selected member.

The second element is the no-member requirement list, needed only
when the plan actually forked; see :func:`resolve_with_coordinator`.
)r   r   )r   N)r   r   r   )r   r   r   )r$   r  r    _validate_conflict_members_existr   r   _check_conflict_minimumsr7   r%   rQ  _check_conflict_exclusionsactive_extrasactive_groupsr  r<  r  _check_group_disjointness_group_requirements_by_groupr  r   rO   r   r   _fork_requirementsrM   _selector_requirementsr   
_base_fork)r   r   r   r   r   r   
configuredproject_contextselector_contextsplanr   scanned_group_selectionsrF  r   r  r   	base_forkbase_projectbase_carrieds   &&&&$$             rZ   r   r     s   , (/J)=f)M&O(foov}}j	
 	!H#FMM6:HZH	
 &&*:*:JGD!E 69U&  "">$$$>t'='=> ""#a'""*BB$((););<%,V]]D<N<NPTU
 't>OP.."&dw
 )#4d "(!2!2$!>	
+ T 
4y1}tAw'	%0&
"l /)\\
 ##r]   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )rU   r   r	   r   r   rF  r   r   r  rV   z.dict[tuple[str, str], tuple[Requirement, ...]]rX   )rY   s   "rZ   r[   r[   =  s:     " "
"" "
 +" 4"r]   c                  / pV F6  pVP                   V\        P                  P                  VP                  3&   K8  	  VP
                   FI  p\        P                  P                  \        \        V4      4      3p\        \        W.V 4      4      WG&   KK  	  VP                   FT  p\        P                  P                  \        \        V4      4      3p\        \        VP                  V.V 4      4      WG&   KV  	  V# )aE  Split a fork's active extras and groups into one requirement list each.

The lock writer walks the resolved graph from each of them to gate
the packages only that extra or group reaches.  A member of the
fork's own ``selection`` is a selector like any other: a package it
shares with another active selection has to name both, or the lock
carries only the other one's clause and an install that selects the
member alone misses the package.

A group named in ``default-groups`` is here like any other: PEP 751
seeds ``dependency_groups`` from ``default-groups`` when the
installer selects none, so the gate still holds for a default
install.

A configured context is a selector no run selects, and only a fork
that carries it gets one: a fork that did not resolve the build
requirements must not claim an install context it never walked.
)r   r    GROUPvaluer   r  EXTRAr~   r   r   _extra_requirementsr  _group_requirementsr   )	r   r   rF  r   r   contextr  r  rM  s	   &&&$     rZ   r  r  =  s    2 ACI>E>R>R	<%%++W\\:; ##$$**C0A%0H,IJ!"5fgt"LM	 $ ##$$**C0A%0H,IJ!"5fmmeWd"ST	 $ r]   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )rU   r   r	   r   r   rF  r   r   r  r   r  rV   r  rX   )rY   s   "rZ   r[   r[   b  sD      
 
 # , r]   c                  \        V4      pV F  pVP                  VP                  4       K   	  VP                  \        VP                  VP
                  V 4      4       VP                  \        WP                  V 4      4       V# )al  Fold one fork's contexts, groups and extras into one requirement list.

Each fork resolves a different slice of the selection (one member per
engaged conflict set), so its requirement list is built separately
rather than shared.  ``project`` and ``selectors`` are the configured
contexts this fork carries, empty where a declared conflict put one in
another fork.
)r   r@  r   r  r   r  r  r  )r   r   rF  r   r   r   r  s   &&&$$  rZ   r  r  b  so      =LG001 +FMM4;M;MtTU+F4F4FMNr]   c                    V ^8  d   QhRRRR/# )rU   	referencer   rV   rX   )rY   s   "rZ   r[   r[   z  s      , < r]   c                  a \        V P                  4      o\        ;QJ d!    . V3R lV P                   4       F  NK  	  5M! V3R lV P                   4       4      p\        ;QJ d!    . V3R lV P                   4       F  NK  	  5M! V3R lV P                   4       4      p\        ;QJ d!    . V3R lV P
                   4       F  NK  	  5M! V3R lV P
                   4       4      p\        RVVVR7      # )a%  Return the no-member fork: a reference fork minus its chosen members.

Every fork shares the same non-conflicting base selection, so any
fork's active sets with its own chosen members removed recover that
base.  Resolving it names the deps that install regardless of which
member is selected.
c              3  n   <"   T F*  p\         P                  P                  V3S9  g   K&  Vx  K,  	  R # 5irw   )r    r  r  )r   echosens   & rZ   r   _base_fork.<locals>.<genexpr>  3      (A$$a(6 	
(   #5
5c              3  n   <"   T F*  p\         P                  P                  V3S9  g   K&  Vx  K,  	  R # 5irw   r    r  r  r   gr  s   & rZ   r   r     r!  r"  c              3  n   <"   T F*  p\         P                  P                  V3S9  g   K&  Vx  K,  	  R # 5irw   r$  r%  s   & rZ   r   r     s3      ,A$$a(6 	
,r"  )r   r  r  r  rX   )rQ  r   r   r  r  r  r   )r  rest_extrasrest_groupsrest_configuredr  s   &   @rZ   r  r  z  s     $$%F% ((%% (( K
 % ((%% (( K
 e ,,ee ,, O
 !!)	 r]   c               (    V ^8  d   QhRRRRRRRR/# )	rU   r   r  selectedr   r   r	   rV   r  rX   )rY   s   "rZ   r[   r[     s0     < <;<< < 	<r]   c                v    V'       g   . # V '       g   RV R\        V4      : 2p\        V4      h\        W4      # )z{Expand ``selected`` PEP 735 groups from an already-read table.

``path`` is used only for the missing-table error message.
z9groups requested but [dependency-groups] is missing from : )rT  LookupErrorr?   )r   r,  r   r   s   &&& rZ   r  r    sG     	vRx(+- 	 #)&;;r]   c               (    V ^8  d   QhRRRRRRRR/# )	rU   r   r  r,  r   r   r	   rV   zdict[str, list[Requirement]]rX   )rY   s   "rZ   r[   r[     s6     U U;UU U "	Ur]   c           	     F    V Uu/ uF  q3\        W.V4      bK  	  up# u upi )z@Like :func:`_group_requirements`, but keyed by the source group.)r  )r   r,  r   rM  s   &&& rZ   r  r    s+     LTT8%&vw==8TTTs   c               (    V ^8  d   QhRRRRRRRR/# )	rU   r   r   r,  r   r   r	   rV   r  rX   )rY   s   "rZ   r[   r[     s2     U UU&3U;?UUr]   c                    V'       g   . # V P                   '       g   RV R\        V4      : 2p\        V4      h\        V P                   V P                  V4      # )a  Flatten ``selected`` extras to requirements.

A self-reference (``{project_name}[a, b]`` inside an extra's contents)
is walked transitively, and its PEP 508 marker is carried onto the
requirements it reaches, so a marker-gated self-reference activates
its extra only on the targets whose environment satisfies it (see
:func:`~nab_python.requirements_file.expand_extra_requirements`).
zEextras requested but [project.optional-dependencies] is missing from r.  )r   rT  r/  r6   r   )r   r,  r   r   s   &&& rZ   r  r    s[     	???!F"VH%5$8: 	 #$V__f6I6I8TTr]   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )rU   r   Sequence[ConflictSet]r   r  r   r  configured_groupsr   rV   rW   rX   )rY   s   "rZ   r[   r[     s:      $) < %	
 
r]   c                   V Uu0 uF  p\        V4      kK  	  ppV Uu0 uF  p\        V4      kK  	  upV Uu0 uF  p\        V4      kK  	  up,          p. pV  Fe  pVP                   FR  p	V	P                  \        P                  J d   TMTp
V	P
                  V
9  g   K8  VP                  \        V	4      4       KT  	  Kg  	  V'       d#   RP                  V4      pRV R2p\        V4      hR# u upi u upi u upi )zRaise when a declared conflict names an extra/group the project lacks.

A member naming an undeclared extra or group can never match, so
the conflict would be silently inert.  Names compare under
canonicalisation, matching the loaders.
r  z[tool.nab].conflicts names z, which the project does not declare in [project.optional-dependencies] or [dependency-groups], and which is not [tool.nab].base-group or [tool.nab].build-groupN)
r   membersr  r    r  r   r   r~   r  r   )r   r   r   r6  r   known_extrasknown_groupsunknownconflict_setr  knownjoinedr   s   &&&&         rZ   r  r    s     9AA%d+LA8>?%d+?,=C,=D$,=C L G!"**F$*KK<3E3E$EL<E{{%'s6{+ + "
 7#)& 2P P 	
 #  B? Cs   C/C4C9c               (    V ^8  d   QhRRRRRRRR/# )	rU   r   r   selected_extrasr   r   r  rV   zlist[ResolveTarget]rX   )rY   s   "rZ   r[   r[     s0      " % 	r]   c                    \        V P                  V P                  V4      pV UUu. uF!  p\        V\	        WC4      4       F  pVNK  	  K#  	  upp# u uppi )a  Return ``targets`` split at the micros a self-ref marker cuts them at.

A bare-minor target's ``python_full_version`` is the synthesized
``{minor}.0`` floor, so a self reference gated on ``python_full_version
>= "3.10.4"`` answers for the whole minor by how that floor reads it, and
a member reached only above the boundary is never seen.  One slice per
boundary reads the closure where each answer holds.
)r@   r   r   rG   _tileable_points)r   r@  r   r  r   rB  s   &&&   rZ   _conflict_check_targetsrC    s]     !&2E2EWG F(1A&1RSF 	S 	  s   'Ac               $    V ^8  d   QhRRRRRR/# )rU   r   rC   r  zSequence[Marker]rV   zlist[Version]rX   )rY   s   "rZ   r[   r[     s"      ] 5E - r]   c           	         \        4       pV F>  p\        \        4      ;_uu_ 4        VP                  \	        W.4      4       RRR4       K@  	  \        V4      #   + '       g   i     K^  ; i)af  Return the boundaries the tileable ``markers`` cut ``target``'s minor at.

The self-extra closure is walked without an environment, so it carries
markers from branches this target never reaches; one of those that cannot
tile the minor is skipped rather than raised on.  A marker a resolve does
consult still raises, in :func:`_resolve_with_micro_narrowing`.
N)rQ  r   rB   rS  rF   rT  )r   r  r/  r  s   &&  rZ   rB  rB    sU     5F,--MM/AB .-  &> .--s   AA+c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )rU   r   r5  r   r   r@  r   r  plannedr  rV   rW   rX   )rY   s   "rZ   r[   r[     sL     C C$CC #C !	C
 %C 
Cr]   c                    \        WV4      pV F;  p\        VP                  VP                  W&P                  4      p \        WV4       K=  	  R#   \         d   p\        YT4      ThRp?ii ; i)a  Run the require-one minimums check per target, marker-aware.

A member reached only through a marker-gated self reference is active
only on the targets whose environment satisfies that marker, so the
check expands the self-extra closure against each environment the
``planned`` targets cover (see :func:`_conflict_check_targets`).  An
environment on which no member is active fails the policy even when
another one satisfies it.
N)rC  r8   r   r   r  r+   r!   _named_for_target)	r   r   r@  r  rG  r   r   r  r  s	   &&&&&    rZ   r  r    sn      &fwGG*OOV00/CTCT
	C&yO  & 	C#C9sB	Cs   AA-A((A-c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )rU   r   r5  r   r   r  r   r  rG  r  rV   rW   rX   )rY   s   "rZ   r[   r[   ,  sL     C C$CC !C !	C
 %C 
Cr]   c                   \        VP                  V4      p\        WV4      pV F;  p\        VP                  VP
                  W'P                  4      p \        WV4       K=  	  R#   \         d   p	\        YT4      T	hRp	?	ii ; i)a  Run the at-most-one exclusion check per target, marker-aware.

A self reference reaches its extra only where its marker holds, so the
self-extra closure is expanded against each environment the ``planned``
targets cover (see :func:`_conflict_check_targets`).  Members reached
under disjoint markers never share an environment and pass; two that
co-activate on one fail.

This runs once per fork, where each fork holds at most one member of
an engaged set, so it only catches co-selection an umbrella extra or
group reaches transitively: a member not directly selected cannot be
assigned to a fork, so ``conflict_forks`` leaves it in the shared
base where two of them meet.  Directly co-selecting two members forks
instead of raising here.
N)
r7   r   rC  r8   r   r   r  r*   r!   rI  )
r   r   r  r  rG  expanded_groupsr   r   expanded_extrasr  s
   &&&&&     rZ   r   r   ,  s~    , ,FMM=IO%fWEG,OOV00-ARAR
	C(_U  & 	C#C9sB	Cs   A&&B1A>>Bc               (    V ^8  d   QhRRRRRRRR/# )rU   r  r!   r   rC   r   r  rV   rX   )rY   s   "rZ   r[   r[   N  s6     C C	CC %C 	Cr]   c                \    \        V4      ^8X  d   V # \        V  RVP                   R24      # )z>Name the offending tuple, when there is more than one to name.z (tuple ))r<  r!   r   )r  r   r   s   &&&rZ   rI  rI  N  s1     7|q
!SE&,,q"ABBr]   c               $    V ^8  d   QhRRRRRR/# )rU   r   r  r  r  rV   z4tuple[dict[str, VersionRange], dict[str, list[str]]]rX   )rY   s   "rZ   r[   r[   Y  s$      #2C9r]   c                   / p\        \        4      pV  F  pVP                  e   \        VP                  V4      '       g   K/  VP                  e   K?  \        \        VP                  4      4      pVP                  V\        P                  ! 4       4      pVP                  '       d   VP                  P                  4       M\        P                  ! RR7      pWg,          W%&   W5,          P                  \        V4      4       K  	  W#3# )a  Fold one group's direct requirements into per-package ranges.

Mirrors :func:`_build_resolver_inputs` (marker filtering,
canonicalisation, intersection); URL requirements are skipped. Also
returns the requirement strings per package, for the conflict message.
Fadmit_arbitrary)r   r   r  r   urlr~   r   r   rR  r   full	specifierto_ranger   )r   r  r  sourcesr  r   previousterms   &&      rZ   _group_package_rangesr\  Y  s     ')F$/$5G::!*AJJ+
 +
 77$SXX./
 ::dL$5$5$78 }}} MM""$""59 	
  SX&' ( ?r]   c                  :    ] tR tRt$ RtR]R&   R]R&   R]R&   RtR# )	_SelfEmptyGroupi{  z?One group whose own requirements on a package leave no version.r~   rM  r}   reqsrX   Nr   rX   r]   rZ   r^  r^  {  s    IJL
Ir]   r^  c                  N    ] tR tRt$ RtR]R&   R]R&   R]R&   R]R&   R]R&   R	tR
# )_GroupConflicti  z~One direct group-vs-group conflict on a single package.

Group names are stored sorted so the conflict has a stable identity.
r~   
left_groupright_groupr}   left_req	right_reqrX   Nr   rX   r]   rZ   ra  ra    s#    
 OLMNr]   ra  c               $    V ^8  d   QhRRRRRR/# )rU   	per_groupMapping[str, list[Requirement]]r  r  rV   zlist[_SelfEmptyGroup]rX   )rY   s   "rZ   r[   r[     s&      ." r]   c                   aaa . p\        V 4       F?  o\        V S,          V4      w  ooVP                  VVV3R l\        S4       4       4       KA  	  V# )zwReturn the groups whose own requirements on a package leave no version.

The result is sorted by ``(group, package)``.
c           	   3     <"   T FD  pSV,          P                   '       g   K  \        SVR P                  SV,          4      R7      x  KF  	  R# 5i)r  )rM  r}   r_  N)is_emptyr^  r  )r   r}   rM  r  rY  s   & rZ   r   *_find_self_empty_groups.<locals>.<genexpr>  sL      
 *g''OYYww/0 
 *s
   A,A)rT  r\  r@  )rg  r  
self_emptyrM  r  rY  s   && @@@rZ   _find_self_empty_groupsrn    sW     )+J	"/	%0@+N 
 "&>
 	
 # r]   c               $    V ^8  d   QhRRRRRR/# )rU   rg  rh  r  r  rV   zlist[_GroupConflict]rX   )rY   s   "rZ   r[   r[     s&     / /./"/ /r]   c                j   \        \        4      p\        V 4       Fc  p\        W,          V4      w  rEVP	                  4        F8  w  rgVP
                  '       d   K  W&,          P                  W7WV,          34       K:  	  Ke  	  . pVP	                  4        F  w  ri\        P                  ! V	^4       Fh  w  rV
w  rpVw  pppVV,          P
                  '       g   K+  VP                  \        VVVRP                  V4      RP                  V4      R7      4       Kj  	  K  	  VP                  R R7       V# )a  Return the direct group-vs-group conflicts under ``environment``.

Only direct conflicts are caught; one that emerges through a shared
transitive dependency falls through to the resolver.  A group that
already leaves no version on a package is left out of the pairing,
since no other group can be the cause; it is reported by name from
:func:`_find_self_empty_groups` instead.  The result is sorted by
``(left_group, right_group, package)``.
r  )rb  rc  r}   rd  re  c                H    V P                   V P                  V P                  3# rw   rb  rc  r}   r  s   &rZ   <lambda>'_find_group_conflicts.<locals>.<lambda>  s    !,,qyy!Ir]   key)r   r   rT  r\  r   rk  r   r  combinationsra  r  sort)rg  r  	requirersrM  r  rY  r}   package_ranger   group_rangesleftrightrb  
left_rangeleft_sourcesrc  right_rangeright_sourcess   &&                rZ   _find_group_conflictsr    s   " 	D  	"/	0@+N&,lln"G%%%%%uW=M&NO '5 # ')I!*!2$11,BKD370JL6;3Km[(222  "#-$/ '!%<!8"&))M":	 C "3  NNINJr]   c               $    V ^8  d   QhRRRRRR/# )rU   labelsr  r   r  rV   r~   rX   )rY   s   "rZ   r[   r[     s"     8 8 8,C 8 8r]   c                `    \        V4      ^8X  d   R# RRP                  \        V 4      4       2# )z@Name the tuples a finding holds on, when there is more than one. z for tuple(s) r  )r<  r  rT  )r  r   s   &&rZ   _tuple_scoper    s,    
7|qDIIfVn5677r]   c               $    V ^8  d   QhRRRRRR/# )rU   rg  rh  r   r  rV   rW   rX   )rY   s   "rZ   r[   r[     s&     *. *..*.$*. 
*.r]   c                   \        \        4      p\        \        4      pV F}  p\        WP                  4       F$  pW%,          P	                  VP
                  4       K&  	  \        WP                  4       F$  pW6,          P	                  VP
                  4       K&  	  K  	  V'       g   V'       g   R# . p\        VR R7       FR  p\        W%,          V4      pVP                  RVP                  : RVP                  : V RVP                   R24       KT  	  \        VR R7       F  p\        W6,          V4      pVP                  R	VP                  : R
VP                  : RVP                  : V RVP                  : RVP                   RVP                  : RVP                    R24       K  	  \#        RP%                  V4      4      h)a"  Raise on a group that cannot hold on its own, or on a conflicting pair.

A finding is reported when it holds on any target; the offending
tuples are named when there is more than one to name.  A group that
leaves no version on its own is named alone, since no other group
can be the cause.
Nc                2    V P                   V P                  3# rw   )rM  r}   )r  s   &rZ   rt  +_check_group_disjointness.<locals>.<lambda>  s    177AII2Fr]   rv  zDependency group z! has conflicting requirements on r.  .c                H    V P                   V P                  V P                  3# rw   rr  rs  s   &rZ   rt  r    s    q||Q]]AII>r]   zDependency groups z and z conflict on z: group z
 requires z but group z; )r   rQ  rn  r  r  r   r  rT  r  r   rM  r}   r_  rb  rc  rd  re  r   r  )	rg  r   rm  affectedr   emptyconflictclauseswheres	   &&       rZ   r  r    s    3>c2BJ/:3/?H,Y8I8IJE!!&,,/ K-i9J9JKH""6<<0 L  hG
(FGZ.8 / r%**Q8	
 H > X/9 !4!4 7 8$$'}X5E5E4H P)),Jx7H7H6I J$$'z(2D2D1EQH	
 $))G,
--r]   c               $    V ^8  d   QhRRRRRR/# )rU   r  r   r  r  rV   rW   rX   )rY   s   "rZ   r[   r[     s!      ;  T r]   c                    \        V P                  4      pRV9  d   \        V4      '       g   R# \        V 4      pW19   d   R# VP                  V4       \        P                  RV4       R# )a  Warn when a dropped root requirement tests an extra/group membership.

A root marker testing ``extra``, ``extras``, or ``dependency_groups``
evaluates False at resolve time (root activates no extra or group), so the
dep would otherwise be dropped silently.  ``warned`` carries the
requirements already reported in this run, so one mistaken requirement is
reported once rather than once per target per fork.
zextra ==NzRoot requirement %r tests an extra or dependency-group membership marker; the dep is dropped because root activates no extra or group at resolve time. For an extra, use pkg[extra] (extras-of-package).)r~   r  r   r  r   ro  )r  r  marker_textr  s   &&  rZ   _warn_dropped_root_markerr    s[     cjj/K$-Ek-R-Rs8D~
JJtOO	M 		r]   c                  :    ] tR tRt$ RtR]R&   R]R&   R]R&   R	tR
# )_ResolverInputsi'  zFWhat one set of root requirements gives the resolver and the provider.z(list[RootRequirement[str, VersionRange]]rootsdict[str, VersionRange]r  set[tuple[str, str]]r   rX   Nr   rX   r]   rZ   r  r  '  s    P33##  r]   r  r  requirementr  c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )rU   r   r  r   r#   r  r  r  r~   r  zset[str] | NonerV   r  rX   )rY   s   "rZ   r[   r[   /  sT     KF KF'KFKF #	KF
 KF KF KFr]   c                  . p/ p\        4       pVf   \        4       MTpV  EF  p	VR8X  d#   V	P                  '       d   RV	 2p
\        V
4      hV	P                  e*   \	        V	P                  V4      '       g   \        W4       Kd  V	P                  eK   \        V	P                  VP                  4       RV RV	P                   RV	P                   2p
\        V
4      h\        \        V	P                  4      4      pVP                  V\        P                  ! 4       4      pV	P                   '       d   V	P                   P#                  4       M\        P                  ! RR7      pW,          Wk&   VP%                  \'        W\        V	4      4      4       \)        V	P                  4       F{  p\+        W4      pW9  dA   \        P                  ! RR7      pVWo&   VP%                  \'        VV\        V	4      4      4       \-        V4      w  ppVf   Q hVP/                  VV34       K}  	  EK  	  VR8X  dS   \1        \2        4      pV F/  pVVP4                  ,          P%                  VP6                  4       K1  	  \9        VVVR7       \;        WVV4      # )	aC  Convert PEP 508 requirements to the resolver's input shape.

Requirements whose PEP 508 marker evaluates to ``False`` under
``environment`` are skipped, matching pip/uv's root-requirement
handling.  A direct-URL or VCS requirement is refused by
:func:`admit_vcs_url`; resolving one is not implemented.

Each surviving requirement becomes its own
:class:`~nab_resolver.types.RootRequirement`, tagged with the string the
user wrote, so a failure names the requirements rather than their
intersection.  ``ranges`` folds the same requirements per package for the
provider, which asks about one package at a time.

``kind`` is ``"requirement"`` or ``"constraint"``.  A constraint may not
carry extras, and the returned extras set is empty for one.  Constraints
do not become root clauses, so an empty constraint intersection is still
caught here by :func:`raise_for_unsatisfiable` rather than by the solver.

``warned`` is the run's set of already-reported extra/group root
markers (see :func:`_warn_dropped_root_marker`); a caller that does
not share one gets a fresh set, so it warns per call.
r  z Constraints cannot have extras: zVCS z: admitted by policy but resolver path is not implemented: z @ FrS  )r  )rQ  r   r   r  r   r  rU  r   r  r   NotImplementedErrorr~   r   rR  r   rV  rW  rX  r   r   rT  r4   r5   r  r   r   r}   originr9   r  )r   r   r  r  r  r  r  r  already_warnedr  r   r   rZ  r[  r  	extra_keyproxyr.  normalized_extrarY  roots   &&$$$                rZ   r  r  /  s/   < 79E57(+K$nSU&N<CJJJ4SE:Cc""::!*AJJ+
 +
 &c:77#''6::.tf !!$
#cggY8  &c**$SXX./(,,T<3D3D3FG }}} MM""$""59 	
 '/o#_TS:;CJJ'E"4/I 5$))%@38%0_Ys3xHI"-i"8A#///OOT#345 (3 H |/:4/@DDLL!((5  5wTJ5EEr]   c               $    V ^8  d   QhRRRRRR/# )rU   r  r  r  r  rV   rW   rX   )rY   s   "rZ   r[   r[   }  s&     > >(>%> 
>r]   c                d    V F)  w  r#V P                  V4      pVf   K  W@\        W#4      &   K+  	  R# )az  Copy each base package's constraint onto its extras proxies.

The resolver keys constraints by the package it is deciding, and an
extras proxy decides under its own ``name[extra]`` key, so the base's
constraint does not otherwise reach it.  Sharing the key also keeps
the proxy on the constraint-attribution path, so a constraint that
leaves it nothing is named in the failure.
N)rR  r4   )r  r  r   r  r  s   &&   rZ   r  r  }  s1     # __T*
!3=
4/0 #r]   c               (    V ^8  d   QhRRRRRRRR/# )	rU   r  r2   r   rC   r   rj  rV   rW   rX   )rY   s   "rZ   r[   r[     s0     ' '''  ' 
	'r]   c           
        V P                   P                  4       V P                  P                  4       ,          V P                  P                  4       ,          pV'       g   R# VP	                  4        F  w  rE\        V4      pWc9  d   K  V P                  We3,          P                  pVf   K<  VP                  V4      '       d   KU  V RV RV RVP                   RVP                   2	p\        V4      h	  R# )a-  Reject a local, VCS, or archive pin whose Requires-Python excludes ``target``.

Index candidates are filtered by Requires-Python while listing and again
from their fetched metadata; local, VCS, and archive sources skip both, so
a source that rejects the resolve target could otherwise reach the lock.
N z requires Python z	 but the z resolve targets Python )r  r  r  r  r   r   metadata_cacher}  admits_requires_pythonr   python_full_versionr   )	r  r   r   managedr   r   
normalizedspecr   s	   &&&      rZ   r  r    s     	##%



#
#
%	&

"
"
'
'
)	* 
 &t,
$&&
'<=MMF$A$A$$G$G,ay(9$ @LL>!9&:T:T9UW  "#&& &r]   c               $    V ^8  d   QhRRRRRR/# )rU   r  r   r  r2   rV   rW   rX   )rY   s   "rZ   r[   r[     s!        ?  h  4  r]   c                   V P                   f   R# . p\        4       p\        V P                   4       F-  pWC9   d   K  VP                  V4       VP	                  V4       K/  	  . pV F0  pVP                  V4      pVf   K  VP	                  V RV 24       K2  	  V'       g   R# \        V 4      pVR,           RP                  V4      ,           pV3V n        R# )ab  Append per-package no-versions diagnostics to ``exc`` in-place.

Walks the derivation tree carried on the exception, collects every
package a rejection clause names (see
:func:`_walk_no_versions_packages`), and looks up the provider-side
reason for each.  When at least one reason is available, rewrites the
exception's args so that ``str(exc)`` surfaces the diagnostics
alongside the original derivation tree.

Best-effort: reasons are keyed by package name and outlive the ask
that recorded them, so a package whose earlier ask found no version
keeps its hint even when the tree names it over a later range.
Nr.  z

Diagnostics:
  - z
  - )	incompatibilityrQ  _walk_no_versions_packagesr  r   get_no_versions_reasonr~   r  args)	r  r  packagesseenr}   hintsreasonbase	augmenteds	   &&       rZ   r  r    s     "HUD-c.A.AB? 	 C
 E009LLG9Bvh/0  s8D//(--2FFI|CHr]   c                    V ^8  d   QhRRRR/# )rU   r  zIncompatibility[Any, Any]rV   z	list[str]rX   )rY   s   "rZ   r[   r[     s     - -.--r]   c                   . p\        4       pV .pV'       Ed   VP                  4       p\        V4      V9   d   K+  VP                  \        V4      4       VP                  \
        P                  J dJ   VP                   F8  pVP                  p\        V\        4      '       g   K'  VP                  V4       K:  	  MVP                  \
        P                  J d   \        VP                  4      \        8X  d   VP                  ^ ,          P                  4       '       dl   VP                  ^,          P                  4       '       dE   VP                  ^ ,          P                  p\        V\        4      '       d   VP                  V4       VP                   e   VP                  VP                   4       VP"                  f   EK  VP                  VP"                  4       EK  V# )a  Return the packages a no-versions diagnostic may name.

NO_VERSIONS clauses name every package they carry.  Look-ahead grouped
clauses (DEPENDENCY cause, two positive terms) name their candidate: a
widened union covering the whole listing conflicts by propagation, with
no second ``choose_version`` ask to raise a NO_VERSIONS clause.  The
caller drops packages with no recorded reason.

The walk is iterative: the tree gains a level per conflict, so a deeply
backtracked resolve overflows the recursion limit.
)rQ  popidr  causer   NO_VERSIONStermsr}   
isinstancer~   r   
DEPENDENCYr<  _GROUPED_CLAUSE_TERMSis_positivecause_right
cause_left)r  r   seen_idsstacknoder[  pkgs   &      rZ   r  r    sG    CH.=->E
%yy{d8xRX::-999

llc3''JJsO #
 JJ.999DJJ#88

1))++

1))++**Q-''C#s##

3 'LL))*??&LL)Jr]   )
rM   rN   rO   rP   rQ   r   r  r   r  r   rX   )rX   rw   )rn   
__future__r   r  loggingr  r  collectionsr   
contextlibr   r   dataclassesr   r   r   pathlibr	   typingr
   r   r   r   nab_index.cacher   r   nab_resolver.errorsr   nab_resolver.resolverr   r   nab_resolver.typesr   r   r   _conflict_kindr   r   _vcs_admissionr   _vendor.packaging.markersr   _vendor.packaging.rangesr   _vendor.packaging.requirementsr   _vendor.packaging.utilsr   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   fetchr-   lockfiler.   r/   r0   r  r1   r2   r3   r4   r5   requirements_filer6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   r   rA   rB   rC   rD   rE   rF   rG   collections.abcrH   rI   rJ   nab_index.transportrK   _vendor.packaging.versionrL   __all__	getLoggerrj   r   r   r~   r  rN   rq   rM   r   rO   rQ   rP   r  r   r  r'  r  r  r+  r(  r,  r%  rA  r   r  r*  r~  r  r   r  r  r   r   r=  r?  r  r  r  r  r  r   r  r  r  r  r  r  r  rC  rB  r  r   rI  r\  r^  ra  rn  r  r  r  r  r  r  r  r  r  r  rX   r]   rZ   <module>r     sT  ( #     # / 1 1  ; ; 6 / <  N ) - 2 7 6    " $ > >       ;;62 

H
% U38_c)*E8 E('Y7 (0 $d#  $< $d#	* 	* $	* $d#, , $,*   0 0 0 0fc
 '+	c

 "c
 c
 "&c
 c
 c
  %c
 6:c
 %)c
L>

 '+>
 ">
 +/>
 7;>
 6:>
 "&>
 15>
 %)>
 >
B  2    6r@F&<>(V #F4,5 '+5 	5
 (*5 5p4
6r $d#? ? $?( $d#
: 
: $
:$ *8nb,* $\$~"J0@<(UU,@*C6CDCD $d#  $ $d#
 
 $
./d8*.Z0!j !KF
 KF #KF\>$'> F-r]   