§
    ¬h’cf  ã                   óÞ   — 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	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 d
dlmZ dd„Zdd„Zdd„Zdd„Zd„ Zd„ Zd„ Zd„ Z ddgZ!dS )é    N)Úpartialé   )Úmake_app_data)ÚVirtualEnvConfigParser)ÚLEVELSÚsetup_report)ÚSession)Úmanual_upgrade)Ú__version__é   )ÚActivationSelector)ÚCreatorSelector)Úget_discover)ÚSeederSelectorTc                 ó¦   — |€t           j        n|}t          | |||¦  «        }|5  |                     ¦   «          ddd¦  «         n# 1 swxY w Y   |S )aó  
    Create a virtual environment given some command line interface arguments.

    :param args: the command line arguments
    :param options: passing in a ``VirtualEnvOptions`` object allows return of the parsed options
    :param setup_logging: ``True`` if setup logging handlers, ``False`` to use handlers already registered
    :param env: environment variables to use
    :return: the session object of the creation (its structure for now is experimental and might change on short notice)
    N)ÚosÚenvironÚsession_via_cliÚrun)ÚargsÚoptionsÚsetup_loggingÚenvÚ
of_sessions        ú9/usr/lib/python3/dist-packages/virtualenv/run/__init__.pyÚcli_runr      s—   € ð ˜�"Œ*ˆ*¨€CÝ   w°¸sÑCÔC€JØ	ð ð Ø�ŠÑÔÐðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð àÐs   ¥AÁA
ÁA
c                 ó   ‡— |€t           j        n|}t          | ‰||¦  «        \  }}|                     | ¦  «        Št	          ˆfd„|D ¦   «         ¦  «        \  }}}t          ‰j        ‰j        |j        |||¦  «        }	|	S )aq  
    Create a virtualenv session (same as cli_run, but this does not perform the creation). Use this if you just want to
    query what the virtual environment would look like, but not actually create it.

    :param args: the command line arguments
    :param options: passing in a ``VirtualEnvOptions`` object allows return of the parsed options
    :param setup_logging: ``True`` if setup logging handlers, ``False`` to use handlers already registered
    :param env: environment variables to use
    :return: the session object of the creation (its structure for now is experimental and might change on short notice)
    Nc              3   óB   •K  — | ]}|                      ‰¦  «        V — Œd S ©N)Úcreate)Ú.0Úer   s     €r   ú	<genexpr>z"session_via_cli.<locals>.<genexpr>0   s/   øè è € Ð'LÐ'L¸a¨¯ª°Ñ(9Ô(9Ð'LÐ'LÐ'LÐ'LÐ'LÐ'Ló    )	r   r   Úbuild_parserÚ
parse_argsÚtupler	   Ú	verbosityÚapp_dataÚ_interpreter)
r   r   r   r   ÚparserÚelementsÚcreatorÚseederÚ
activatorsr   s
    `        r   r   r   "   s‘   ø€ ð ˜�"Œ*ˆ*¨€CÝ# D¨'°=À#ÑFÔFÑ€FˆHØ×Ò Ñ%Ô%€GÝ"'Ð'LÐ'LÐ'LÐ'LÀ8Ð'LÑ'LÔ'LÑ"LÔ"LÑ€GˆV�ZÝ˜Ô*¨GÔ,<¸fÔ>QÐSZÐ\bÐdnÑoÔo€JØÐr$   c                 óH  — t          ||€t          j        n|¦  «        }t          |¦  «         |                     ddddd¬¦  «         t          || |¦  «         t          | ||¦  «        }t          |¦  «         t          || ¦  «        }|j	        x|_
        }|€t          d|› �¦  «        ‚t          ||¦  «        t          ||¦  «        t          ||¦  «        g}|                     | ¦  «        \  }}|D ]}	|	                     |¦  «         Œ|                     ¦   «          ||fS )Nz--with-tracebackÚwith_tracebackÚ
store_trueFz>on failure also display the stacktrace internals of virtualenv)ÚdestÚactionÚdefaultÚhelpzfailed to find interpreter for )r   r   r   Úadd_version_flagÚadd_argumentÚ_do_report_setupÚload_app_dataÚhandle_extra_commandsr   Úinterpreterr*   ÚRuntimeErrorr   r   r   Úparse_known_argsÚhandle_selected_arg_parseÚenable_help)
r   r   r   r   r+   Údiscoverr<   r,   Ú_Úelements
             r   r%   r%   5   sN  € Ý# G¸3¸;­R¬Z¨ZÈCÑPÔP€FÝ�VÑÔÐØ
×ÒØØØØØMð ñ ô ð õ �V˜T =Ñ1Ô1Ð1Ý˜D &¨'Ñ2Ô2€GÝ˜'Ñ"Ô"Ð"å˜F DÑ)Ô)€HØ(0Ô(<Ð<€FÔ˜+ØÐÝÐG¸XÐGÐGÑHÔHÐHå˜ VÑ,Ô,Ý�{ FÑ+Ô+Ý˜;¨Ñ/Ô/ð€Hð
 ×(Ò(¨Ñ.Ô.�J€GˆQØð 3ð 3ˆØ×)Ò)¨'Ñ2Ô2Ð2Ð2Ø
×ÒÑÔÐØ�8ÐÐr$   c                 ó,   — t          | ¦  «        d         S )z/Used to provide a parser for the doc generationr   )r%   )r   s    r   Úbuild_parser_onlyrE   S   s   € å˜ÑÔ˜aÔ Ð r$   c                 óf   — | j         r)t          | j        | j        ¦  «        }t	          |¦  «        ‚d S r   )Úupgrade_embed_wheelsr
   r)   r   Ú
SystemExit)r   Úresults     r   r;   r;   X   s9   € ØÔ#ð !Ý Ô 0°'´+Ñ>Ô>ˆÝ˜Ñ Ô Ð ð!ð !r$   c           
      óâ  — |                      ddd¬¦  «         |                     | |¬¦  «        \  }}|                      ddt          t          |j        |j        ¬¦  «        t          d |j        |j        ¬¦  «        ¬	¦  «         |                      d
dd¬¦  «         |                      ddd¬¦  «         |                     | |¬¦  «        \  }}|j        r|j                             ¦   «          |S )Nz--read-only-app-datar2   zMuse app data folder in read-only mode (write operations will fail with error))r4   r6   )Ú	namespacez
--app-dataz-a data folder used as cache by the virtualenv)Ú	read_onlyr   )r6   Útyper5   z--reset-app-dataz start with empty app data folderz--upgrade-embed-wheelsz.trigger a manual update of the embedded wheels)	r8   r>   r   r   Úread_only_app_datar   Úreset_app_datar)   Úreset)r   r+   r   rB   s       r   r:   r:   ^   s,  € Ø
×ÒØØØ\ð ñ ô ð ð
 ×(Ò(¨¸Ð(ÑAÔA�J€GˆQð ×ÒØØ<Ý•]¨gÔ.HÈgÌkÐZÑZÔZÝ˜d¨gÔ.HÈgÌkÐZÑZÔZð	 ñ ô ð ð ×ÒØØØ/ð ñ ô ð ð
 ×ÒØ ØØ=ð ñ ô ð ð
 ×(Ò(¨¸Ð(ÑAÔA�J€GˆQØÔð !ØÔ×ÒÑ Ô Ð Ø€Nr$   c                 ó`   — dd l }|                      dddt          › d|j        › �d¬¦  «         d S )Nr   z	--versionÚversionz	%(prog)s z from zIdisplay the version of the virtualenv package and its location, then exit)r4   rR   r6   )Ú
virtualenvr8   r   Ú__file__)r+   rS   s     r   r7   r7   }   sT   € ØÐÐÐà
×ÒØØØD�KÐDÐD¨zÔ/BÐDÐDØXð	 ñ ô ð ð ð r$   c           	      ó  — d                      d„ t          t          j        ¦   «         ¦  «        D ¦   «         ¦  «        }d}|                      d|                     t          j        t          d         ¦  «        |¦  «        ¬¦  «        }|                     ¦   «         }| 	                    ddd	d
dd¬¦  «         | 	                    ddd	ddd¬¦  «         |  
                    |¦  «        \  }}|rt          |j        ¦  «         d S d S )Nz, c              3   óN   K  — | ] \  }}t          j        |¦  «        › d |› �V — Œ!dS )ú=N)ÚloggingÚgetLevelName)r!   ÚcÚls      r   r#   z#_do_report_setup.<locals>.<genexpr>‰   s?   è è € Ð^Ð^¹t¸qÀ!�WÔ1°!Ñ4Ô4Ð:Ð:°qÐ:Ð:Ð^Ð^Ð^Ð^Ð^Ð^r$   z6verbosity = verbose - quiet, default {}, mapping => {}r(   é   )ÚtitleÚdescriptionz-vz	--verboseÚcountÚverbosezincrease verbosityr   )r4   r3   r6   r5   z-qz--quietÚquietzdecrease verbosityr   )ÚjoinÚsortedr   ÚitemsÚadd_argument_groupÚformatrX   rY   Úadd_mutually_exclusive_groupr8   r>   r   r(   )	r+   r   r   Ú	level_mapÚmsgÚverbosity_groupr(   ÚoptionrB   s	            r   r9   r9   ˆ   s  € Ø—	’	Ð^Ð^ÅvÍfÌlÉnÌnÑG]ÔG]Ð^Ñ^Ô^Ñ^Ô^€IØ
B€CØ×/Ò/ØØ—J’J�wÔ3µF¸1´IÑ>Ô>À	ÑJÔJð 0ñ ô €Oð  ×<Ò<Ñ>Ô>€IØ×Ò˜4 °WÀ9ÐSgÐqrÐÑsÔsÐsØ×Ò˜4 °7ÀÐOcÐmnÐÑoÔoÐoØ×'Ò'¨Ñ-Ô-�I€FˆAØð 'Ý�VÔ%Ñ&Ô&Ð&Ð&Ð&ð'ð 'r$   r   r   )NTN)NNTNr   )"rX   r   Ú	functoolsr   r)   r   Úconfig.cli.parserr   Úreportr   r   Úrun.sessionr	   Úseed.wheels.periodic_updater
   rR   r   Úplugin.activatorsr   Úplugin.creatorsr   Úplugin.discoveryr   Úplugin.seedersr   r   r   r%   rE   r;   r:   r7   r9   Ú__all__© r$   r   ú<module>rw      s‚  ðØ €€€Ø 	€	€	€	Ø Ð Ð Ð Ð Ð à $Ð $Ð $Ð $Ð $Ð $Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø !Ð !Ð !Ð !Ð !Ð !Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø !Ð !Ð !Ð !Ð !Ð !Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø *Ð *Ð *Ð *Ð *Ð *Ø *Ð *Ð *Ð *Ð *Ð *ðð ð ð ð"ð ð ð ð&ð ð ð ð<!ð !ð !ð !ð
!ð !ð !ðð ð ð>ð ð ð'ð 'ð 'ð  Øð€€€r$   