+
    2j                        R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIH	t	H
t
Ht ^RIHt ^RIHt ]'       d   ^ RIHt ^R	IHt ^R
IHt ^RIHt R R ltR R ltR# )a  BUILD_REMOTE path: fetch, extract, and build a remote sdist.

Invoked from :func:`resolve_dynamic_sdist` when neither the
:pep:`643` static-deps path nor the bundled ``pyproject.toml``
fallback yields usable dependency metadata, and the effective
:class:`~nab_python.provider.BuildPolicy` for the package is
:attr:`~nab_python.provider.BuildPolicy.BUILD_REMOTE`.

A failure here raises :class:`~nab_python.provider.UnsupportedSdistError`
so :func:`nab_python._provider.lookahead.look_ahead_ok` can skip the
version.  If every candidate fails the resolver surfaces the
accumulated reasons as a no-version-satisfies error: invoking
``BUILD_REMOTE`` does not turn a broken sdist into a usable one,
it just turns silence into a real diagnostic.
)annotationsN)Path)TYPE_CHECKING)	SdistFile	WheelFileextract_sdist_archive)SpecifierSet)canonicalize_name)Sequence)Version)WheelMetadata)Providerc               (    V ^8  d   QhRRRRRRRR/# )	   providerr   packagestrversionr   returnr    )formats   "l/home/user/billing-ledger-validation/.venv/lib/python3.14/site-packages/nab_python/_provider/build_remote.py__annotate__r   $   s6     X XXX X 	X    c                b   ^RI Hp ^RIHp ^RIHp \        V4      pV P                  P                  V. 4      p\        Wr4      pVf   V RV R2p	V! V	4      h\        V4      p
V P                  P                  WjVP                  VP                  4      pVP                  4        V P                  P                  P!                  Wj4      pVe   VhV P                  P                  P#                  Wj4      pVf   V RV RVP                   R2p	V! V	4      h\$        P&                  ! R	R
7      ;_uu_ 4       p \)        V\+        V4      4      p TP/                  TT P0                  T P                  P2                  R7      p RRR4       T P4                  pT P7                  Yb4      pTe   \9        T4      MXP:                  pTe;   Te7   TP=                  T4      '       g    T RT RT RTP>                   2p	T! T	4      h\        XP@                  4      T8w  g   TPB                  T8w  d+   T RT RTP@                   RTPB                   R2p	T! T	4      hT#   \,         d   pT RT RT 2p	T! T	4      ThRp?ii ; i  T d   pT RT RT 2p	T! T	4      ThRp?ii ; i  + '       g   i     EL&; i)a  Download the sdist for ``(package, version)``, extract, and build.

``package`` is the canonical package name; ``version`` matches an
entry in ``provider.versions_cache``.  A built sdist whose
``Requires-Python`` excludes the resolve target is rejected, since the
Simple-API listing filter only sees the listing's own (possibly absent)
Requires-Python, not the value the build produces.  A per-package
``requires-python`` metadata override substitutes for the built value
here, matching the listing gate.  A built sdist whose declared name or
version disagrees with the requested candidate is also rejected rather
than used for the wrong package.
)build_backend)BuildBackendError)UnsupportedSdistErrorNz==z@ build-remote requested but no sdist is available in the listingz5 build-remote requested but sdist archive fetch from z failedznab-build-remote-)prefixz' sdist archive could not be extracted: )configofflinez build-remote backend failed: z built sdist requires Python z  but the resolve targets Python z built sdist declares z., which does not match the requested candidate)" r   r   r   r   r	   versions_cacheget_find_sdistr   coordinatorrequest_sdist_archiveurlhasheswaitindexget_sdist_archive_errorget_sdist_archivetempfileTemporaryDirectoryr   r   
ValueErrorextract_metadatabuild_configr    targeteffective_requires_pythonr   requires_pythonadmits_requires_pythonpython_full_versionnamer   )r   r   r   r   r   r   	canonicalversionssdistmsgver_streventintegrity_errordatatd
source_direxcbuiltr2   override_rpspecs   &&&                  r   build_remote_sdistrF   $   s   $ !10!'*I&&**9b9H*E}ir' #+ + 	 $C(('lG  66EIIu||E 
JJL**00HHO "%%77	KD|ir' # 99+W. 	 $C((		$	$,?	@	@B	6.tT"X>J	6!22,, ,,44 3 E 
A  __F44YHK%0%<[!%BWBW 	 	--d33 ir'"?v F''-'A'A&BD 	 $C(($	1U]]g5Mir' #

|2emm_ -## 	
 $C((LG  	6IRy(OPSuUC',#5	6 ! 	6IRy(FseLC',#5	6 
A	@	@sH   5J7I2I;I8 I33I88J;JJJJJ.	c               $    V ^8  d   QhRRRRRR/# )r   r9   z/Sequence[tuple[Version, WheelFile | SdistFile]]r   r   r   zSdistFile | Noner   )r   s   "r   r   r      s&      = r   c                `    V  F'  w  r#W!8X  g   K  \        V\        4      '       g   K%  Vu # 	  R # )N)
isinstancer   )r9   r   vds   &&  r   r$   r$      s+     <Jq)44H  r   )__doc__
__future__r   r-   pathlibr   typingr   nab_index.clientr   r   r   _vendor.packaging.specifiersr   _vendor.packaging.utilsr	   collections.abcr
   _vendor.packaging.versionr   metadatar   r   r   rF   r$   r   r   r   <module>rV      s?     #     H H 7 7(3(#Xvr   