+
    2j$                    ^   R t ^ RIHt ^ RIHt ^ RIHt ^RIHt ^RI	H
t
 ^RIHt ^RIHt ^RIHtHtHt ^R	IHtHt ^R
IHtHtHt ]'       d   ^ RIHt ^RIHt ^RIHt . R%Ot ]! RR7      R R l4       t!R R lt"R R lt#R R lt$RR/R R llt%R R lt&R R lt'R RR!R"/R# R$ llt(R# )&ae  Metadata extraction for source trees.

Hand a source directory to :func:`extract_metadata` and get back a
:class:`WheelMetadata`. The static pyproject.toml reader runs first;
dynamic ``project.dependencies`` fall through to a PEP 517 backend
invocation inside :class:`~nab_python._build.env.NabBuildEnv`. The
dynamic path needs a :class:`NabProjectConfig`.
)annotations)	lru_cache)TYPE_CHECKING)BuildBackendError)SpecifierSet)canonicalize_name)Version)WheelMetadataload_static_projectvalidate_specifier_versions)is_absent_error
path_state)InvalidProjectRequirementErrorparse_project_requirementrequire_string_list)Path)Requirement)NabProjectConfigi   )maxsizec                    V ^8  d   QhRRRR/# )   
source_dirr   returnWheelMetadata | None )formats   "c/home/user/billing-ledger-validation/.venv/lib/python3.14/site-packages/nab_python/build_backend.py__annotate__r   +   s     4) 4) 4)1E 4)    c                B   V R,          p\        V4      P                  '       g   R#  VP                  RR7      p\        T4      pTf   R# \        T4      #   \         d1   p\	        T4      '       g   RT  RT 2p\        T4      Th Rp?R# Rp?i\         d     R# i ; i)a\  Build :class:`WheelMetadata` from a directory's static pyproject.toml.

Returns ``None`` when ``[project]`` is missing, malformed, or
``project.dynamic`` includes ``dependencies``,
``optional-dependencies``, ``version``, or ``requires-python`` (the
field cannot be trusted as static).
Returns a :class:`WheelMetadata` shape when the static fields are
authoritative, populating ``name``, ``version``,
``requires_python``, ``requires_dist``, and ``provides_extra``.

Raises :class:`BuildBackendError` when the file is there but cannot
be read.  Its contents are unknown, so it is neither "no static
metadata" nor a missing file; the message names the errno.

Raises :class:`InvalidProjectRequirementError` when a present,
non-dynamic field is corrupt: a structurally wrong ``dependencies`` /
``optional-dependencies`` (not an array of strings / not a table), a
``version`` string that does not parse as :pep:`440`, or a
``requires-python`` that is not a string or does not parse as a
specifier.  A corrupt static value is not something the build backend
can compute, so it raises rather than deferring to a build of the same
broken file.

The returned ``provides_extra`` includes both the lower-cased
keys of ``project.optional-dependencies`` and any extras declared
via PEP 685 markers in ``requires-dist``.  PEP 685 normalisation
is applied to all extra names.

Cached per ``source_dir``: the static fields are deterministic
derivations of the on-disk ``pyproject.toml``, and a universal
resolve reads the same workspace member's file once per matrix
tuple.  Callers must treat the returned :class:`WheelMetadata`
as read-only.
zpyproject.tomlNzutf-8)encodingz!could not read pyproject.toml at : )	r   should_read	read_textOSErrorr   r   UnicodeDecodeErrorr
   _project_to_metadata)r   	pyprojecttextexcmsgprojects   &     r   extract_static_metadatar,   *   s    H --Ii ,,,
""G"4 "$'G((  s##5j\C5IC#C(c1 s#   A B!%BBBBc                    V ^8  d   QhRRRR/# )r   r+   dictr   r   r   )r   s   "r   r   r   b   s        $  +?  r   c                   V P                  R4      pV P                  R4      p\        V\        4      '       d   \        V\        4      '       g   R# V P                  R4      p\        V\        4      '       d   RV9   g   RV9   d   R#  \	        V4      p\        T P                  R4      4      p\        \        T4      TT\        T 4      \        \        T 4      4      R7      #   \
         d   pRT: RT 2p\        T4      ThRp?ii ; i)	z?Convert a static ``[project]`` table to :class:`WheelMetadata`.nameversionNdynamiczrequires-pythonzinvalid [project].version r!   )r0   r1   requires_pythonrequires_distprovides_extra)get
isinstancestrlistr   
ValueErrorr   _static_requires_pythonr	   r   _collect_requires_distsorted_collect_provides_extra)r+   r0   version_rawr2   r1   r)   r*   r3   s   &       r   r&   r&   b   s    ;;vD++i(KdC  
;(D(D kk)$G'4  W 1W <;+& .gkk:K.LMOt$',W55g>?   ;*;/C5A,S1s:;s   	C" "D-DDc                    V ^8  d   QhRRRR/# )r   rawobjectr   zSpecifierSet | Noner   )r   s   "r   r   r      s       ,? r   c                   V f   R# \        V \        4      '       g$   R\        V 4      P                   2p\	        V4      h \        V 4      p\        V4       V#   \         d   pRT : RT 2p\	        T4      ThRp?ii ; i)a  Parse a static ``requires-python``, raising when it is corrupt.

Absent is a valid "no constraint". A non-string or an unparseable
specifier is corrupt: it raises rather than silently dropping the
Python bound, which would admit candidates the bound excludes.
Nz0[project].requires-python must be a string, got z"invalid [project].requires-python r!   )r7   r8   type__name__r   r   r   r:   )rA   r*   specifier_setr)   s   &   r   r;   r;      s     {c3@cASAS@TU,S11;$S)#M2   ;23'C5A,S1s:;s   A A>$A99A>c                    V ^8  d   QhRRRR/# )r   r+   r.   r   list[Requirement]r   )r   s   "r   r   r      s      D -> r   c                    . p\        VV P                  R. 4      RR7       \        \        V 4      P	                  4       4       F,  w  r#\        \        V4      4      p\        VVRV: 2VR7       K.  	  V# )a  Concatenate PEP 631 ``dependencies`` + ``optional-dependencies``.

Optional-dependencies entries get an ``; extra == "name"`` marker
appended (combined with any existing marker via ``and``).

A structurally wrong value (``dependencies`` that is not an array of
strings, ``optional-dependencies`` that is not a table, or a per-extra
value that is not an array of strings) raises
:class:`InvalidProjectRequirementError`.  A well-typed entry that is
not valid PEP 508 is dropped with a warning.
dependenciesz[project].dependencies)sourcez&[project].optional-dependencies extra )rK   extra)_extend_with_dep_stringsr6   r=   _require_optional_dependenciesitemsr   r8   )r+   out	raw_extradepsrL   s   &    r   r<   r<      sx      CNB''
 ""@"I"O"O"QR	!#i.1 ;I=I		
 S Jr   rL   Nc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   rP   rH   rA   rB   rK   r8   rL   z
str | Noner   Noner   )r   s   "r   r   r      s:     
 
	
	
 	

 
 

r   c               V   aa V P                  VV3R  l\        VS4       4       4       R# )c              3  @   <"   T F  p\        VSSR 7      x  K  	  R# 5i))rL   N)r   ).0deprL   rK   s   & r   	<genexpr>+_extend_with_dep_strings.<locals>.<genexpr>   s$      3C 	"#vU;;3s   N)extendr   )rP   rA   rK   rL   s   &&ddr   rM   rM      s%     JJ &sF3 r   c                    V ^8  d   QhRRRR/# )r   r+   r.   r   r   )r   s   "r   r   r      s      D T r   c                p    V P                  R/ 4      p\        V\        4      '       g   Rp\        V4      hV# )z@Return ``[project.optional-dependencies]`` as a table, or raise.zoptional-dependenciesz/[project].optional-dependencies must be a table)r6   r7   r.   r   )r+   optionalr*   s   &  r   rN   rN      s5    {{2B7Hh%%?,S11Or   c                    V ^8  d   QhRRRR/# )r   r+   r.   r   zset[str]r   )r   s   "r   r   r      s      T h r   c                f    \        V 4       Uu0 uF  p\        \        V4      4      kK  	  up# u upi )N)rN   r   r8   )r+   rL   s   & r   r>   r>      s7     4G<<E 	#e*%<  s   .configofflineFc               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   ra   zNabProjectConfig | Nonerb   boolr   r	   r   )r   s   "r   r   r      s8     #I #I#I $#I 	#I
 #Ir   c               n    \        V 4      pVe   V# Vf   RV  R2p\        V4      h^RIHp V! WVR7      # )a\  Extract metadata for a source directory.

Tries the static path first (:func:`extract_static_metadata`).
When that returns ``None``, the dynamic-build path is taken:
the project's PEP 517 backend is invoked in an isolated venv
via :func:`nab_python._build.runner.run_build_backend`.  That
needs a :class:`NabProjectConfig`; callers that cannot provide
one get a :class:`BuildBackendError` instead.  ``offline`` bars
that path from fetching the backend's build requirements.

The build env owns its own HTTP transport (see
:class:`~nab_python._build.env.NabBuildEnv` for why); callers
do not pass one in.
zWdynamic-metadata path requires a NabProjectConfig; the static reader returned None for zd.  Pass one through ``extract_metadata`` or use a build-policy that does not enter the dynamic path.)run_build_backend)ra   rb   )r,   r   _build.runnerrf   )r   ra   rb   staticr*   rf   s   &$$   r   extract_metadatari      sY    ( %Z0F~44>< @BB 	  $$ 1ZHHr   )r   ri   r,   ))__doc__
__future__r   	functoolsr   typingr   _build.errorsr   _vendor.packaging.specifiersr   _vendor.packaging.utilsr   _vendor.packaging.versionr   metadatar	   r
   r   pathsr   r   requirements_filer   r   r   pathlibr   _vendor.packaging.requirementsr   ra   r   __all__r,   r&   r;   r<   rM   rN   r>   ri   r   r   r   <module>rx      s    #    7 6 . U U .  ;( 44) 4)n F*:

 
#I '+#I 	#I #Ir   