+
    {:j>1                        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Ht ^RIHt R R ltR R	 ltRR
 R lltR R ltRR R lltR# )z1
Updated command line interface for conda-index.
)annotationsN)Path)MAX_THREADS_DEFAULTChannelIndexlogutil)yamlc                    V ^8  d   QhRRRR/# )   parserargparse.ArgumentParserreturn )formats   "8lib/python3.14/site-packages/conda_index/cli/__init__.py__annotate__r      s      I I4 I9P I    c                   RV n         V P                  RRR7       V P                  RRR7       V P                  RRR	R
7       V P                  RRRR7       V P                  RRR7       V P                  R\        P                  RRR7       V P                  R\        P                  RRR7       V P                  R\        P                  RRR7       V P                  R\        P                  RRR7       V P                  R\        P                  RRR7       V P                  R\        P                  RRR7       V P                  RR R!R7       V P                  R"R#R7       V P                  R$\        P                  RR%R7       V P                  R&\        P                  RR'R7       V P                  R(R)R*R+7       V P                  R,\        P                  RR-R7       V P                  R.\        \
        R/R07       V P                  R1R2R3R
7       V P                  R4\        P                  RR5R7       V P                  R6\        P                  RR7R7       V P                  R8R9R:.R9R;R<7       V P                  R=\        P                  P                  R>R?4      R@RA7       V P                  RB\        P                  RRCR7       V P                  RD\        P                  RRER7       V # )FzConfigure the argument parser.zIGenerate conda repository metadata (repodata.json) from a directory tree.dirzDirectory to index)helpz--outputz#Output repodata to given directory.z--subdirappendz"Subdir to index. Accepts multiple.)actionr   z-nz--channel-namez?Customize the channel name listed in each channel's index.html.z--patch-generatorzPath to Python file that outputs metadata patch instructions from its _patch_repodata function or a .tar.bz2/.conda file which contains a patch_instructions.json file for each subdir--channeldataFz@Generate channeldata.json. Conflicts with --no-write-monolithic.)r   defaultr   z--rssTz1Write rss.xml (Only if --channeldata is enabled).z--bz2zWrite repodata.json.bz2.z--zstzWrite repodata.json.zst.--run-exportsz=Write run_exports.json. Conflicts with --no-write-monolithic.z	--compactz+Output JSON as one line, or pretty-printed.z--current-index-versions-filez-ma%  YAML file containing name of package as key, and list of versions as values. The current_index.json will contain the newest from this series of versions. For example: python: [3.8, 3.9] will keep python 3.8.X and 3.9.Y in the current_index.json, instead of only the very latest python version.z
--base-urlzIf packages should be served separately from repodata.json, URL of the directory tree holding packages. Generates repodata.json with repodata_version=2 which is supported in conda 24.5.0 or later.z--update-cachezControl whether listdir() is called to refresh the set of available packages. Used to generate complete repodata.json from cache only when packages are not on disk. (Experimental)z--update-onlyzControl whether missing files are deleted from repodata.json. Used to add local files to repodata.json without having the complete set of packages on disk. (Experimental)z--upstream-stagezZSet to 'clone' to generate example repodata from conda-forge test database. (Experimental)fs)r   r   --current-repodatazSkip generating current_repodata.json, a file containing only the newest versions of all packages and their dependencies, only used by the classic solver. Conflicts with --no-write-monolithic.z	--threadszNumber of threads to use)typer   r   z	--verbose
store_truezEnable debug logging.z--write-monolithicz?Write repodata.json with all package metadata in a single file.z--write-shardszTWrite a repodata.msgpack.zst index and many smaller files per CEP-16. (Experimental)z--dbsqlite3
postgresqlzKChoose database backend. "sqlite3" (default) or "postgresql" (Experimental))choicesr   r   z--db-urlCONDA_INDEX_DBURLzpostgresql:///conda_indexzSQLAlchemy database URL when using --db=postgresql. Alternatively, use the CONDA_INDEX_DBURL environment variable. (Experimental))r   r   z--html-dependencieszInclude dependency popups in generated HTML index files. May significantly increase file size for large repositories like main or conda-forge.z--repodata-nextzbEXPERIMENTAL. Write CEP-XXXX v3 repodata layout with all package records under a top-level v3 key.)	descriptionadd_argumentargparseBooleanOptionalActionintr   osenvironget)r
   s   &r   configure_parserr*      s    	T 
 !   2  
 1   N   7   --O	   --@	   --'	   --'	   --L	   --:	   'N   J   --3	   --+	   	   --@	   #'	   $   --N	   --	   L)Z	   

24OPE   --	   --,	   Mr   c                   V ^8  d   QhRR/# )r	   r   r   r   )r   s   "r   r   r      s     D D/ Dr   c                 B    \        \        P                  ! RR7      4      # )z)Create and configure the argument parser.T)add_help)r*   r$   ArgumentParserr   r   r   _create_parserr/      s    H33TBCCr   c                    V ^8  d   QhRRRR/# )r	   argslist[str] | Noner   Noner   )r   s   "r   r   r      s     ! ! !$ !r   c                N    \        4       p\        VP                  V 4      4       R# )zMain CLI entry point.N)r/   run
parse_args)r1   r
   s   & r   clir7      s    F$ r   c                    V ^8  d   QhRRRR/# )r	   parsed_argszargparse.Namespacer   r3   r   )r   s   "r   r   r      s      ' D r   c                   \        R/ RV P                  bRV P                  bRV P                  bRV P                  bRV P
                  bRV P                  bRV P                  bRV P                  bR	V P                  bR
V P                  bRV P                  bRV P                  bRV P                  bRV P                  bRV P                  bRV P                   bRV P"                  bRV P$                  bRV P&                  bRV P(                  bRV P*                  bRV P,                  bRV P.                  bRV P0                  bRV P2                  b  R# )z"Run the CLI from parsed arguments.r   patch_generatorsubdiroutputchanneldataverbosethreadscurrent_index_versions_filechannel_namebz2zstrssrun_exportscompactbase_urlupdate_cacheupstream_stagecurrent_repodatawrite_monolithicwrite_shardsdbdb_urlhtml_dependenciesupdate_onlyrepodata_nextNr   )
_main_implr   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   )r9   s   &r   r5   r5      s    OO#33 !! !!	
  ++ ## ## %0$K$K !-- OO OO OO  ++ ## %%  !--!" #11#$ %55%& %55'( !--)* >>+, !!-. &77/0  ++12 "//3r   c          4         V ^8  d   QhRRRRRRRRRR	R
R	RRRRRRRR	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R	RR	RR	RR /# )!r	   r   strr;   z
str | Noner<   r2   r=   r>   boolr?   r@   z
int | NonerA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   r   r3   r   )r   s   "r   r   r     s(    }2 }2	}2}2 }2 	}2
 }2 }2 }2 ",}2 }2 
}2 
}2 
}2 }2 }2 }2  !}2" #}2$ %}2& '}2( )}2* 	+}2, -}2. /}20 1}22 3}24 
5}2r   c                <   \         P                  ! 4        V'       d4   \        P                  ! R4      P	                  \        P
                  4       V'       d    \        P                  P                  V4      pV'       g   . pV'       d   VP                  R4       V'       d   VP                  R4       V'       d   VP                  R4       V'       dL   RP                  V4      pRV R2p\        RV 2\        P                  R	7       \        P                  ! ^4       / pVR
8X  d,    ^ RIpVP                   P"                  P$                  pVVR&   M^ RIHp  T p\-        \        P                  P                  V 4      3/ RVbRVbRVbRV	bRV
bRVbRVbRVbRVbRVbRVbRVbRVbRVbRXbRVbRVbR VbR!Vb p!VR"J d+   R# p"V!P.                  P0                  p#V"V!P.                  n         Rp$V'       d3   \3        V4      ;_uu_ 4       p%\4        P6                  ! V%4      p$RRR4       V'       d#   \9        \;        V4      P                  4       4      pV!P=                  VV$R"R$7       VR"J d   X#V!P.                  n        T'       d   T!P?                  TR%7       R# R#   \&         dE   pRT 2p\        RT 2\        P                  R	7       \        P                  ! ^4        Rp?ELRp?ii ; i  + '       g   i     L; i  TR"J d   X#T!P.                  n        i i ; i)&z%Implementation of the main CLI logic.zconda_index.indexr   r   r   z, zConflicting arguments: z5 require(s) --write-monolithic (the default setting).zError: )filer   NrO   z%Missing dependencies for postgresql: )CondaIndexCacherB   output_rootsubdirs	write_bz2	write_zstr@   write_run_exportscompact_jsonrH   save_fs_statewrite_current_repodatarJ   rL   rM   cache_classcache_kwargsrP   rQ   repodata_v3Fc                    . # Nr   )selfr1   s   &*r   no_changed_packages'_main_impl.<locals>.no_changed_packagesj  s    Ir   )r;   current_index_versionsprogress)rE   ) r   	configurelogging	getLoggersetLevelDEBUGr'   path
expanduserr   joinprintsysstderrexitconda_index.postgres.cachepostgrescache	PsqlCacheImportErrorconda_index.index.sqlitecacherY   r   rb   changed_packagesopenr   	safe_loadrU   r   indexupdate_channeldata)&r   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   incompatible_argsargs_str	error_msgrc   conda_indexrb   erY   channel_indexrh   original_changed_packagesrj   fs&   &&&&&&&&&&&&&&&&&&&&&&&&&             r   rS   rS     s   8 -.77F##F+$$%9:$$_5$$_5yy!23H1(;pqIGI;'cjj9HHQKL	\	-%..44>>K%+L" 	B% 
3!  	
    &   #  0 & * "   !" "#$ ,%&  '( ")M. u	 %2$=$=$N$N!5H!!2S!%&122a)-):& 3 !$"7"B"B"DEO+#9 	 	
 5 9RM%%6((S(1 C  	?sCIGI;'cjj9HHQKK	b 32 5 9RM%%6 !sH   *)J -	L 7L 
K.!L 16L K+'9K&&K+.K>	9L Lrf   )NNNFFNNNFFFFTNFr   TTFr    FFF)__doc__
__future__r   r$   rm   os.pathr'   ru   pathlibr   conda_index.indexr   r   r   r   r   r*   r/   r7   r5   rS   r   r   r   <module>r      sJ    #    
  H H IXD
!>}2 }2r   