
    .Ph             O       &   U d Z ddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZm Z  ddl!m"Z" ddl#Z#ddl$Z$dd	l%m&Z& dd
l'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7m8Z8 ddl9m:Z:m;Z;m<Z< ddl=m>Z>m?Z? ddl@mAZAmBZB ddlCmDZDmEZEmFZFmGZG ddlHmIZImJZJ ddlKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZS ddlTmUZU ddlVmWZW ddlXmYZY ddlZm[Z[ ddl\m]Z] ddl^m_Z_ ddl`maZambZbmcZc  ejd        ee          Zf ejg        d           ejg        d          gZh e	ji        d          Zj e	ji        d           Zk e	ji        d!          Zl e	ji        d"          Zm e	ji        d#          Zn e&d$d%d%d%d$&          duZoejp        jq        d'k    rejp        jr        d(k    s esd)            ejt        d*           d+Zue*d+         evd,<   d-Zwe*d-         evd.<   d/Zxe*d/         evd0<   e e*d+         e*d-         e*d/         f         Zye e*d+         e*d-         e*d/         f         ZzeuewgZ{ee e*d+         e*d-         f                  evd1<   d2Z|eud3exd4ewd5e|z   iZ}eud6exd7ewd8iZ~d9Z G d: d;e          Zd<ed=ee         fd>Zd<ed=ee         fd?Zd@ed=efdAZdBed=ee         fdCZdDed=eeef         fdEZd@ed=dfdFZdGeDdHdIdJdIdKejg        dLed=dfdMZdNed=efdOZdPedQeee                  d=ee         fdRZdddddd$dd%dd% e            dSdd%dTdGeDdUeejg                 dVeey         dWeejg                 dXeee                  dYeee                  dZeejg                 d[eee                  dPed\ee         d]edQeee                  d^ed_eeQ         d`eejg                 daee         dbedced=df&ddZ	 	 	 	 	 d3d@eOdVee e*d/         e*d+         f                  dPed\ee         dQeee                  d^edeeee                  d=dfdfZd%dgd@eOdPedQeee                  dhe e*d/         e*d+         f         dDedied=ee         fdjZdd%dkdGeDdleYdDedmeeW         dnee[         doeadpeeS         dbedced=eeN         fdqZdrejg        d=eeef         fdsZdteeef         dueeef         d=dfdvZd`eejg                 d=eeeef                  fdwZdd e            dSd%dxdGeDdleYdyeee                  dWejg        dpeeS         d_eeQ         d`eejg                 dbedoeadced=eOfdzZd<ed{eeef         d=efd|Zd@ed{eeef         d=efd}Zed@ed{eeef         d=eejg                 fd~            Zd<ed=efdZd<ed=efdZd@ed=efdZe	 	 	 d4dejg        dPedQeee                  dee         d=eejg                 f
d            Zdejg        d=eyfdZdWeejg                 d=eejg                 fdZdd%d%d$ddddd%ddddd% e            dSd%ddeejg                 deeD         dyeee                  dededPedYeee                  d\ee         dVeeey                  dWeejg                 d^edQeee                  dZeejg                 daee         d[eee                  d]ed_eeQ         d`eejg                 dbedced=df*dZ e#j        e,d-d$           e#j                    d5d                        Ze e*d         e*d         e*d         e*d         e*d         f         Zd$ddgdZe                    d-e           e#j        dddd           e#j        deodd           e#j        dd%dd           e#j        ddd$d           e#j        dddYd$d           e#j        dd$d$d           e#j        ddd e#jg                    d$d           e#j        ddd-ged$d           e#j        ddd           e#j        ddd           e#j        dd$d%d           e#j        dddg ed$d           e#j        ddd$d%dĬ           e#j        dd$d%dƬ           e#j        ddd e#j        g dɢ          ʦ           e#j        dd$d̬ͦ           e#j        d e#jg                    dϬЦ           e#j        dd$dҬ           e#j        dedԬЦ           e#j        ddd_g d$ e#j        dׄ eQD                       dج٦           e#j        ddaedd۬ܦ           e#j        ddad3ddެߦ           e#j        dddd`g d$ e#jg                    d٦          e#j        	 	 	 	 d6de#j        dGee         dededDee         dYee         dedeeD         dhee e*d-         e*d/         e*d+         f                  d\ed@eeD         dbedQee         d]ed^edededZeeD         dee         daee         d[eee                  d_ee         d`eeD         d=df0d                                                                                                                                                                                                                                                                                                            ZeoZd%Zd%Zd$ZdZd$Z ejg        e|          Ze                    de           e#j        dddd           e#j        dedd           e#j        dedd           e#j        dd$ed쬬           e#j        ddd           e#j        ddd           e#j        ddd3           e#j        ddd3           e#j        ded           e#j        dde e#j        g dɢ          ʦ           e#j        dd$ed           e#j        ddd$g d           e#j        dd e(           e#j        de e#jg                              e#j        de#j        dGee         dededLedHee         dJee         dejg        d{ee         deeD         dedededQee         ded=df d                                                                                                                                                                                                ZdeeeddeddeeddfdGee         dededLedHee         dJee         dejg        d{ee         deeD         dededQeee                  dee         d=dfdZe                    d	e           e#j        dd$d$d           e#j        ddd+g e#j        d+d/g          d$d
           e#j        ddd           e#j        ddg ed$d           e#j        ddd e#j        g dɢ          ʦ           e#j        dd$d̬ͦ           e#j        ddd$d           e#j        de|          e#j        de#j        dedhee e*d/         e*d+         f                  d\edQee         dedeDdedDee         d=dfd                                                                                                                        Ze                    de           e#j        dddd$           e#j        dddd$           e#j        dddd$           e#j        ddd$d           e#j        dddYd$d           e#j        dd$d$d           e#j        ddd e#jg                    d$d           e#j        dd e#j        ddg          d$d           e#j        dddd$           e#j        ddd           e#j        dd$ddd$           e#j        dddg ed$d           e#j        ddd$d%dĬ           e#j        dd$ddd$           e#j        dd$dͦ           e#j        ddd e#j        g dɢ          ʦ           e#j        dd$d̬ͦ           e#j        d e#jg                    dd$           e#j        dd$dd$           e#j        dedԬЦ           e#j        ddd_g d$ e#j        d eQD                       d$           e#j        ddaeddܦ           e#j        ddad3ddd$            e#j        dddd`g d$ e#jg                    dd$!	  	         e#j        d"edd#ܦ           e#j        d$ed$d%          dGee         dee         dee         dDee         dYee         dedeeD         dhee*d&                  d\ee         d@eeD         dbedQee         d]ed^ee         dededZeeD         dee         daee         d[ee         d_ee         d`eeD         d'ed(ee         d)ee         d=df4d*                                                                                                                                                                                                                                                                                                                                    Zddd$dd%ddddd+	dUeejg                 dVee*d&                  d'edXeee                  dYeee                  dPedQeee                  d]edWeejg                 daee         d(ee         dced,eeeA                  d=dfd-Zd.ee         d/ed0ee         d=efd1Zeed2k    r e             dS dS (7  z5
Somewhat hacky solution to create conda lock files.
    N)contextmanager)partial)distribution)TracebackType)AbstractSetAnyDictIteratorListOptionalSequenceSetTupleTypeUnion)urlsplit)ensurecondaplatform_subdir)Literal)OrderedGroup)	read_file	read_jsonrelative_pathtemporary_file_with_contentswarn
write_file)solve_conda)#backwards_compatible_content_hashescompute_content_hashes)	EmptyDictHashableVirtualPackageSubdirMetadata)MissingEnvVarErrorPlatformValidationError)EditableDependencyrender_pixi_toml)PathLike_invoke_condadetermine_conda_executableis_micromamba)parse_conda_lock_filewrite_conda_lock_file)GitMeta	InputMetaLockedDependencyLockfileLockMetaMetadataOptionTimeMetaUpdateSpecification)DEFAULT_MAPPING_URL)Channel)LockSpecification)PipRepository)
solve_pypi)make_lock_spec)FakeRepoData default_virtual_package_repodata'virtual_package_repo_from_specificationzenvironment.ymlzenvironment.yamlz)^(# pip .* @ )?(https?:\/\/)(.*:.*@)?(.*)z(^[^#@].*|^# pip .*)z)^(# pip .* @ )?(https?:\/\/)?([^\/]+)(.*)z^# platform: (.*)$z^# input_hash: (.*)$TF)mamba
micromambaconda	conda_exe
no_install      z*conda_lock needs to run under python >=3.6   explicitKIND_EXPLICITlock	KIND_LOCKenvKIND_ENVDEFAULT_KINDSzconda-lock.yml .yml.z-conda create --name YOURENV --file {lockfile}z1conda env create --name YOURENV --file {lockfile}z,conda-lock install --name YOURENV {lockfile}a  
  'cudatoolkit' package added implicitly without specifying that cuda packages
  should be accepted.
  Specify a cuda version via `--with-cuda VERSION` or via virtual packages
  to suppress this warning,
  or pass `--without-cuda` to explicitly exclude cuda packages.
c                       e Zd ZdS )UnknownLockfileKindN)__name__
__module____qualname__     U/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/conda_lock/conda_lock.pyrR   rR      s        DrW   rR   linereturnc                 h    t                               |           }|r|                    d          S d S NrF   )PLATFORM_PATTERNsearchgrouprY   r^   s     rX   _extract_platformra      s2    $$T**F ||A4rW   c                 h    t                               |           }|r|                    d          S d S r\   )INPUT_HASH_PATTERNr^   r_   r`   s     rX   _extract_spec_hashrd      s2    &&t,,F ||A4rW   lockfilec                     |                                                      d          D ]}t          |          }|r|c S t          d          )N
z!Cannot find platform in lockfile.)stripsplitra   RuntimeError)re   rY   platforms      rX   extract_platformrl      s[      &&t,,  $T** 	OOO	
:
;
;;rW   lockfile_contentsc                     |                                                      d          D ]}t          |          }|r|c S d S )Nrg   )rh   ri   rd   )rm   rY   rk   s      rX   extract_input_hashro      sS    !''))//55  %d++ 	OOO	4rW   rk   c                 .    t                      }| |k    |fS Nr   )rk   determined_subdirs     rX   _do_validate_platformrs      s     '))((*;;;rW   c                     t          |           }	 t          |          \  }}n!# t          $ r t          d| d          w xY w|st	          d| d| d          d S )Nz#Unknown platform type in lockfile 'z'.zPlatform in lockfile 'z*' is not compatible with system platform ')rl   rs   KeyErrorrj   r%   )re   platform_lockfilesuccessplatform_syss       rX   do_validate_platformry      s    (22X 56G H H X X XVARVVVWWWX 
%r%6rrbnrrr
 
 	

 
s	   $ ArA   prefixz
str | Nonenamefilecopyc                 \   t          t          | ||d          }|j                            d          rdnd}|dk    r4t	          |          5 }d |D             }d d d            n# 1 swxY w Y   ng }|dk    rt          |           sdgng }	|dk    r|rdgng }
|dk    rdgng }g |	d	d
|
dt          |          |} ||           |sd S t          d                    |                    5 } |dgddddt          |          g           d d d            d S # 1 swxY w Y   d S )NT)
check_callrO   rK   rG   c                 n    g | ]2}|                     d           |                    d           d         3S )# pip rF   )
startswithri   .0rY   s     rX   
<listcomp>z$do_conda_install.<locals>.<listcomp>   sK          ??8,, 

8$$Q'     rW   --copyz--yescreatez--quiet--filerg   runpipinstallz	--no-depsz-r)	r   r)   r{   endswithopenr+   strr   join)rA   rz   r{   r|   r}   _condakindexplicit_envpip_requirements
env_prefixcopy_argyes_argadditional_argsrequirements_paths                 rX   do_conda_installr      s:    ]E64DIIIFI&&v..>55JDz$ZZ 	<   (     	 	 	 	 	 	 	 	 	 	 	 	 	 	 	  EMM-2F2FM%BJ!U]]t]zzH5==wiibG	 	 
	
 	 	D		 
O F? 	%dii0@&A&A	B	B WFWw	;cBS>T>TUVVVW W W W W W W W W W W W W W W W W Ws$   A&&A*-A*4 D!!D%(D%fnc                     |                      d          r|                     d          \  } }}nB|                      d          r|                     d          \  } }}nt          d|  |           | S )N.condaz.tar.bz2zunexpected file type )r   	partitionrj   )r   _s     rX   fn_to_dist_namer      sz    	{{8 =<<))Aqq	Z	 	  =<<
++Aqq7277<<<IrW   include_dev_dependenciesextrasc                 h    dh}| r|                     d           ||                    |           |S )zCompute the selected subset of categories when filtering.

    Includes `main`, `dev` unless disabled by the flag, and any explicitly specified
    extras.
    maindev)addupdate)r   r   filtered_categoriess      rX   _compute_filtered_categoriesr     sH     "( '&&&""6***rW   rV   )lockfile_pathplatform_overrideschannel_overridesvirtual_package_specr   r   filename_templatefilter_categoriesr   check_input_hashmetadata_choicesmetadata_yamls	with_cuda
strip_auth	src_fileskindsr   r   r   r   r   r   r   r   r   r   r   r   mapping_urlc                     d}|
rt          ||          }t          |||||          }d}|t          j        t                    }|                                rN	 t          |          }n?# t          j        j	        t          f$ r t                              d           d}Y nw xY wd}|rg|                                rSt          |          }|?|dk    rt                              d           nt                              d| d           d	}n|d
}d}nd	}t          |          }|5  g  g }|t          |j        j                  }|t          |          }t%          |j        |          }|j        D ][}|s)||vs%|r#|j        j        |         t+          |||          vr.                     |           ||v r|                    |           \n|j         t%                      }|r,t1          dt3          |           dt4          j                   t3          t9                                 s|}nt1          d  dt4          j                   t;          | | |||||||
  
        }|s|}nA fd|j        D             }|                    d	d|i          }|                    |          }d|v rZtA          |||           t1          dtB          d         "                    tG          |                    t4          j                   |J |sttI          d tK          j&        |j'        (                                 D                       }|s6|j        D ].}|j)        dk    r!t                              tT                      n/tW          |d |D             ||	||           ddd           dS # 1 swxY w Y   dS )a\  
    Generate a lock file from the src files provided

    Parameters
    ----------
    conda :
        Path to conda, mamba, or micromamba
    src_files :
        Files to parse requirements from
    kinds :
        Lockfile formats to output
    lockfile_path :
        Path to a conda-lock.yml to create or update
    platform_overrides :
        Platforms to solve for. Takes precedence over platforms found in src_files.
    channel_overrides :
        Channels to use. Takes precedence over channels found in src_files.
    virtual_package_spec :
        Path to a virtual package repository that defines each platform.
    update :
        Names of dependencies to update to their latest versions, regardless
        of whether the constraint in src_files has changed.
    include_dev_dependencies :
        Include development dependencies in explicit or env output
    filename_template :
        Format for names of rendered explicit or env files. Must include {platform}.
    extras :
        Include the given extras in explicit or env output
    filter_categories :
        Filter out unused categories prior to solving
    check_input_hash :
        Do not re-solve for each target platform for which specifications are unchanged
    metadata_choices:
        Set of selected metadata fields to generate for this lockfile.
    with_cuda:
        The version of cuda requested.
        '' means no cuda.
        None will pick a default version and warn if cuda packages are installed.
    metadata_yamls:
        YAML or JSON file(s) containing structured metadata to add to metadata section of the lockfile.
    Nr   r   r   r   r   r   r   z9Failed to parse existing lock.  Regenerating from scratchrN   z:Ignoring --without-cuda in favor of --virtual-package-speczIgnoring --with-cuda z# in favor of --virtual-package-specTFdefault)cuda_version)lockedr   zSpec hash already locked for z. Skipping solve.r|   zLocking dependencies for ...)
rA   spec	platformsr   update_specr   r   r   virtual_package_repor   c                 &    g | ]}|j         v|S rV   rk   )r   depplatforms_to_locks     rX   r   z#make_lock_files.<locals>.<listcomp>  s1     ( ( (|+<<< <<<rW   package)deepr   rI   )r   z - Install lock using:re   c              3   ,   K   | ]}|j         d k    V  dS )cudatoolkitNr{   )r   pkgs     rX   	<genexpr>z"make_lock_files.<locals>.<genexpr>  s=       ( ( M)( ( ( ( ( (rW   r   c                     g | ]
}|d k    |S )rI   rV   )r   ks     rX   r   z#make_lock_files.<locals>.<listcomp>  s    333qF{{1{{{rW   )r   r   r   r   r   ),r   r;   pathlibPathDEFAULT_LOCKFILE_NAMEexistsr,   yamlerror	YAMLErrorFileNotFoundErrorloggerwarningr>   r=   listmetadatar   r5   r   content_hashr   appendremoveprintsortedsysstderrsetcreate_lockfile_from_spec
model_copymerger-   KIND_USE_TEXTformatr   any	itertoolschaindependenciesvaluesr{   _implicit_cuda_message	do_render)!rA   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   	lock_specoriginal_lock_contentr   cuda_specifiedplatforms_already_lockedr   rk   new_lock_contentfresh_lock_contentpackages_not_to_locklock_content_to_persistcudatoolkit_requestedr   r   s!                                   @rX   make_lock_filesr     s   ~ 7; 
:%=f
 
 
 +-/  I 15%:;; %	)$9-$H$H!!
$&78 	) 	) 	)NNVWWW$(!!!	) !%  X 4 ; ; = = XF  
  
  BP    -I - - -   "N!II!N?YWWW	 j
 j
').0  ,'+,A,J,T'U'U$!f-,4V  K &/ B BB'???+ @,5B8L>!#7  
 &,,X666#;;;077AAAB !* 3-//K# 	c7O0P0PcccZ    #3'8#9#9::  +	4D.?DDD3:VVVV!:++'!1-%%9'" " " ) U#5  ( ( ( (4<( ( ($
 +@*J*J%';< +K + +' $;#@#@AS#T#T %$!%5   
 ,!&)00#m:L:L0MM     +++
  
	$' ( ($?I,B,I,I,K,KL( ( ( % %! ) /7  G|}44'=>>> 5 	33e333%=/-	
 	
 	
 	
Gj
 j
 j
 j
 j
 j
 j
 j
 j
 j
 j
 j
 j
 j
 j
 j
 j
 j
s%   A- -7B'&B'0JOOOoverride_platformc           	         | j         j        }|Lt          |          dk    r9t          t	          t          |          t          |          z                      }|rd|vrXt          |          dk    rEt          dd                    |           t          j	                   t          j
        d           t                                          D ]F\  }}	|	r?|                    |	          r*t          d|	 d	| d
           t          j
        d           G|D ]6}
|D ]/}|r|
t          |                                          | j         j        t#          d          j        t&          j                            t&          j        j                                      d          d} |j        di |}nd|
 d}t3          j        |                                          r|rt9          |          5 }t;          |                                          }ddd           n# 1 swxY w Y   || j         j                            |
          k    r$t          d|
 d| dt          j	                   Rt          d|
 dt          j	                   tA          | ||||
          }|t          |         z  }t9          |d          5 }|!                    d                    |          dz              ddd           n# 1 swxY w Y   t          d|dk    rdnd dtD          |                             |          t          j	                   18d|v rt          dt          j	                   dS dS ) a/  Render the lock content for each platform in lockfile

    Parameters
    ----------
    lockfile :
        Lock content
    kinds :
        Lockfile formats to render
    include_dev_dependencies :
        Include development dependencies in output
    filename_template :
        Format for the lock file names. Must include {platform}.
    extras :
        Include the given extras in output
    check_input_hash :
        Do not re-render if specifications are unchanged
    override_platform :
        Generate only this subset of the platform files
    Nr   z
{platform}rF   zM{platform} must be in filename template when locking more than one platform: , r   z%Filename template must not end with 'z', as this is reserved for 'z6' lock files, in which case it is automatically added.
conda_lockz%Y%m%dT%H%M%SZ)rk   zdev-dependenciesz
input-hashversion	timestampzconda-z.lockz"Lock content already rendered for z. Skipping render of rP   zRendering lockfile(s) for r   )re   r   r   r   rk   wrg   z - Install lock using rK   z(see warning below)rN   :r   a  
WARNING: Using environment lock files (*.yml) does NOT guarantee that generated environments will be identical over time, since the dependency resolver is re-run every time and changes in repository metadata or resolver logic may cause variation. Conversely, since the resolver is run every time, the resulting packages ARE guaranteed to be seen by conda as being in a consistent state. This makes them useful when updating existing environments.rV   )#r   r   lenr   r   r   r   r   r   r   exitKIND_FILE_EXTitemsr   r   lowerr   r   r   datetimenowtimezoneutcstrftimer   r   r   r   r   ro   readgetrender_lockfile_for_platformwriter   )re   r   r   r   r   r   r   r   r   file_extplatcontextfilenamefprevious_hashrm   fos                    rX   r   r     s}   8 !+I$->)?)?!)C)CI5F1G1G GHHII	 000S^^a5G5GC,0IIi,@,@C CZ   
 HQKKK+1133 	 	ND( -66x@@ ,H , ,(,, , ,  
  , , +	 +	D  0 $(+,D(E(E(K(K(M(M"*"3"@+L99A!)!2!6!6x7H7L!M!M!V!V(" "  4,3>>g>>/D///|H%%,,.. 3C (^^ Aq$6qvvxx$@$@MA A A A A A A A A A A A A A A H$5$B$F$Ft$L$LLLcTccX`ccc Z    8t888szJJJJ <!)A! ! ! d++Hh$$ >#455<===> > > > > > > > > > > > > > > Z$%--)>)>UWZZZd#**H*==Z    O+	Z ~~E 		
 		
 		
 		
 		
 		
 ~s$   2"H  H$'H$,K==LL)%suppress_warning_for_pip_and_explicitr   r  c           	      0   dd d| j         j                                       dg}dh|pg |rdgng }g }g }	|dk    r|                                  n|                                  |                                  | j        D ]}
|
j        k    rvt          |
j	        |z            dk    r[|
j
        d	k    r|	                    |
           I|
j
        d
k    r/|
j                            d          s|                    |
           	 d$dt          dt          dt           dt          fd	 d$dt          dt          dt           dt          fd|dk    rg|                    dgd | j         j        D             dfd|D                        |                    |	rdgfd|	D             ng            n|dk    r|                    d           |                    fd|D                        dt          dt          fdfd|D             }|                    fd|	D                        t          |	          dk    r|st&                              d            nt+          d!| d"          t-          j        d#|           |S )%al  
    Render lock content into a single-platform lockfile that can be installed
    with conda.

    Parameters
    ----------
    lockfile :
        Locked package versions
    include_dev_dependencies :
        Include development dependencies in output
    extras :
        Optional dependency groups to include in output
    kind :
        Lockfile format (explicit or env)
    platform :
        Target platform
    suppress_warning_for_pip_and_explicit :
        When rendering internally for `conda-lock install`, we should suppress
        the warning about pip dependencies not being supported by all tools.
    z# Generated by conda-lock.z# platform: z# input_hash: rg   r   r   rG   r   r   rA   __Fr   rk   directrZ   c                 $   | j         r&| j         j        dk    r| j         d| j         j         S |r1| j         d| j         }| j        j        r|d| j        j         z  }|S | j         d| j         }| j        j        r|d| j        j         z  }|S )Nurlz @ z#sha256=z == z --hash=sha256:)sourcetyper{   r  hashsha256r   )r   rk   r  ss       rX   format_pip_requirementz<render_lockfile_for_platform.<locals>.format_pip_requirement  s     ; 	4;+u44i55DKO555 		9++++Ay 32	 0222H900$,00Ay :9ty'7999HrW   c                 b   |r(t          j        | j         d| j        j                   S t          j        t          | j                  j                  }|j	        dv r|
                    d          }|j	        dv |j                            d          d         }| j         d| j         d| S )N#>   .gz.bz2.tarr   rN   -=)	posixpath
expandvarsr  r   md5r   r   r   pathsuffixwith_suffixr{   ri   r   )r   rk   r  r/  build_strings        rX   format_conda_requirementz>render_lockfile_for_platform.<locals>.format_conda_requirement  s      	@'48(E(Edim(E(EFFF< 2 2 788D+!BBB''++ +!BBB9??3//3Li??$,?????rW   rK   z	channels:c              3   D   K   | ]}d |                                  V  dS )  - N)env_replaced_url)r   channels     rX   r   z/render_lockfile_for_platform.<locals>.<genexpr>  sJ         87335577     rW   zdependencies:c              3   :   K   | ]}d  |d           V  dS )r5  Fr  NrV   r   r   r3  rk   s     rX   r   z/render_lockfile_for_platform.<locals>.<genexpr>  sS         S33C%PPPRR     rW   z  - pip:c              3   :   K   | ]}d  |d           V  dS )z      - Fr9  NrV   r   r   r#  rk   s     rX   r   z/render_lockfile_for_platform.<locals>.<genexpr>  sS         U55c8ERRRTT     rW   z
@EXPLICIT
c                 ,    g | ]} |d           S )Tr9  rV   r:  s     rX   r   z0render_lockfile_for_platform.<locals>.<listcomp>  s,    XXXc%%c8DAAAXXXrW   rY   c                 >    |                                  } | dk    rdS | S )NrN   r%  rh   rY   s    rX   sanitize_lockfile_linez<render_lockfile_for_platform.<locals>.sanitize_lockfile_line  s"    ::<<DrzzsrW   c                 &    g | ]} |          S rV   rV   )r   rY   rA  s     rX   r   z0render_lockfile_for_platform.<locals>.<listcomp>  s%    XXXd33D99XXXrW   c                 2    g | ]}d  |d           S )r   Tr9  rV   r<  s     rX   r   z0render_lockfile_for_platform.<locals>.<listcomp>  sE        N//XdKKKMM  rW   a+  WARNING: installation of pip dependencies from explicit lockfiles is only supported by the 'conda-lock install' and 'micromamba install' commands. Other tools may silently ignore them. For portability, we recommend using the newer unified lockfile format (i.e. removing the --kind=explicit argument.zUnrecognised lock kind rP   zlockfile_contents:
%s
)F)r   r   r  toposort_inplacealphasort_inplacefilter_virtual_packages_inplacer   rk   r  
categoriesmanagerr   r{   r   r0   r   boolextendchannelsr   r   
ValueErrorloggingdebug)re   r   r   r   rk   r  rm   categories_to_install
conda_depspip_depspr3  r#  rA  s       `      @@@rX   r  r  b  s   < 	%!x!!I*7;;HEEIII 	'
,B' .
55''2' *,J')H z!!####""$$$,,... ) ):!!c!,9N*N&O&ORS&S&SyE!!""""g%%v((.. )%%a((( ?D *-7;	   " ?D@ @@*-@7;@	@ @ @ @ u}}   #+#4#=        )  	
 	
 	
 	       '    
	
 
	
 
	
 
	
 
		  ///  XXXXXZXXX	
 	
 	
	 	 	 	 	 	 YXXXFWXXX 	      #  	
 	
 	
 x==1%JNN   :4:::;;;M,.?@@@rW   )r   r   r   rK  pip_repositoriesr   r   c        	            |t                      }|j                 fd|j        D             fddD             }	fddD             }
t          | |	d         |
d         |j        ||          }|	d         rd	|vrt          d
          |sd}n0|j                            i           }|                    d          }t          |	d         |j        d |j        D             d |	                                D             |d	         j
        |||j        ||          }ni }t          |	                                          t          |	                                          z   S )z3
    Solve specification for a single platform
    Nc                 *    g | ]}|j         k    |S rV   r   )r   r   rk   s     rX   r   z#_solve_for_arch.<locals>.<listcomp>  s%    LLLc3<83K3Kc3K3K3KrW   c                 0    i | ]fd D             S )c                 6    i | ]}|j         k    |j        |S rV   rH  r{   r   r   rH  s     rX   
<dictcomp>z._solve_for_arch.<locals>.<dictcomp>.<dictcomp>  s)    RRRC3;';Q;Q#(C;Q;Q;QrW   rV   )r   rH  r   s    @rX   rZ  z#_solve_for_arch.<locals>.<dictcomp>  sA        	RRRR<RRR  rW   )rA   r   c                 0    i | ]fd D             S )c                 6    i | ]}|j         k    |j        |S rV   rX  rY  s     rX   rZ  z._solve_for_arch.<locals>.<dictcomp>.<dictcomp>  s)    LLLCS[G5K5K#(C5K5K5KrW   rV   )r   rH  r   s    @rX   rZ  z#_solve_for_arch.<locals>.<dictcomp>  sA        	LLLL6LLL  rW   rA   )specsr   r   rk   rK  r   r   pythonzGot pip specs without Pythonpackagesc                 4    i | ]}|j         d k    |j        |S )r   rX  r   r   s     rX   rZ  z#_solve_for_arch.<locals>.<dictcomp>7  s/       "%s{e?S?S#?S?S?SrW   c                     i | ]
}|j         |S rV   r   ra  s     rX   rZ  z#_solve_for_arch.<locals>.<dictcomp>:  s    GGGC#(CGGGrW   )	pip_specs
use_latest
pip_lockedconda_lockedpython_versionrk   platform_virtual_packagesrS  allow_pypi_requestsr   r   )r5   r   r   r   r   rL  all_repodatar  r:   r   r   ri  r   )rA   r   rk   rK  rS  r   r   r   r   requested_deps_by_namelocked_deps_by_namerP  rh  metadata_for_platformrQ  r   r   s     `            @@rX   _solve_for_archrn    s    )++$X.LLLLL[/LLLF   '     '  
 $W-"7+!  J e$ :%%;<<< $ 	N(,%% %155hCC " )>(A(A*(M(M%,U3") )4);   HG:3D3D3F3FGGG%h/7&?- $ 8!#
 
 
  
!!##$$tHOO,=,='>'>>>rW   in_pathc                     |                      d          5 }t          j        |          }d d d            n# 1 swxY w Y   |S )Nr)r   r   	safe_load)ro  infiler   s      rX    convert_structured_metadata_yamlrt  I  sz    	c		 *f>&))* * * * * * * * * * * * * * *Os   7;;	to_changechange_sourcec                     |D ]8}|| v r2t                               d| d| |          d||          z              9|                     |           d S )NzCustom metadata field z# provided twice, overwriting value z with )r   r   r   )ru  rv  keys      rX   update_metadatary  O  s}      )NNQQQQs^??=+=??@   ]#####rW   c                 Z    i }| D ]!}t          |          }t          ||           "|r|S d S rq   )rt  ry  )r   custom_metadata_dict	yaml_pathnew_metadatas       rX   get_custom_metadatar~  Y  sM     ,.# < <	7	BB,l;;;; $##4rW   )r   r   r   r   r   r   c        
         P   |g }i |p|j         D ]I}
t          | ||
g |j        |j        |j        ||||		  	        }|D ]}||j        |j        |j        f<   Ji }|j        D ]i}	 t          |j
        |          }nK# t          $ r>}dt          |          vr|t          |                                          }Y d}~nd}~ww xY w|||<   jt          j        v rt!          j                    }nd}t          j        t          j        t          j        hz  rJt*          j                            d          st1          d          t3          j        |j                  }nd}t          j        t          j        hz  r!fd|                                D             }nd}t;          |          }t=          ||          }t?          fd	D             tA          |d
 |j        D             |j         tC          |"                                          ||||                    S )z'
    Solve or update specification
    N)	rA   r   rk   rK  rS  r   r   r   r   zPaths don't have the same drivegitz7The GitPython package is required to read Git metadata.)r   r   c                 D    i | ]\  }}|t          j        |           S ))r   src_file)r/   r   )r   meta_srcr  r   s      rX   rZ  z-create_lockfile_from_spec.<locals>.<dictcomp>  sH     ;
 ;
 ;
 #( i&!1H  ;
 ;
 ;
rW   )r   c                      g | ]
}|         S rV   rV   )r   r   r   s     rX   r   z-create_lockfile_from_spec.<locals>.<listcomp>  s    +++q+++rW   c                     g | ]}|S rV   rV   )r   cs     rX   r   z-create_lockfile_from_spec.<locals>.<listcomp>  s    ///Aa///rW   )r   rK  r   sourcesgit_metadatatime_metadatainputs_metadatacustom_metadata)r   r   )#r   rn  rK  r7  rS  rH  r{   rk   r  r   parentrL  r   resolver3   	TimeStampr4   r   GitUserEmailGitUserNameGitSha	importlibutil	find_specrj   r.   InputShaInputMd5r  r~  r    r1   r2   r   keys)rA   r   r   r   r   r   r   r   r   r   rk   depsr   meta_sourcesr  r/  er  r  r  r  content_hashesr   s        `                @rX   r   r   e  s     	;=F/ @ @Ct}C&:&BC!2!5#!#

 

 

  	@ 	@C<?FCK3<899	@ -/L, $ $	) !5v>>DD 	) 	) 	)0A>>v~~''((DDDDDD	) $T#333 ))#"  
 ~''.. 	I   ~-l
 
 

 >2N4KLL ;
 ;
 ;
 ;
 '3&8&8&:&:	;
 ;
 ;
 )HHHO+D2FGGN++++F+++'/////n**,,--%'++	
 	
 	
   s   (A>>
C4CCauthc                       fd|D             }|s S t          |t                    }||          d| }                     ||          S )Nc                     g | ]}|v |	S rV   rV   )r   arY   s     rX   r   z%_add_auth_to_line.<locals>.<listcomp>  s    333AdarW   )rx  @)maxr  replace)rY   r  matching_authsmatching_authreplacements   `    rX   _add_auth_to_liner    sg    3333333N C000M-(::=::K<<{333rW   c                     d                     fd|                                                     d          D                       }|                     d          r|dz   S |S )Nrg   c              3   p   K   | ]0}t                               |          rt          |          n|V  1d S rq   )PKG_PATTERNmatchr  )r   rY   r  s     rX   r   z(_add_auth_to_lockfile.<locals>.<genexpr>  sZ       # # *5):):4)@)@J$%%%d# # # # # #rW   )r   rh   ri   r   )re   r  lockfile_with_auths    ` rX   _add_auth_to_lockfiler    s~     # # # #NN$$**400# # #    )!D((rW   c              #      K   t          | |          }t          |          5 }|V  d d d            d S # 1 swxY w Y   d S rq   )r  r   )re   r  r  r/  s       rX   	_add_authr    s      .x>>	%&8	9	9 T


                 s   488c                 8    t                               d|           S )Nz\1\2\4)AUTH_PATTERNsubr@  s    rX   _strip_auth_from_liner    s    It,,,rW   c                 8    t                               d|           S )Nz\3)DOMAIN_PATTERNr  r@  s    rX   _extract_domainr    s    eT***rW   c                    |                                                      d          }t          d |D                       }t          d t	          ||          D                       }d                    |          }|                     d          r|dz  }|r'd                    d |D                       }d| d| S |S )Nrg   c              3   l   K   | ]/}t                               |          rt          |          n|V  0d S rq   )r  r  r  r   s     rX   r   z,_strip_auth_from_lockfile.<locals>.<genexpr>  sW       $ $ (3'8'8'>'>Hd###D$ $ $ $ $ $rW   c                 >    h | ]\  }}||k    t          |          S rV   )r  )r   rY   stripped_lines      rX   	<setcomp>z,_strip_auth_from_lockfile.<locals>.<setcomp>  s9     	
 	
 	
#m}$$ M**$$$rW   c              3       K   | ]	}d | V  
dS )z# - NrV   )r   domains     rX   r   z,_strip_auth_from_lockfile.<locals>.<genexpr>  s(      (X(XV(X(X(X(X(X(XrW   z0# The following domains require authentication:
)rh   ri   tupler   zipr   r   )re   lockfile_linesstripped_lockfile_linesstripped_domainsstripped_lockfilestripped_domains_docs         rX   _strip_auth_from_lockfiler    s   ^^%%++D11N# $ $"$ $ $   	
 	
'*>;R'S'S	
 	
 	
  		"9:: "T! o#yy(X(XGW(X(X(XXXnCWnn[lnnnrW   r  force_platformc              #     K   t          t          j        |                     }|dv r| V  dS t          t          j        |                     }|pt	                      }||j        j        vrd}|d                    |g|j        j                  z  }dd                    |g|j        j                  z   }t          d|  d| d	d
                    |j        j                   d| d| d| d          t                      }	|j        j
        D ]}
|	                    |
j                   d t          j                                        D             }|	|z
  }|r4d
                    t!          |                    }t#          d|           t%          |d|||d          }t'          d                    |          dz             5 }|V  ddd           dS # 1 swxY w Y   dS )a?  
    Render lock content into a temporary, explicit lockfile for the current platform

    Parameters
    ----------
    filename :
        Path to conda-lock.yml
    include_dev_dependencies :
        Include development dependencies in output
    extras :
        Optional dependency groups to include in output

    )rG   rK   Nzplatforms:
- z
- z--platform=z --platform=zThe lockfile z6 does not contain a solution for the current platform zD. The lockfile only contains solutions for the following platforms: r   z. In order to add support for z_, you must regenerate the lockfile. Either add the following section to your environment.yml:

z=

or add the following arguments to the conda-lock command:

z

c                     h | ]	\  }}||
S rV   rV   )r   r   vs      rX   r  z/_render_lockfile_for_install.<locals>.<setcomp>2  s!    ???tq!Q????rW   z<Cannot run render lockfile.  Missing environment variables: rG   T)re   r   rk   r   r   r  rg   )_detect_lockfile_kindr   r   r,   r   r   r   r   r%   r   rK  r   used_env_varsosenvironr  r   r$   r  r   )r  r   r   r  r   lock_contentrk   suggested_platforms_sectionsuggested_platform_argsrequired_env_varsr7  existing_env_varsmissing_env_varsmsgcontentr/  s                   rX   _render_lockfile_for_installr    s     ( !h!7!788D"""(h)?)?@@L2!2!2H|,666&6##v{{8-78(
 (
 	
# #0.2E2E8-783
 3
 #
 &-H - - - -$(IIl.C.M$N$N- - )1- -
 +- - '- - -	
 	
 		
 #&%%(1 8 8  !67777??rz'7'7'9'9???(+<< 
ii/0011 P3PP
 
 	
 +!9.2  G 
&dii&8&84&?	@	@ D


                 s   GG"%G"r/  c                 F   |                      d          }dd |                                D             v rdS 	 t          j        |          }ddht	          |          k    rdS d	|v rd
S t          d|            # t          j        $ r t          d|  d          w xY w)Nutf-8encodingz	@EXPLICITc                 6    h | ]}|                                 S rV   r?  r   s     rX   r  z(_detect_lockfile_kind.<locals>.<setcomp>H  s     EEEtzz||EEErW   rG   rK  r   rK   r   rI   z)Could not detect the kind of lockfile at zA. Note that explicit lockfiles must contain the line '@EXPLICIT'.)	read_text
splitlinesr   rr  r   rR   r   )r/  r  re   s      rX   r  r  F  s    nngn..GEE0B0B0D0DEEEEEz
>'**'3x==885  6!"Td"T"TUUU> 
 
 
!; ; ; ;
 
 	

s   )A= %A= +A= =#B c           
      J     t          j        t                                                      rt	                     } fd|j        j        D             }t          d |D                       r/|}t          	                    dd |D              d  d           nd |D             }t                                          }t            d	d
 |D              dd |D              dd |D              dt          j                   nd t          D             }t          |          dk    r/t                              d           t          j        d           nEt          |          dk    r2t                              d| d           t          j        d           |S )zNo sources were specified on the CLI, so try to read them from the lockfile.

    If none are found, then fall back to the default files.
    Nc                 P   g | ]}t          j        |                                          s&t          j        |                                          rt          j        |          n?t          j        t          j                  j        t          j        |          z            S rV   )r   PurePosixPathis_absolutePureWindowsPathr   r  )r   rR  r   s     rX   r   z4handle_no_specified_source_files.<locals>.<listcomp>e  s     $
 $
 $
  (++7799 *1--99;;Q \)-88?+A../ $
 $
 $
rW   c              3   >   K   | ]}|                                 V  d S rq   r   r   rR  s     rX   r   z3handle_no_specified_source_files.<locals>.<genexpr>r  s*      <<aqxxzz<<<<<<rW   zUsing source files c                 ,    g | ]}t          |          S rV   r   r  s     rX   r   z4handle_no_specified_source_files.<locals>.<listcomp>u  s    &P&P&P!s1vv&P&P&PrW   z from z to create the environment.c                 :    g | ]}|                                 |S rV   r  r  s     rX   r   z4handle_no_specified_source_files.<locals>.<listcomp>y  s%    MMMQ!((**MqMMMrW   z was created from c                 ,    g | ]}t          |          S rV   r  r  s     rX   r   z4handle_no_specified_source_files.<locals>.<listcomp>|  s    4^4^4^SVV4^4^4^rW   z, but some files (c                 ,    g | ]}t          |          S rV   r  r  s     rX   r   z4handle_no_specified_source_files.<locals>.<listcomp>}  s    $=$=$=SVV$=$=$=rW   z ) do not exist. Falling back to c                 ,    g | ]}t          |          S rV   r  r  s     rX   r   z4handle_no_specified_source_files.<locals>.<listcomp>~  s    777SVV777rW   rP   r   c                 :    g | ]}|                                 |S rV   r  )r   r  s     rX   r   z4handle_no_specified_source_files.<locals>.<listcomp>  s%    DDD1DQDDDrW   r   z=No source files provided and no default files found. Exiting.rF   zMultiple default files found: z
. Exiting.)r   r   r   r   r,   r   r  allr   r   DEFAULT_FILESr}   r   r   r   r  r   r  )r   r  locked_environment_filesenvironment_filesmissings   `    rX    handle_no_specified_source_filesr  Y  s5    %:;; ),];;$
 $
 $
 $
 "*2$
 $
 $
  <<#;<<<<< 	 8NNC&P&P7O&P&P&P C C%C C C   
 NM":MMMG - 2 2 4 4  ; ;4^4^E]4^4^4^ ; ;$=$=W$=$=$=; ;77%6777; ; ; Z	     EDDDD !!Q&&LLO   HQKKKK"##a''LLW:KWWWXXXHQKKKrW   )r   r?   r@   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  rB   r?   r@   c                   t          |           dk    rt          |	          } t          |||          }t                              d|            t          j        |dgd                                          }t                              d|            t          di d|d	| d
|d|d|d|d|d|pt          d|	d|d|d|d|
d|d|d|d|d| d S )Nr   r?   r@   zUsing conda executable: z	--versionr  r  zExecutable has version: rA   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rV   )
r  r  r*   r   rN  
subprocesscheck_outputrh   r   rM   )r  rB   r   r?   r@   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   
_conda_exeversion_infos                         rX   run_lockr    s   . ""<]KK+:  J LL8J88999*	[!G  egg  LL:L::;;;   j## %9 ,+	
 21 ) v $} $m ,+ ":!9 v *) ,+ *)  &~!" :#$  K%   rW   )clsr   default_if_no_argsc                      dS )zCTo get help for subcommands, use the conda-lock <SUBCOMMAND> --helpNrV   rV   rW   rX   r   r     s	     	DrW   DEBUGINFOWARNINGERRORCRITICALz--helpz-h)show_defaulthelp_option_names)context_settingsz--condaz4path (or name) of the conda/mamba executable to use.CONDA_LOCK_CONDA)r   helpenvvarz--mamba/--no-mambaz&don't attempt to use or install mamba.CONDA_LOCK_MAMBAz--micromamba/--no-micromambaz+don't attempt to use or install micromamba.CONDA_LOCK_MICROMAMBAz-pz
--platformz/generate lock files for the following platforms)multipler  z-cz	--channelzOverride the channels to use when solving the environment. These will replace the channels as listed in the various source files.z(--dev-dependencies/--no-dev-dependenciesz;include dev dependencies in the lockfile (where applicable))is_flagr   r  z-fr   filesz,path to a conda environment specification(s))r  r	  r  z-kz--kindzQKind of lock file(s) to generate [should be one of 'lock', 'explicit', or 'env'].)r   r  r	  r  z--filename-templatezconda-{platform}.lockzTemplate for single-platform (explicit, env) lock file names. Filename must include {platform} token, and must not end in '.yml'. For a full list and description of available tokens, see the command help text.)r   r  z
--lockfilez,Path to a conda-lock.yml to create or updatez--strip-authz3Strip the basic auth credentials from the lockfile.z-ez--extrasz
--categoryzWhen used in conjunction with input sources that support extras/categories (pyproject.toml) will add the deps from those extras to the render specificationz--filter-categoriesz--filter-extraszuIn conjunction with extras this will prune out dependencies that do not have the extras specified when loading files.z--check-input-hashzCheck existing input hashes in lockfiles before regenerating lock files.  If no files were updated exit with exit code 4.  Incompatible with --strip-authz--log-levelz
Log level.)r  r  r  r  r   )r  r   r  z--pdbz5Drop into a postmortem debugger if conda-lock crashes)r
  r  z--virtual-package-specz)Specify a set of virtual packages to use.)r  r  z--updatezBPackages to update to their latest versions. If empty, update all.z--pypi_to_conda_lookup_filezILocation of the lookup file containing Pypi package names to conda names.z--mdz
--metadatac                     g | ]	}|j         
S rV   valuer   mds     rX   r   r   T      999Brx999rW   z'Metadata fields to include in lock-file)r   r	  r  r  z--with-cudazSpecify cuda version to use in virtual packages. Avoids warning about implicit acceptance of cuda dependencies. Ignored if virtual packages are specified.)r  r   r  z--without-cudazzDisable cuda in virtual packages. Prevents accepting cuda variants of packages. Ignored if virtual packages are specified.)
flag_valuer   r  z--mdyz--metadata-yamlz--metadata-jsonz_YAML or JSON file(s) containing structured metadata to add to metadata section of the lockfile.ctxdev_dependencies	log_levelpdbpypi_to_conda_lookup_filec           	         t          j        |           |t          n|}t          d |D                       }d |D             }|rt          t
          _        |at          j        d          t          j        d          g}|D ]5}|	                                rt                              d|           |} n6nt          j        |          }t          |          }t          t          fi d|d	|d
|d|d|d|d|d|d|
dnt          j        |
          d|d|d|d|d|d|d|dd |D             d|d|}|rt          j                    5 }| d|	                    d          d          } ||           d                    |	                    d          dd                   } t%          j        |          D ]l}!t)          t$          j                            ||!                    }"t-          |"          }"t/          |"t$          j                            | |!                     m	 ddd           dS # 1 swxY w Y   dS  ||	           dS )a  Generate fully reproducible lock files for conda environments.

    By default, a multi-platform lock file is written to conda-lock.yml.

    When choosing the "explicit" or "env" kind, lock files are written to
    conda-{platform}.lock. These filenames can be customized using the
    --filename-template argument. The following tokens are available:

    
        platform: The platform this lock file was generated for (conda subdir).
        dev-dependencies: Whether or not dev dependencies are included in this lock file.
        input-hash: A sha256 hash of the lock file input specification.
        version: The version of conda-lock used to generate this lock file.
        timestamp: The approximate timestamp of the output file in ISO8601 basic format.
    levelNc              3   4   K   | ]}t          |          V  d S rq   )r3   r  s     rX   r   zlock.<locals>.<genexpr>  s*      NNrr 2 2NNNNNNrW   c                 6    g | ]}t          j        |          S rV   r   r   r   r|   s     rX   r   zlock.<locals>.<listcomp>  s"    >>>d++>>>rW   zvirtual-packages.ymlzvirtual-packages.yamlzUsing virtual packages from %sr  rB   r   r?   r@   r   r   r   r   r   r   r   r   r   r   r   r   c                 6    g | ]}t          j        |          S rV   r  )r   r/  s     rX   r   zlock.<locals>.<listcomp>  s"    FFFtT**FFFrW   r   r   /r*  )r   )rM  basicConfigr6   r   _handle_exception_post_mortemr   
excepthookr   r   r   r   infor   r  tempfileTemporaryDirectoryri   r   r  listdirr   r/  r  r   )#r  rA   r?   r@   rk   r   r  r  r   r   re   r   r   r   r   r  r  r   r  r   r   r   r   r   metadata_enum_choicesr  
candidatesr  extras_	lock_functempdirfilename_template_tempfilename_template_dirr|   lockfile_contents#                                      rX   rI   rI     s   | i((((
 %, 	&   NN=MNNNNN>>>>>
 76#L/00L011

  	 	Axxzz <a@@@'($
  '|,@AA&kkG  ++ % (	
 e : "2!1 ,+ d '.ddGL4J4J *) w 21 ) v  ,+!" /.#$ GF~FFFF%& :'(  K)I,  
7(** 	Xg(/%T%T2C2I2I#2N2Nr2R%T%T"I(>????$'HH->-D-DS-I-I#2#-N$O$O!
7++ X X#,RW\\'4-H-H#I#I #<=M#N#N +RW\\:OQU-V-VWWWWX		X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 		$5666666s   CI

IIr   r   zOInstall using `--copy` to prevent links. This is useful for building containersz--prefixz0Full path to environment location (i.e. prefix).)r  z-nz--namezName of environment.z--authzDThe auth file provided as string. Has precedence over `--auth-file`.)r  r   z--auth-filez Path to the authentication file.z*--validate-platform/--no-validate-platformzaWhether the platform compatibility between your lockfile and the host system should be validated.z--dev/--no-devz=install dev dependencies from the lockfile (where applicable)z-Ez?include extra dependencies from the lockfile (where applicable))r	  r   r  z--force-platformzaForce using the given platform when installing from the lockfile, instead of the native platform.z	lock-file)r   r  	lock_file	auth_filevalidate_platformr   c                 $   t          j        |          }|                                s5t          |                                            t          j        d           	 t          j        |           t          |||||||||	|
|||           d S )NrF   r  )rA   r?   r@   r}   rz   r{   r0  r  r1  r2  r   r   r  )
r   r   r   r   get_helpr   r  rM  r!  r   )r  rA   r?   r@   r}   rz   r{   r0  r  r1  r2  r  r   r   r  s                  rX   click_installr5    s    j Y''I cllnn!i((((+%     rW   c                    |g }|rt          j        |          n|rt          |          nd }t          | ||          }t	          t
          ||||          }|	rbt          |          dk    rOt          |          }	 t          |           n/# t          $ r"}t          |j
        d         dz             d }~ww xY wt          ||
t          |          |          5 }|Bt          t          |          |          5 } ||           d d d            n# 1 swxY w Y   n ||           d d d            d S # 1 swxY w Y   d S )Nr  )rA   rz   r{   r}   rI   r   z2 Disable validation with `--no-validate-platform`.)r   r   r  r   )r   rr  r   r*   r   r   r  r   ry   r%   argsr  r   r  )rA   r?   r@   r}   rz   r{   r0  r  r1  r2  r   r   r  _authr  install_funcrm   r   re   r  s                       rX   r   r   O  s    ~ $Ut)*U)I*>*>*>QU 
 ,E:VVVJ
64  L  29==GG%i00	 !23333& 	 	 	)
1 TT  	 
&!$6{{%	
 
 
 
(
 
9X..66 6:L"455556 6 6 6 6 6 6 6 6 6 6 6 6 6 6 Lh''''
( 
( 
( 
( 
( 
( 
( 
( 
( 
( 
( 
( 
( 
( 
( 
( 
( 
(sN   >B 
B:B55B: D;=D
D;D	D;D	D;;D?D?renderz!Kind of lock file(s) to generate.zTemplate for the lock file names. Filename must include {platform} token, and must not end in '.yml'. For a full list and description of available tokens, see the command help text.zWhen used in conjunction with input sources that support extras (pyproject.toml) will add the deps from those extras to the input specificationz-render lock files for the following platforms)r   c	           	         t          j        |           |rt          t          _        t          j        |          }|                                sTt          d| dt          j	                   t          | 
                                           t          j        d           t          |          }	t          |	|||t          |          |           dS )zHRender multi-platform lockfile into single-platform env or explicit filer  zERROR: Lockfile z does not exist.

r   rF   )r   r   r   r   r   N)rM  r!  r"  r   r#  r   r   r   r   r   r4  r  r,   r   r   )
r  r  r   r   r   r  r0  r  rk   r  s
             rX   r:  r:  |  s    r i((((
 76 Y''I @@@@szRRRRcllnn(33L+!16{{"     rW   zrender-lock-spec)r   r  hiddenz@include dev dependencies in the lockfile spec (where applicable)z3path to a dependency specification, can be repeated	pixi.tomlrawz<Kind of lock specification to generate. Must be 'pixi.toml'.zBPath to a conda-lock.yml which references source files to be used.)r
  r   r  r<  z--stdoutz'Print the lock specification to stdout.)r  r  r<  )r	  r  r<  c                     g | ]	}|j         
S rV   r  r  s     rX   r   r   P  r  rW   )r   r	  r  r<  z7Specify cuda version to use in the system requirements.)r  r   r  r<  )r   r	  r  r  r<  z--pixi-project-namezName of the Pixi projectz
--editablezNAdd an editable pip dependency as name=path, e.g. --editable mypkg=./src/mypkg)r=  r>  stdoutpixi_project_nameeditablec                    t          |          }t          |          dk    rt          d          |ddhk    st          d          |d|vrt          d          |st          d          t          |          dk    rt	          d	| d
           ~t          |          dk    rt	          d| d
           ~|rt	          d| d           ~|*t          |t                    r|dk    rt          d          |rt	          d| d
           ~| t	          d|  d
           ~ |t	          d| d
           ~|t	          d| d
           ~|t	          d| d
           ~|
rt	          d|
 d
           ~
|t	          d| d
           ~|	Nt          |          dk    rt          d| d          t	          d|	 d           t          j        |	          }nd}~	g }|D ]}|	                    dd          }t          |          dk    rt          d| d          |\  }}|
                    d          st	          d | d!           |                    t          ||"                     t          j        |#           |t          n|} d$ |D             }!|rt           t"          _        t'          |!|||||t          |          ||||| |%           dS )&z5Combine source files into a single lock specificationr   z:No kind specified. Add `--kind=pixi.toml` or `--kind=raw`.r=  r>  z_Only 'pixi.toml' and 'raw' are supported at the moment. Add `--kind=pixi.toml` or `--kind=raw`.Nz:The --pixi-project-name option is only valid for pixi.tomlz7Only stdout is supported at the moment. Add `--stdout`.zMetadata options z will be ignored.zMetadata files zVirtual package spec zY will be ignored. Please add virtual packages by hand to the [system-requirements] table.rN   z2Please specify an explicit version to --with-cuda.zUpdate packages zConda executable zMamba option zMicromamba option zFilename template zStrip auth zCheck input hash z+Don't specify the lockfile if source files z are specified explicitly.zHIt is recommended to specify lockfile sources explicitly instead of via rP   r+  rF   )maxsplit   zCEditable dependency must contain '=' to specify name=path, but got zEditable dependency path zG should be relative to the project root, but it does not start with '.')r{   r/  r  c                 6    g | ]}t          j        |          S rV   r  r  s     rX   r   z$render_lock_spec.<locals>.<listcomp>  s"    666d##666rW   )r   r   r@  r   r   r   r   r   r   r   rA  r   	editables)r   r  rL  NotImplementedErrorr   
isinstancer   r   r   ri   r   r   r&   rM  r!  r6   r"  r   r#  do_render_lockspec)"rA   r?   r@   rk   r   r  r  r   r   re   r   r   r   r   r  r  r   r  r   r   r   r   r@  rA  rB  r   r   rG  ed	name_pathr{   r/  r   r   s"                                     rX   render_lock_specrM    sW   P IIE
5zzQUVVV[%(((!6
 
 	
 $E)A)AUVVV 
!E
 
 	
 q  D!1DDDEEE
>Q@~@@@AAA 
W$8 W W W	
 	
 	
 	)S)) 	Y"__%D    ;9999:::9999:::5U555666?*???@@@$F"3FFFGGG :8:888999#D!1DDDEEEu::>>)e ) ) )   	*&* * *	
 	
 	
  X..*,I C CHHS1H--	y>>Q!! ! !   
ds## 	8D 8 8 8   	+DAAABBBBi((((
 %, 	&  76666I
 76#+!16{{+#+     rW   )	r   r   r   r   r   r   r   rA  rG  rG  c                   t          |           dk    rt          |          } d }|rt          ||          }t          | ||||          }d|v rD|r3t	          d           t          |                    d                     nt          d          d	|v rIt          ||	|
|
          }|r%t          |	                                d           d S t          d          d S )Nr   r   r   r>  zJRaw lockspec is not intended to be stable between any conda-lock versions.rE  )indentz'Only stdout is supported at the moment.r=  )r   r   project_namerG  rN   )end)
r  r  r   r;   r   r   model_dump_jsonrH  r'   	as_string)r   r   r@  r   r   r   r   r   r   r   rA  r   rG  r   r   	pixi_tomls                   rX   rJ  rJ    s?     9~~4]CC	6: 
:%=f
 
 
 +-/  I ~~ 	Q3   )++1+556666%&OPPPe$*	
 
 
	  	Q)%%''R000000%&OPPP rW   exc_type	exc_valueexc_tracebackc                 8    dd l }|                    |           d S )Nr   )r  post_mortem)rU  rV  rW  r  s       rX   r"  r"  ;  s%    
 JJJOOM"""""rW   __main__)TNNFN)TNN)rZ   N)NNrV   rV   )__doc__r  importlib.utilr  r   rM  r  r   r,  rer  r   r%  
contextlibr   	functoolsr   importlib.metadatar   typesr   typingr   r   r	   r
   r   r   r   r   r   r   r   urllib.parser   clickr   ensureconda.apir   ensureconda.resolver   typing_extensionsr   conda_lock.click_helpersr   conda_lock.commonr   r   r   r   r   r   conda_lock.conda_solverr   conda_lock.content_hashr   r    conda_lock.content_hash_typesr!   r"   r#   conda_lock.errorsr$   r%   conda_lock.export_lock_specr&   r'   conda_lock.invoke_condar(   r)   r*   r+   conda_lock.lockfiler,   r-   #conda_lock.lockfile.v2prelim.modelsr.   r/   r0   r1   r2   r3   r4   r5   conda_lock.lookupr6   conda_lock.models.channelr7   conda_lock.models.lock_specr8    conda_lock.models.pip_repositoryr9   conda_lock.pypi_solverr:   conda_lock.src_parserr;   conda_lock.virtual_packager<   r=   r>   	getLoggerrS   r   r   r  compiler  r  r  r]   rc   
HAVE_MAMBAr  majorminorr   r  rH   __annotations__rJ   rL   TKindAllTKindRendarablerM   r   r  r   r   rL  rR   r   ra   rd   rl   ro   rI  rs   ry   r   r   r   	frozensetr   r   r  rn  rt  ry  r~  r   r  r  r  r  r  r  r  r  r  r  r_   version_optionr   	TLogLevelCONTEXT_SETTINGScommandoptionChoicepass_contextContextrI   DEFAULT_INSTALL_OPT_MAMBADEFAULT_INSTALL_OPT_MICROMAMBADEFAULT_INSTALL_OPT_COPY%DEFAULT_INSTALL_OPT_VALIDATE_PLATFORMDEFAULT_INSTALL_OPT_LOG_LEVELDEFAULT_INSTALL_OPT_DEVDEFAULT_INSTALL_OPT_LOCK_FILEargumentr5  r   r:  rM  rJ  BaseExceptionr"  rV   rW   rX   <module>r     sk&               				      				     



  % % % % % %       + + + + + +                                " ! ! ! ! !   ' ' ' ' ' ' / / / / / / % % % % % % 1 1 1 1 1 1                0 / / / / /                
 J I I I I I I I L L L L L L L L                  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 2 1 1 1 1 1 - - - - - - 9 9 9 9 9 9 : : : : : : - - - - - - 0 0 0 0 0 0          
	8	$	$/00,',?Q2R2RS rzFGG bj011 HII 2:344 RZ 788  KuEUt     	!##(8(>!(C(C	E
6777CHQKKK &0wz" / / /#	76? # # # '%.      $gfowu~EF
+WV_genLM DtE'*-wv>?@    ) 2fs** BA= 	 	 	 	 	* 	 	 	C HSM    S Xc]    <s <s < < < <# (3-    <C <E$),< < < < <
	
3 	
4 	
 	
 	
 	
(W(W(W (W ,	(W
 (W 
(W (W (W (WV     ",4[5E,F   * -1261537&*%)'+#)-"4=IKK-/#%[
 [
 [
[
 GL![
 H	[

 GL)[
 !#/[
  .[
 #7<0[
 Xc]#[
 #[
  }[
 [
 [%&[
 [
 ".1[
  W\*![
" }#[
$ %[
& '[
( 
)[
 [
 [
 [
B &*'+)-"15i
 i
i
E'%.'**==>?i
 #i
  }	i

 [%&i
 i
  .i
 
i
 i
 i
 i
f 38Y Y YY #Y [%&	Y
 
 33
4Y Y ,0Y 
#YY Y Y YH 26H? H? H?H? H? 	H?
 7mH? =)H? 'H? -.H? H? H? 

H? H? H? H?Vgl tCH~    $tCH~ $d38n $QU $ $ $ $	W\*	d38n	 	 	 	  &*154=IKK-/] ] ]] ] S	"	]
 <] -.] ".1] W\*] ] '] ] ] ] ] ]@4C 4tCH~ 4# 4 4 4 4C tCH~ #      4S> hw|6L    - - - - - -+# +# + + + +     ,  &*)-$(	D DlD"D [%&D SM	D
 glD D D DN
 
 
 
 
 
&3GL)3	',3 3 3 3t *.%)15'+*.,0")-37#&*#4=IKK-/)6 6 6GL)6 !6 &	6
 6 6 #6  .6  }6 HX&'6 GL)6 6 [%&6 #7<06 }6  Xc]#!6" #6$ ".1%6& W\*'6( )6* +6, 
-6 6 6 6r v$GGG	 	 	  HG	
 GFOIGJ		 %)$?OPP  f'788	?	   	1	   "	6"	   	:	    
Q   .	F	   		7   H		\   # 
]  
 	7  
 	>	   	 
g    
A    
e	   		GGG	H	H	   T W   		4  
 	M  
 !		T  
 
	99.999	:	:	2   	 
f    
F   		j	 	 	 *  $&*&()+/f7 f7	f7C=f7 f7 	f7
 smf7  }f7 f7 Hf7 5'%.'*:MMN
Of7 f7 x f7 f7 SMf7 f7 f7  !f7" 
#f7$ #8,%f7&  (}'f7( })f7* Xc]#+f7, sm-f7. X&/f70 
1f7 f7 f7 	 	                       98lf7R ' !&   (, % &   ,-B C C  i*:;;	?	   %	1	   "*	6"	   $	1   dJ%WXXXdH#9:::	O  
 m"DbQQQ01	l  
 	)	GGG	H	H	   #	H	   	J   	l  
 %BVVV'	'C=' ' 	'
 ' SM' 3-' |' 3-' !' ' ' 
' I' '  
!' ' '  WV      RQ  ;: YX     <;F'V  +5) ;$(C'"&$(*( *(C=*(*( *( 	*(
 SM*( 3-*( |*( 3-*( !*( *( 
*( T#Y*( SM*( 
*( *( *( *(Z h)9::.	F	   L	z5)	*	*	,   # 
A  
 	 
[   		GGG	H	H	   T W   	8	   %:;;;!	!! 5)<<=
>! 	!
 I! ! ! 
! sm! 
! ! !  <;        ;:Z!H  3CDD	?	   	1	   "	6	   	8	    
Q   .	K	   		>   	{E*	+	+	G    
]	   	M  
 	>   	 
g    
A    
e   	2  
 		GGG	H	H	   T W   		4	   	M	   !		T  
 
	99.999	:	:   		B    
F   		j
 
 
 		#	   		Y	  JC=JD>J J sm	J
  }J J HJ 7-.
/J  }J x J J SMJ J tnJ J  
!J" #8,#J$  (}%J& }'J( SM)J* sm+J, X&-J. /J0  }1J2 sm3J4 
5J J J  
 
                        EDXJd 3715%))-#,0#'+482Q 2Q 2QGL!2Q w1232Q 	2Q
 !#/2Q  .2Q #2Q [%&2Q 2Q GL)2Q }2Q  }2Q 2Q /012Q 
2Q 2Q 2Q 2Qj#=!## M*# 		# # # # zDFFFFF rW   