o
    Vh                      @  sl   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
 er,d dlmZ G dd	 d	eZd
S )    )annotations)TYPE_CHECKING)ClassVaroption)InstallerCommand)PluginManager)Optionc                      s   e Zd ZU dZdZg e edddedddeddd	d
ddedddeddddd
dedddedddedddedddZde	d< dZ
ddgZde	d < ed. fd#d$Zed/d&d'Zed0d)d*Zd1d,d-Z  ZS )2InstallCommandinstallz"Installs the project dependencies.syncNznSynchronize the environment with the locked packages and the specified groups. (<warning>Deprecated</warning>)no-rootz6Do not install the root package (the current project).no-directoryzDo not install any directory path dependencies; useful to install dependencies without source code, e.g. for caching of Docker layers)TF)flagmultipledry-runzQOutput the operations but do not execute anything (implicitly enables --verbose).extrasEz&Extra sets of dependencies to install.
all-extraszInstall all extra dependencies.
all-groupsz%Install dependencies from all groups.	only-rootzExclude all dependencies.compilez(Compile Python source files to bytecode.zClassVar[list[Option]]optionsa  The <info>install</info> command reads the <comment>poetry.lock</> file from
the current directory, processes it, and downloads and installs all the
libraries and dependencies outlined in that file. If the file does not
exist it will look for <comment>pyproject.toml</> and do the same.

<info>poetry install</info>

By default, the above command will also install the current project. To install only the
dependencies and not including the current project, run the command with the
<info>--no-root</info> option like below:

<info> poetry install --no-root</info>

If you want to use Poetry only for dependency management but not for packaging,
you can set the "package-mode" to false in your pyproject.toml file.
z#poetry.repositories.pypi_repositoryzpoetry.inspection.infozClassVar[list[str]]_loggersreturnset[str]c                   s   |  drt S t jS )Nr   )r   setsuperactivated_groupsself	__class__ s/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/poetry/console/commands/install.pyr   U   s   
zInstallCommand.activated_groupsstrc                 C  s   dS )Nzpoetry syncr#   r   r#   r#   r$   _alternative_sync_command\   s   z(InstallCommand._alternative_sync_commandboolc                 C  s*   |  d}|r| d| j d t|S )Nr   z<warning>The `<fg=yellow;options=bold>--sync</>` option is deprecated and slated for removal in the next minor release after June 2025, use the `<fg=yellow;options=bold>z</>` command instead.</warning>)r   
line_errorr&   r'   )r    with_synchronizationr#   r#   r$   _with_synchronization`   s   
z$InstallCommand._with_synchronizationintc           
   
     s  ddl m} ddlm} t j j  dr% dr% 	d dS  dr<t
 fd	d
dD r< 	d dS  drM drM 	d dS  ds\ ds\ drh drh 	d dS  drwt jjj }ng } dg D ]}|| 7 }q j|  j j  j d  j d  j j  jj d  j j   j }|dkr|S  dsՈ jjsdS d jjj d jjj d} jj  o j!  } "d  #|j$dd |s "d  dr "d dS z| j j% j}|&  W n& |t'fyJ }	 z "d  j	d|	 ddd  W Y d }	~	dS d }	~	ww |r\ (|j$d!d  "d dS )"Nr   )ModuleOrPackageNotFoundError)EditableBuilderr   r   z<error>You cannot specify explicit `<fg=yellow;options=bold>--extras</>` while installing using `<fg=yellow;options=bold>--all-extras</>`.</error>   r   c                 3  s    | ]}  |V  qd S )Nr   ).0keyr   r#   r$   	<genexpr>|   s    

z(InstallCommand.handle.<locals>.<genexpr>>   onlywithwithoutr   a  <error>The `<fg=yellow;options=bold>--with</>`, `<fg=yellow;options=bold>--without</>`, `<fg=yellow;options=bold>--only</>` and `<fg=yellow;options=bold>--all-groups</>` options cannot be used with the `<fg=yellow;options=bold>--only-root</>` option.</error>r   z}<error>You cannot specify `<fg=yellow;options=bold>--no-root</>` when using `<fg=yellow;options=bold>--only-root</>`.</error>r2   r3   r4   r   z<error>You cannot specify `<fg=yellow;options=bold>--with</>`, `<fg=yellow;options=bold>--without</>`, or `<fg=yellow;options=bold>--only</>` when using `<fg=yellow;options=bold>--all-groups</>`.</error>r   r   r   z*<b>Installing</> the current project: <c1>z</c1> (<{tag}>z</>) c2)tagz3Error: The current project could not be installed: aj  
If you do not want to install the current project use <c1>--no-root</c1>.
If you want to use Poetry only for dependency management but not for packaging, you can disable package mode by setting <c1>package-mode = false</> in your pyproject.toml file.
If you did intend to install the current project, you may need to set `packages` in your pyproject.toml file.
error)stylesuccess)) poetry.core.masonry.utils.moduler,    poetry.masonry.builders.editabler-   r   ensure_project_pluginspoetryior   r(   anylistpackager   keyssplit	installeronly_groupsr   skip_directorydry_runrequires_synchronizationr*   executorenable_bytecode_compilationverbose
is_verboserunis_package_modepretty_namepretty_versionoutputis_decoratedis_debuglinewriteformatenvbuildFileNotFoundError	overwrite)
r    r,   r-   r   extrareturn_codelog_installr[   builderer#   r   r$   handlem   s   	







zInstallCommand.handle)r   r   )r   r%   )r   r'   )r   r+   )__name__
__module____qualname__namedescriptionr   _group_dependency_optionsr   r   __annotations__helpr   propertyr   r&   r*   ra   __classcell__r#   r#   r!   r$   r
      sz   
 
 
!
"#*r
   N)
__future__r   typingr   r   cleo.helpersr   )poetry.console.commands.installer_commandr   poetry.plugins.plugin_managerr   cleo.io.inputs.optionr	   r
   r#   r#   r#   r$   <module>   s    