+
    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 ]'       d   ^ RIt^ RIHt ^R	IHtHtHt R
R.tRR/R R lltRR/R R lltR R ltR R ltRR/R R lltR# )a  Pip-compatible ``requirements.txt`` rendering for a finished resolve.

Produces text that pip's hash-checking mode can install (with
``--hash=sha256:...`` lines) or a plain ``name==version`` list when
hashes are not required.  Per-tuple resolves render as commented
sections; pip cannot install a single requirements.txt across
multiple ``(python, platform)`` tuples in hash-checking mode.
)annotations)Path)TYPE_CHECKING)quote)atomic_write_text)require_artifact_hashesN)Mapping)IndexPin	LockInputPinShapewrite_requirements_with_hashes!write_requirements_without_hashesoutput_pathc               $    V ^8  d   QhRRRRRR/#    
lock_inputr
   r   str | os.PathLike[str] | Nonereturnstr )formats   "l/home/user/billing-ledger-validation/.venv/lib/python3.14/site-packages/nab_python/_lockfile/requirements.py__annotate__r   !   s)     W WW+HWW    c               4    \        V 4       \        V RVR7      # )a  Render ``lock_input`` as a pip-compatible requirements.txt.

Each line is ``name==version`` followed by one ``--hash=<algo>:<digest>``
per recorded digest, in the format pip's hash-checking mode accepts.  The
hash lines are sorted, so the output does not depend on artefact order.
Local and VCS pins are emitted as ``name @ <url>`` lines without hashes
(pip does not hash-check those forms); an editable local pin renders as
``-e <url>`` and a ``subdirectory`` as a ``#subdirectory=`` fragment.  An
archive pin is a third form, ``name @ <url>#sha256=...``, carrying its hash
in the fragment; :func:`require_artifact_hashes` skips it because that hash
is guaranteed at config parse.  Returns the text and, when ``output_path``
is provided, atomically writes it.
Twith_hashesr   )r   _render_requirementsr   r   s   &$r   r   r   !   s      J'
+VVr   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r   5   s)     
X 
X
X+H
X
Xr   c                   \        V RVR7      # )a+  Render ``lock_input`` as a plain ``name==version`` list.

Same shape as :func:`write_requirements_with_hashes` but without
the ``--hash=sha256:...`` lines.  Local, VCS, and archive pins render
the same in both variants.  Returns the text and, when ``output_path``
is provided, atomically writes it.
Fr   )r   r   s   &$r   r   r   5   s      
;WWr   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r
   r   boolr   r   r   r   r   )r   s   "r   r   r   B   s2     ! !! ! /	!
 	!r   c                  V P                   p\        V4      ^8  dd   \        V4       Uu. uF5  pRP                  RV 2.\	        W4,          P
                  VR7      O4      NK7  	  ppRP                  V4      R,           pMgVP                  4        UUU	u/ uF'  qwP
                  P                  4        F  w  rWbK	  	  K)  	  p
ppp	RP                  \	        WR7      4      R,           pVe   \        \        V4      V4       V# u upi u up	ppi )az  Render one target's pins flat, or several as labelled blocks.

Pip cannot install a single requirements.txt across several
``(python, platform)`` targets in hash-checking mode, so a resolve
that ran against more than one serialises as commented sections that
callers are expected to extract per environment.  One target is one
installable file, so it carries no section header.

z# r   z

)
targetslensortedjoin_render_pinspinsvaluesitemsr   r   )r   r   r   r'   labelblockstextlocknamepinr,   s   &$$        r   r   r   B   s      G
7|a  
 ) IIL!'."5"5;O ) 	 
 {{6"T) #*.."2
"2$IIOODUytDIDUD"2 	 
 yydDEL${+T2K#

s   ;D-Dc               $    V ^8  d   QhRRRRRR/# )r   r,   zMapping[str, PinShape]r   r#   r   	list[str]r   )r   s   "r   r   r   f   s"        -  t  	  r   c                  ^RI HpHpHpHp . p\        V 4       EF  pW,          p\        W4      '       d   VP                  \        WR7      4       K:  \        W4      '       d   \        VP                  4      P                  4       P                  4       p	VP                  e"   V	R\        VP                  RR7       2,          p	VP                  '       d   VP!                  RV	 24       K  VP!                  VP"                   RV	 24       K  \        W4      '       d.   VP!                  VP"                   RVP$                   24       EK3  \        W4      '       d   RP'                  R	 VP(                   4       4      p
VP                  e"   V
R
\        VP                  RR7       2,          p
VP!                  VP"                   RVP*                   RV
 24       EK  RV: 2p\-        V4      h	  V# )z<Render a flat ``{name: pin}`` mapping in alphabetical order.)
ArchivePinr	   LocalPinVcsPinr&   z#subdirectory=/)safez-e z @ &c              3  4   "   T F  w  rV R V 2x  K  	  R# 5i)=Nr   ).0algodigests   &  r   	<genexpr>_render_pins.<locals>.<genexpr>~   s     Rz|t4&& 2zs   z&subdirectory=#zunknown pin shape: )lockfiler8   r	   r9   r:   r)   
isinstanceextend_render_index_pinr   pathresolveas_urisubdirectoryr   editableappendr3   repo_urlr*   hashesurl	TypeError)r,   r   r8   r	   r9   r:   lines	canonicalr4   rR   fragmentmsgs   &$          r   r+   r+   f   s   AAED\	oc$$LL*3HI&&sxx.((*113C+c.>.>S(I'JKK|||s3%[)zSE23$$LLCHH:S78(( xxRszzRRH+nU33C3C#-N,OPPLLCHH:S	8*=>'w/CC. 3 "6 Lr   r   Tc               $    V ^8  d   QhRRRRRR/# )r   r4   r	   r   r#   r   r6   r   )r   s   "r   r   r      s!     % %8 %T %Y %r   c                  V'       g   V P                    R V P                   2.# . pV P                  e&   VP                  V P                  P                  4       V P
                   F  pVP                  VP                  4       K   	  V'       g   V P                    R V P                   2.# V P                    R V P                   2.pVP                  R \        V4       4       4       RP                  V4      .# )z==c              3  6   "   T F  w  rR V RV 2x  K  	  R# 5i)z--hash=:Nr   )r@   rA   ds   &  r   rC   $_render_index_pin.<locals>.<genexpr>   s     E_'$74&!%_s   z \
    )r3   versionsdistrH   rQ   wheelsr)   r*   )r4   r   digestswheelpartss   &$   r   rI   rI      s    88*Bs{{m,--%'G
yysyy''(u||$ 88*Bs{{m,--zCKK=)*E	LLEVG_EEU#$$r   )__doc__
__future__r   pathlibr   typingr   urllib.parser   nab_index.atomicr   builderr   oscollections.abcr   rF   r	   r
   r   __all__r   r   r   r+   rI   r   r   r   <module>rn      sw    #     . ,'88 %'WKOW(
XKO
X!H F%D % %r   