
    DIe
                         d 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 ddlmZ ddlmZmZ  ee          Zd	 Zd
 ZdS )zPip-flavored installer.    N)	getLogger)Utf8NamedTemporaryFile)context)Spinner)CONDA_SESSION_SCHEMES)get_pip_installed_packagespip_subprocessc                    |j                             dd          d         }|t          v rd}n`	 t          j        t          j        |j                             }t          j        |t          j                  sd}n# t          $ r d}Y nw xY wd}	 t          ddd|d	          }|                    d
                    |                     |                                 ddd|j        dg}t          || |          \  }	}
|st          j        |j                  rZdt          j        vrt          j        |j                   nt&                              d                    |j                             n|# |tt          j        |j                  r\dt          j        vrt          j        |j                   w t&                              d                    |j                             w w w xY wt-          |	          S )a  
    Installs the pip dependencies in specs using a temporary pip requirements file.

    Args
    ----
    prefix: string
      The path to the python and pip executables.

    specs: iterable of strings
      Each element should be a valid pip dependency.
      See: https://pip.pypa.io/en/stable/user_guide/#requirements-files
           https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
    z://   r   Nwz	condaenv.z.requirements.txtF)modeprefixsuffixdirdelete
installz-Uz-rz--exists-action=b)cwdCONDA_TEST_SAVE_TEMPSz:CONDA_TEST_SAVE_TEMPS :: retaining pip requirements.txt {})filesplitr   opdirnameabspathosaccessW_OKAttributeErrorr   writejoinclosenamer	   isfileenvironremovelogwarningformatr   )r   specsargs_kwargs
url_schemepip_workdirrequirementspip_cmdstdoutstderrs              8lib/python3.11/site-packages/conda_env/installers/pip.py_pip_install_via_requirementsr4      s    **1-J***	*RZ	%:%:;;K9["'22 #" 	 	 	KKK	L-&
 
 
 	499U++,,, dD,*;=PQ'[III #	,2C(D(D#&bj88	,+,,,,PWW$)   	 #	,2C(D(D#&bj88	,+,,,,PWW$)    	 $# &f---s    AA< <B
BA1E8 8A9G1c                      t          dt          j         ot          j         t          j                  5  t          | i |cd d d            S # 1 swxY w Y   d S )NzInstalling pip dependencies)r   r   verbosequietjsonr4   )r*   r,   s     r3   r   r   H   s    	%O1GM 1
 
 > >
 -d=f==> > > > > > > > > > > > > > > > > >s   AAA)__doc__r   os.pathpathr   loggingr   conda.auxlib.compatr   conda.base.contextr   conda.common.ior   !conda.gateways.connection.sessionr   conda_env.pip_utilr   r	   __name__r&   r4   r        r3   <module>rE      s      				             6 6 6 6 6 6 & & & & & & # # # # # # C C C C C C I I I I I I I Ii4. 4. 4.n> > > > >rD   